useFloorPlans
Floor plan data and operations composable.
Import
typescript
const {
floorPlans,
currentFloorPlan,
stories,
isLoading,
fetchFloorPlans,
fetchStories,
uploadFloorPlan,
linkPipItem,
unlinkPipItem,
saveElements,
loadElements,
} = useFloorPlans(projectId)Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | Ref<string> | Reactive project UUID |
Return Values
| Property | Type | Description |
|---|---|---|
floorPlans | Ref<FloorPlan[]> | All floor plans for the project |
currentFloorPlan | Ref<FloorPlan | null> | Currently selected floor plan |
stories | Ref<BuildingStory[]> | Building stories |
isLoading | Ref<boolean> | Loading state |
linkedPipItems | ComputedRef<PipItem[]> | PIP items linked to current floor plan |
Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
fetchFloorPlans | — | Promise<void> | Load all floor plans |
fetchStories | — | Promise<void> | Load building stories |
uploadFloorPlan | file: File, storyId?: string | Promise<FloorPlan> | Upload floor plan |
linkPipItem | pipItemId: string, floorPlanId: string | Promise<void> | Link PIP item to plan |
unlinkPipItem | pipItemId: string, floorPlanId: string | Promise<void> | Unlink PIP item |
saveElements | floorPlanId: string, elements: Element[] | Promise<void> | Save canvas elements |
loadElements | floorPlanId: string | Promise<Element[]> | Load canvas elements |
savePlacements | floorPlanId: string, placements: Placement[] | Promise<void> | Save spec placements |
Source
app/composables/useFloorPlans.ts