Skip to content

useFloorPlans

Floor plan data and operations composable.

Import

typescript
const {
  floorPlans,
  currentFloorPlan,
  stories,
  isLoading,
  fetchFloorPlans,
  fetchStories,
  uploadFloorPlan,
  linkPipItem,
  unlinkPipItem,
  saveElements,
  loadElements,
} = useFloorPlans(projectId)

Parameters

ParameterTypeDescription
projectIdRef<string>Reactive project UUID

Return Values

PropertyTypeDescription
floorPlansRef<FloorPlan[]>All floor plans for the project
currentFloorPlanRef<FloorPlan | null>Currently selected floor plan
storiesRef<BuildingStory[]>Building stories
isLoadingRef<boolean>Loading state
linkedPipItemsComputedRef<PipItem[]>PIP items linked to current floor plan

Methods

MethodParametersReturnsDescription
fetchFloorPlansPromise<void>Load all floor plans
fetchStoriesPromise<void>Load building stories
uploadFloorPlanfile: File, storyId?: stringPromise<FloorPlan>Upload floor plan
linkPipItempipItemId: string, floorPlanId: stringPromise<void>Link PIP item to plan
unlinkPipItempipItemId: string, floorPlanId: stringPromise<void>Unlink PIP item
saveElementsfloorPlanId: string, elements: Element[]Promise<void>Save canvas elements
loadElementsfloorPlanId: stringPromise<Element[]>Load canvas elements
savePlacementsfloorPlanId: string, placements: Placement[]Promise<void>Save spec placements

Source

app/composables/useFloorPlans.ts

Built with VitePress