floor-editor-ts 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/App.svelte.d.ts +1 -0
  2. package/dist/favicon.svg +1 -0
  3. package/dist/floor-editor-ts.css +2736 -0
  4. package/dist/floor-editor.es.js +70346 -0
  5. package/dist/floor-editor.es.js.map +1 -0
  6. package/dist/icons.svg +24 -0
  7. package/dist/lib/components/OnboardingTooltip.svelte.d.ts +1 -0
  8. package/dist/lib/components/editor/AlignmentToolbar.svelte.d.ts +1 -0
  9. package/dist/lib/components/editor/CommandPalette.svelte.d.ts +1 -0
  10. package/dist/lib/components/editor/ContextMenu.svelte.d.ts +1 -0
  11. package/dist/lib/components/editor/FloorPlanCanvas.svelte.d.ts +1 -0
  12. package/dist/lib/components/editor/PrintLayout.svelte.d.ts +1 -0
  13. package/dist/lib/components/editor/UndoHistoryPanel.svelte.d.ts +1 -0
  14. package/dist/lib/components/sidebar/AreaSummaryPanel.svelte.d.ts +1 -0
  15. package/dist/lib/components/sidebar/BuildPanel.svelte.d.ts +1 -0
  16. package/dist/lib/components/sidebar/LayersPanel.svelte.d.ts +1 -0
  17. package/dist/lib/components/sidebar/PropertiesPanel.svelte.d.ts +1 -0
  18. package/dist/lib/components/toolbar/SettingsDialog.svelte.d.ts +1 -0
  19. package/dist/lib/components/toolbar/TopBar.svelte.d.ts +1 -0
  20. package/dist/lib/components/toolbar/VersionHistoryPanel.svelte.d.ts +1 -0
  21. package/dist/src/define-web-component.d.ts +1 -0
  22. package/dist/src/lib/firebase.d.ts +1 -0
  23. package/dist/src/lib/index.d.ts +1 -0
  24. package/dist/src/lib/models/types.d.ts +160 -0
  25. package/dist/src/lib/services/datastore.d.ts +15 -0
  26. package/dist/src/lib/stores/aiKeys.d.ts +9 -0
  27. package/dist/src/lib/stores/onboarding.svelte.d.ts +15 -0
  28. package/dist/src/lib/stores/project.d.ts +162 -0
  29. package/dist/src/lib/stores/saveStatus.d.ts +12 -0
  30. package/dist/src/lib/stores/settings.d.ts +25 -0
  31. package/dist/src/lib/stores/theme.d.ts +5 -0
  32. package/dist/src/lib/stores/versionHistory.d.ts +16 -0
  33. package/dist/src/lib/utils/alignment.d.ts +2 -0
  34. package/dist/src/lib/utils/cadExport.d.ts +3 -0
  35. package/dist/src/lib/utils/canvasInteraction.d.ts +30 -0
  36. package/dist/src/lib/utils/canvasRenderer.d.ts +34 -0
  37. package/dist/src/lib/utils/export.d.ts +13 -0
  38. package/dist/src/lib/utils/furnitureCatalog.d.ts +16 -0
  39. package/dist/src/lib/utils/furnitureIcons.d.ts +12 -0
  40. package/dist/src/lib/utils/furnitureModelLoader.d.ts +1 -0
  41. package/dist/src/lib/utils/furnitureModels3d.d.ts +1 -0
  42. package/dist/src/lib/utils/furnitureThumbnails.d.ts +1 -0
  43. package/dist/src/lib/utils/hitTesting.d.ts +16 -0
  44. package/dist/src/lib/utils/houseTemplates.d.ts +10 -0
  45. package/dist/src/lib/utils/images.d.ts +23 -0
  46. package/dist/src/lib/utils/materials.d.ts +17 -0
  47. package/dist/src/lib/utils/roomDetection.d.ts +11 -0
  48. package/dist/src/lib/utils/roomPresets.d.ts +13 -0
  49. package/dist/src/lib/utils/roomTemplates.d.ts +25 -0
  50. package/dist/src/lib/utils/roomplanImport.d.ts +19 -0
  51. package/dist/src/lib/utils/shortcuts.d.ts +5 -0
  52. package/dist/src/lib/utils/textureGenerator.d.ts +9 -0
  53. package/dist/src/main.d.ts +5 -0
  54. package/package.json +11 -17
package/dist/icons.svg ADDED
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export { SvelteComponent as default } from 'svelte';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,160 @@
1
+ export interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface Wall {
6
+ id: string;
7
+ start: Point;
8
+ end: Point;
9
+ thickness: number;
10
+ height: number;
11
+ color: string;
12
+ /** Optional quadratic bezier control point for curved walls */
13
+ curvePoint?: Point;
14
+ texture?: string;
15
+ /** Interior-specific overrides (if different from exterior) */
16
+ interiorColor?: string;
17
+ interiorTexture?: string;
18
+ /** Exterior-specific overrides */
19
+ exteriorColor?: string;
20
+ exteriorTexture?: string;
21
+ }
22
+ export type RoomCategory = 'indoor' | 'outdoor' | 'garage' | 'utility';
23
+ export interface Room {
24
+ id: string;
25
+ name: string;
26
+ walls: string[];
27
+ floorTexture: string;
28
+ area: number;
29
+ color?: string;
30
+ roomType?: RoomCategory;
31
+ /** Custom label position offset from centroid (in world units) */
32
+ labelOffset?: Point;
33
+ }
34
+ export interface Door {
35
+ id: string;
36
+ wallId: string;
37
+ position: number;
38
+ width: number;
39
+ height: number;
40
+ type: 'single' | 'double' | 'sliding' | 'french' | 'pocket' | 'bifold';
41
+ swingDirection: 'left' | 'right';
42
+ flipSide: boolean;
43
+ }
44
+ export interface Window {
45
+ id: string;
46
+ wallId: string;
47
+ position: number;
48
+ width: number;
49
+ height: number;
50
+ sillHeight: number;
51
+ type: 'standard' | 'fixed' | 'casement' | 'sliding' | 'bay';
52
+ }
53
+ export interface FurnitureItem {
54
+ id: string;
55
+ catalogId: string;
56
+ position: Point;
57
+ rotation: number;
58
+ scale: {
59
+ x: number;
60
+ y: number;
61
+ z: number;
62
+ };
63
+ color?: string;
64
+ width?: number;
65
+ depth?: number;
66
+ height?: number;
67
+ material?: string;
68
+ locked?: boolean;
69
+ heatmapMatrix?: any;
70
+ }
71
+ export interface ElementGroup {
72
+ id: string;
73
+ elementIds: string[];
74
+ }
75
+ export type StairType = 'straight' | 'l-shaped' | 'u-shaped' | 'spiral';
76
+ export interface Stair {
77
+ id: string;
78
+ position: Point;
79
+ rotation: number;
80
+ width: number;
81
+ depth: number;
82
+ riserCount: number;
83
+ direction: 'up' | 'down';
84
+ stairType: StairType;
85
+ }
86
+ export interface Column {
87
+ id: string;
88
+ position: Point;
89
+ rotation: number;
90
+ shape: 'round' | 'square';
91
+ diameter: number;
92
+ height: number;
93
+ color: string;
94
+ }
95
+ export interface Measurement {
96
+ id: string;
97
+ x1: number;
98
+ y1: number;
99
+ x2: number;
100
+ y2: number;
101
+ }
102
+ export interface Annotation {
103
+ id: string;
104
+ x1: number;
105
+ y1: number;
106
+ x2: number;
107
+ y2: number;
108
+ label?: string;
109
+ offset: number;
110
+ }
111
+ export interface TextAnnotation {
112
+ id: string;
113
+ x: number;
114
+ y: number;
115
+ text: string;
116
+ fontSize: number;
117
+ color: string;
118
+ rotation: number;
119
+ }
120
+ export interface GuideLine {
121
+ id: string;
122
+ orientation: 'horizontal' | 'vertical';
123
+ position: number;
124
+ }
125
+ export interface BackgroundImage {
126
+ dataUrl: string;
127
+ position: Point;
128
+ scale: number;
129
+ opacity: number;
130
+ rotation: number;
131
+ locked: boolean;
132
+ }
133
+ export interface Floor {
134
+ id: string;
135
+ name: string;
136
+ level: number;
137
+ walls: Wall[];
138
+ rooms: Room[];
139
+ doors: Door[];
140
+ windows: Window[];
141
+ furniture: FurnitureItem[];
142
+ stairs: Stair[];
143
+ columns: Column[];
144
+ backgroundImage?: BackgroundImage;
145
+ guides: GuideLine[];
146
+ measurements: Measurement[];
147
+ annotations: Annotation[];
148
+ textAnnotations: TextAnnotation[];
149
+ groups: ElementGroup[];
150
+ }
151
+ export interface Project {
152
+ id: string;
153
+ name: string;
154
+ description?: string;
155
+ floors: Floor[];
156
+ activeFloorId: string;
157
+ thumbnail?: string;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ }
@@ -0,0 +1,15 @@
1
+ import { Project } from '../../../lib/models/types';
2
+ export interface DataStore {
3
+ save(project: Project): Promise<void>;
4
+ load(id: string): Promise<Project | null>;
5
+ list(): Promise<{
6
+ id: string;
7
+ name: string;
8
+ updatedAt: string;
9
+ }[]>;
10
+ delete(id: string): Promise<void>;
11
+ duplicate(id: string): Promise<Project | null>;
12
+ saveThumbnail(id: string, dataUrl: string): void;
13
+ getThumbnail(id: string): string | null;
14
+ }
15
+ export declare const localStore: DataStore;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AI API key management — stored in localStorage (browser-only, never sent to server).
3
+ */
4
+ export declare function getGeminiKey(): string | null;
5
+ export declare function hasGeminiKey(): boolean;
6
+ export declare function getOpenAIKey(): string | null;
7
+ export declare function hasOpenAIKey(): boolean;
8
+ export declare function setOpenAIKey(key: string): void;
9
+ export declare function removeOpenAIKey(): void;
@@ -0,0 +1,15 @@
1
+ export type TipId = 'first-wall' | 'first-furniture' | 'first-3d' | 'first-export' | 'first-door';
2
+ export declare const TIP_MESSAGES: Record<TipId, string>;
3
+ /** Returns true if the tip hasn't been shown yet */
4
+ export declare function showTip(tipId: TipId): boolean;
5
+ /** Mark a tip as seen so it won't show again */
6
+ export declare function markTipSeen(tipId: TipId): void;
7
+ export declare function getActiveTip(): {
8
+ id: TipId;
9
+ x: number;
10
+ y: number;
11
+ } | null;
12
+ /** Trigger a tip at a screen position. No-ops if already seen. */
13
+ export declare function triggerTip(tipId: TipId, x: number, y: number): void;
14
+ /** Dismiss the current tip */
15
+ export declare function dismissTip(): void;
@@ -0,0 +1,162 @@
1
+ import { Project, Floor, Wall, Door, Window as Win, FurnitureItem, Point, Stair, Column, BackgroundImage, ElementGroup } from '../../../lib/models/types';
2
+ export declare function createDefaultFloor(level?: number): Floor;
3
+ export declare function createDefaultProject(name?: string): Project;
4
+ export declare const currentProject: import('svelte/store').Writable<Project | null>;
5
+ export declare const activeFloor: import('svelte/store').Readable<Floor | null>;
6
+ export type Tool = 'select' | 'wall' | 'door' | 'window' | 'furniture' | 'text';
7
+ export declare const selectedTool: import('svelte/store').Writable<Tool>;
8
+ export declare const snapEnabled: import('svelte/store').Writable<boolean>;
9
+ /** When true, left-click drag pans the canvas instead of selecting */
10
+ export declare const panMode: import('svelte/store').Writable<boolean>;
11
+ export declare const showFurnitureStore: import('svelte/store').Writable<boolean>;
12
+ export declare const selectedElementId: import('svelte/store').Writable<string | null>;
13
+ /** Multi-select: set of element IDs currently selected (used alongside selectedElementId for marquee/shift-click) */
14
+ export declare const selectedElementIds: import('svelte/store').Writable<Set<string>>;
15
+ export declare const viewMode: import('svelte/store').Writable<"2d" | "3d">;
16
+ /** Reactive store exposing undo history for the UndoHistoryPanel */
17
+ export declare const undoHistoryStore: import('svelte/store').Writable<{
18
+ entries: {
19
+ description: string;
20
+ timestamp: number;
21
+ }[];
22
+ currentIndex: number;
23
+ }>;
24
+ /** Begin an undo group. Nested calls are supported; only the outermost pair takes effect. */
25
+ export declare function beginUndoGroup(): void;
26
+ /** End an undo group. Commits a single undo entry from the state captured at beginUndoGroup(). */
27
+ export declare function endUndoGroup(description?: string): void;
28
+ export declare function undo(): void;
29
+ export declare function redo(): void;
30
+ /** Jump to a specific undo history step by index (0 = oldest) */
31
+ export declare function jumpToUndoStep(targetIndex: number): void;
32
+ export declare function addWall(start: Point, end: Point): string;
33
+ export declare function removeWall(id: string): void;
34
+ export declare function addDoor(wallId: string, position: number, doorType?: Door['type']): string;
35
+ export declare function addWindow(wallId: string, position: number, windowType?: import('../../../lib/models/types').Window['type']): string;
36
+ export declare function addFurniture(catalogId: string, position: Point): string;
37
+ /** Snapshot the current state before a drag begins (call once at drag start) */
38
+ export declare function beginDrag(description?: string): void;
39
+ /** Move furniture without creating an undo snapshot on every call (used during drag).
40
+ * Call `beginDrag()` when the drag starts to snapshot the pre-drag state. */
41
+ export declare function moveFurniture(id: string, position: Point): void;
42
+ /** Snapshot the current state before a drag begins (call once at drag start).
43
+ * Alias for beginDrag() for backward compatibility. */
44
+ export declare function commitFurnitureMove(): void;
45
+ export declare function rotateFurniture(id: string, angle: number): void;
46
+ export declare function setFurnitureRotation(id: string, angle: number): void;
47
+ export declare function scaleFurniture(id: string, scale: {
48
+ x: number;
49
+ y: number;
50
+ }): void;
51
+ export declare function removeFurniture(id: string): void;
52
+ export declare function addStair(position: Point): string;
53
+ export declare function updateStair(id: string, updates: Partial<Stair>): void;
54
+ export declare function removeStair(id: string): void;
55
+ export declare function moveStair(id: string, position: Point): void;
56
+ export declare function setBackgroundImage(bg: BackgroundImage | undefined): void;
57
+ export declare function updateBackgroundImage(updates: Partial<BackgroundImage>): void;
58
+ export declare function addColumn(position: Point, shape?: 'round' | 'square'): string;
59
+ export declare function updateColumn(id: string, updates: Partial<Column>): void;
60
+ export declare function removeColumn(id: string): void;
61
+ export declare function moveColumn(id: string, position: Point): void;
62
+ /** Tool for placing columns */
63
+ export declare const placingColumn: import('svelte/store').Writable<boolean>;
64
+ export declare const placingColumnShape: import('svelte/store').Writable<"round" | "square">;
65
+ /** Tool for placing stairs */
66
+ export declare const placingStair: import('svelte/store').Writable<boolean>;
67
+ /** Scale calibration mode */
68
+ export declare const calibrationMode: import('svelte/store').Writable<boolean>;
69
+ export declare const calibrationPoints: import('svelte/store').Writable<Point[]>;
70
+ export declare function removeElement(id: string): void;
71
+ /** Move a wall endpoint without creating an undo snapshot (for dragging) */
72
+ export declare function moveWallEndpoint(id: string, endpoint: 'start' | 'end', position: Point): void;
73
+ export declare function updateWall(id: string, updates: Partial<Wall>): void;
74
+ export declare function updateDoor(id: string, updates: Partial<Door>): void;
75
+ export declare function updateWindow(id: string, updates: Partial<Win>): void;
76
+ export declare function updateFurniture(id: string, updates: Partial<FurnitureItem>): void;
77
+ export declare function updateRoom(id: string, updates: Partial<{
78
+ name: string;
79
+ floorTexture: string;
80
+ color: string;
81
+ roomType: import('../../../lib/models/types').RoomCategory;
82
+ labelOffset: import('../../../lib/models/types').Point | undefined;
83
+ }>): void;
84
+ export declare function addFloor(name?: string, copyCurrentLayout?: boolean): void;
85
+ export declare function removeFloor(id: string): void;
86
+ export declare function setActiveFloor(floorId: string): void;
87
+ export declare function updateProjectName(name: string): void;
88
+ export declare function loadProject(project: Project): void;
89
+ /** Import a floor's data into the current project's active floor (replaces walls/doors/windows/furniture) */
90
+ export declare function importFloorIntoCurrentProject(floor: import('../../../lib/models/types').Floor): void;
91
+ export declare const selectedRoomId: import('svelte/store').Writable<string | null>;
92
+ /** Detected rooms (synced from canvas room detection) */
93
+ export declare const detectedRoomsStore: import('svelte/store').Writable<import('../../../lib/models/types').Room[]>;
94
+ /** catalogId currently being placed (null = not placing) */
95
+ export declare const placingFurnitureId: import('svelte/store').Writable<string | null>;
96
+ /** Rotation angle for furniture being placed */
97
+ export declare const placingRotation: import('svelte/store').Writable<number>;
98
+ /** Door subtype currently selected for placement */
99
+ export declare const placingDoorType: import('svelte/store').Writable<"single" | "double" | "sliding" | "french" | "pocket" | "bifold">;
100
+ /** Window subtype currently selected for placement */
101
+ export declare const placingWindowType: import('svelte/store').Writable<"sliding" | "standard" | "fixed" | "casement" | "bay">;
102
+ /** Duplicate a door onto the same wall */
103
+ export declare function duplicateDoor(id: string): string | null;
104
+ /** Duplicate a window onto the same wall */
105
+ export declare function duplicateWindow(id: string): string | null;
106
+ /** Duplicate furniture */
107
+ export declare function duplicateFurniture(id: string): string | null;
108
+ /** Move a wall parallel to itself (both endpoints shift by the same perpendicular offset) without undo snapshot (for dragging) */
109
+ export declare function moveWallParallel(id: string, dx: number, dy: number): void;
110
+ /** Split a wall into two segments at a given parameter t (0-1) */
111
+ export declare function splitWall(id: string, t: number): string | null;
112
+ /** Duplicate a wall */
113
+ export declare function duplicateWall(id: string): string | null;
114
+ export declare function addGuide(orientation: 'horizontal' | 'vertical', position: number): string;
115
+ export declare function moveGuide(id: string, position: number): void;
116
+ export declare function removeGuide(id: string): void;
117
+ export declare function addMeasurement(x1: number, y1: number, x2: number, y2: number): string;
118
+ export declare function removeMeasurement(id: string): void;
119
+ export declare function addAnnotation(x1: number, y1: number, x2: number, y2: number, offset?: number, label?: string): string;
120
+ export declare function removeAnnotation(id: string): void;
121
+ export declare function updateAnnotation(id: string, updates: Partial<{
122
+ x1: number;
123
+ y1: number;
124
+ x2: number;
125
+ y2: number;
126
+ offset: number;
127
+ label: string;
128
+ }>): void;
129
+ export declare function addTextAnnotation(x: number, y: number, text: string, fontSize?: number, color?: string, rotation?: number): string;
130
+ export declare function removeTextAnnotation(id: string): void;
131
+ export declare function updateTextAnnotation(id: string, updates: Partial<{
132
+ x: number;
133
+ y: number;
134
+ text: string;
135
+ fontSize: number;
136
+ color: string;
137
+ rotation: number;
138
+ }>): void;
139
+ export declare function moveTextAnnotation(id: string, position: {
140
+ x: number;
141
+ y: number;
142
+ }): void;
143
+ export declare const layerVisibility: import('svelte/store').Writable<{
144
+ walls: boolean;
145
+ doors: boolean;
146
+ windows: boolean;
147
+ furniture: boolean;
148
+ stairs: boolean;
149
+ columns: boolean;
150
+ guides: boolean;
151
+ measurements: boolean;
152
+ annotations: boolean;
153
+ }>;
154
+ export declare function toggleFurnitureLock(id: string): void;
155
+ export declare function setFurnitureLocked(id: string, locked: boolean): void;
156
+ export declare function createGroup(elementIds: string[]): string | null;
157
+ export declare function ungroup(groupId: string): void;
158
+ export declare function ungroupElements(elementIds: string[]): void;
159
+ export declare function findGroupForElement(floor: Floor, elementId: string): ElementGroup | undefined;
160
+ export declare const canvasZoom: import('svelte/store').Writable<number>;
161
+ export declare const canvasCamX: import('svelte/store').Writable<number>;
162
+ export declare const canvasCamY: import('svelte/store').Writable<number>;
@@ -0,0 +1,12 @@
1
+ export type SaveState = 'saved' | 'unsaved' | 'saving';
2
+ export declare const saveState: import('svelte/store').Writable<SaveState>;
3
+ export declare const lastSavedAt: import('svelte/store').Writable<Date | null>;
4
+ /** Call once to start watching project changes */
5
+ export declare function initAutoSave(onDispatch?: any): void;
6
+ /** Mark project as dirty (unsaved). */
7
+ export declare function markDirty(onDispatch?: any): void;
8
+ export declare function captureThumbnail(projectId: string): void;
9
+ /** Manual save */
10
+ export declare function manualSave(): Promise<void>;
11
+ /** Mark as saved without triggering dirty (e.g. after loadProject) */
12
+ export declare function markClean(): void;
@@ -0,0 +1,25 @@
1
+ export interface ProjectSettings {
2
+ units: 'metric' | 'imperial';
3
+ showDimensions: boolean;
4
+ showExternalDimensions: boolean;
5
+ showInternalDimensions: boolean;
6
+ showExtensionLines: boolean;
7
+ showObjectDistance: boolean;
8
+ dimensionLineColor: string;
9
+ snapToGrid: boolean;
10
+ gridSize: number;
11
+ }
12
+ export declare const projectSettings: {
13
+ subscribe: (this: void, run: import('svelte/store').Subscriber<ProjectSettings>, invalidate?: () => void) => import('svelte/store').Unsubscriber;
14
+ set(value: ProjectSettings): void;
15
+ update(fn: (s: ProjectSettings) => ProjectSettings): void;
16
+ reset(): void;
17
+ };
18
+ /** Convert cm to display string based on current units */
19
+ export declare function formatLength(cm: number, units: 'metric' | 'imperial'): string;
20
+ /** Convert cm to display with full precision */
21
+ export declare function formatLengthPrecise(cm: number, units: 'metric' | 'imperial'): string;
22
+ /** Format area (m²) to display string based on units */
23
+ export declare function formatArea(m2: number, units: 'metric' | 'imperial'): string;
24
+ /** Parse user input back to cm */
25
+ export declare function parseLengthInput(input: string, units: 'metric' | 'imperial'): number | null;
@@ -0,0 +1,5 @@
1
+ export type ThemePreference = 'light' | 'dark' | 'system';
2
+ export declare const themePreference: {
3
+ subscribe: (this: void, run: import('svelte/store').Subscriber<ThemePreference>, invalidate?: () => void) => import('svelte/store').Unsubscriber;
4
+ set(value: ThemePreference): void;
5
+ };
@@ -0,0 +1,16 @@
1
+ import { Project } from '../../../lib/models/types';
2
+ export interface Snapshot {
3
+ timestamp: number;
4
+ description: string;
5
+ data: string;
6
+ }
7
+ export declare function getSnapshots(projectId: string): Snapshot[];
8
+ export declare function saveSnapshot(project: Project, description: string): void;
9
+ export declare function restoreSnapshot(projectId: string, index: number): boolean;
10
+ export declare function deleteAllSnapshots(projectId: string): void;
11
+ export declare const snapshotsStore: import('svelte/store').Writable<Snapshot[]>;
12
+ export declare function refreshSnapshots(): void;
13
+ export declare function initVersionHistory(): void;
14
+ export declare function stopVersionHistory(): void;
15
+ /** Create a snapshot on major actions (call manually) */
16
+ export declare function snapshotOnAction(description: string): void;
@@ -0,0 +1,2 @@
1
+ export type AlignmentOp = 'align-left' | 'align-right' | 'align-top' | 'align-bottom' | 'align-center-h' | 'align-center-v' | 'distribute-h' | 'distribute-v';
2
+ export declare function alignElements(ids: Set<string>, op: AlignmentOp): void;
@@ -0,0 +1,3 @@
1
+ import { Project } from '../../../lib/models/types';
2
+ export declare function exportDXF(project: Project): void;
3
+ export declare function exportDWG(project: Project): void;
@@ -0,0 +1,30 @@
1
+ import { Point, Wall } from '../../../lib/models/types';
2
+ /** Shared canvas state passed to rendering / hit-test functions */
3
+ export interface CanvasState {
4
+ ctx: CanvasRenderingContext2D;
5
+ width: number;
6
+ height: number;
7
+ zoom: number;
8
+ camX: number;
9
+ camY: number;
10
+ }
11
+ export declare const GRID = 20;
12
+ export declare const SNAP = 10;
13
+ export declare const MAGNETIC_SNAP = 15;
14
+ export declare const WALL_SNAP_DIST = 30;
15
+ export declare function screenToWorld(cs: CanvasState, sx: number, sy: number): Point;
16
+ export declare function worldToScreen(cs: CanvasState, wx: number, wy: number): {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ export declare function snap(v: number, enabled: boolean, snapToGrid: boolean, gridSize: number): number;
21
+ export declare function magneticSnap(p: Point, walls: Wall[], snapFn: (v: number) => number, zoom: number, excludeWallIds?: Set<string>): Point & {
22
+ snappedToEndpoint?: boolean;
23
+ };
24
+ export declare function angleSnap(start: Point, end: Point, enabled: boolean): Point;
25
+ export declare function findConnectedEndpoints(pt: Point, excludeWallId: string, walls: Wall[]): {
26
+ wallId: string;
27
+ endpoint: 'start' | 'end';
28
+ }[];
29
+ /** Resize handle types for furniture */
30
+ export type HandleType = 'resize-tl' | 'resize-tr' | 'resize-bl' | 'resize-br' | 'resize-t' | 'resize-b' | 'resize-l' | 'resize-r' | 'rotate';
@@ -0,0 +1,34 @@
1
+ import { Point, Wall, Door, Window as Win, FurnitureItem, Stair, Column, Floor, Annotation, Room } from '../../../lib/models/types';
2
+ import { CanvasState } from '../../../lib/utils/canvasInteraction';
3
+ import { ProjectSettings } from '../../../lib/stores/settings';
4
+ export declare function wallLength(w: Wall): number;
5
+ export declare function wallPointAt(w: Wall, t: number): Point;
6
+ export declare function wallTangentAt(w: Wall, t: number): Point;
7
+ export declare function drawGrid(cs: CanvasState, showGrid: boolean, snapToGrid: boolean, gridSize: number): void;
8
+ export declare function drawWall(cs: CanvasState, w: Wall, selected: boolean, showDimensions: boolean, dimSettings: ProjectSettings): void;
9
+ export declare function drawDoorOnWall(cs: CanvasState, wall: Wall, door: Door): void;
10
+ export declare function drawWindowOnWall(cs: CanvasState, wall: Wall, win: Win): void;
11
+ export declare function drawDoorDistanceDimensions(cs: CanvasState, wall: Wall, door: Door, dimSettings: ProjectSettings): void;
12
+ export declare function drawWindowDistanceDimensions(cs: CanvasState, wall: Wall, window: Win, dimSettings: ProjectSettings): void;
13
+ export declare function drawFurnitureItem(cs: CanvasState, item: FurnitureItem, selected: boolean): void;
14
+ export declare function drawStair(cs: CanvasState, stair: Stair, selected: boolean): void;
15
+ export declare function drawColumn(cs: CanvasState, col: Column, selected: boolean): void;
16
+ export declare function drawGuides(cs: CanvasState, floor: Floor, selectedGuideId: string | null, RULER_SIZE: number): void;
17
+ export declare function drawPersistedMeasurements(cs: CanvasState, floor: Floor, selectedMeasurementId: string | null, dimSettings: ProjectSettings): void;
18
+ export declare function drawTextAnnotations(cs: CanvasState, floor: Floor, selectedTextAnnotationId: string | null, currentSelectedId: string | null): void;
19
+ export declare function drawAnnotation(cs: CanvasState, a: Annotation, selected: boolean, dimSettings: ProjectSettings): void;
20
+ export declare function drawAnnotations(cs: CanvasState, floor: Floor, selectedAnnotationId: string | null, dimSettings: ProjectSettings): void;
21
+ export declare function getRoomFill(room: Room, index: number): string;
22
+ export declare function drawRoomFloorPattern(cs: CanvasState, room: Room, screenPoly: {
23
+ x: number;
24
+ y: number;
25
+ }[]): void;
26
+ export declare function drawRooms(cs: CanvasState, floor: Floor, detectedRooms: Room[], currentSelectedRoomId: string | null, showRoomLabels: boolean, showDimensions: boolean, dimSettings: ProjectSettings): void;
27
+ export declare function drawWallJoints(cs: CanvasState, floor: Floor, selId: string | null): void;
28
+ export declare function drawSnapPoints(cs: CanvasState, floor: Floor, showGrid: boolean): void;
29
+ export declare function drawMinimap(cs: CanvasState, minimapCanvas: HTMLCanvasElement, floor: Floor, getWorldBBox: () => {
30
+ minX: number;
31
+ minY: number;
32
+ maxX: number;
33
+ maxY: number;
34
+ } | null): void;
@@ -0,0 +1,13 @@
1
+ import { Project } from '../../../lib/models/types';
2
+ /**
3
+ * Export the full floor plan as a high-resolution PNG.
4
+ * Renders all walls/rooms/doors/furniture onto an offscreen canvas
5
+ * so the export isn't limited to the current viewport.
6
+ */
7
+ export declare function exportAsPNG(canvas: HTMLCanvasElement, project?: Project): void;
8
+ export declare function exportAsJSON(project: Project): void;
9
+ export declare function exportAsSVG(project: Project): void;
10
+ export declare function exportAs3DPNG(renderer: {
11
+ domElement: HTMLCanvasElement;
12
+ }): void;
13
+ export declare function exportPDF(project: Project): void;
@@ -0,0 +1,16 @@
1
+ export interface FurnitureDef {
2
+ id: string;
3
+ name: string;
4
+ category: string;
5
+ icon: string;
6
+ color: string;
7
+ /** width x depth x height in cm */
8
+ width: number;
9
+ depth: number;
10
+ height: number;
11
+ /** If set, this is a 2D-only architectural symbol (not rendered in 3D) */
12
+ symbol?: boolean;
13
+ }
14
+ export declare const furnitureCatalog: FurnitureDef[];
15
+ export declare function getCatalogItem(id: string): FurnitureDef | undefined;
16
+ export declare const furnitureCategories: string[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Architectural top-down furniture renderers for 2D canvas.
3
+ * Each function draws within a normalized rect: (-w/2, -d/2) to (w/2, d/2)
4
+ * where w = width*zoom, d = depth*zoom. Context is already translated & rotated.
5
+ */
6
+ /**
7
+ * Draw an architectural top-down icon for the given furniture item.
8
+ * Context should already be translated to center and rotated.
9
+ * @param w - pixel width (catalogWidth * zoom)
10
+ * @param d - pixel depth (catalogDepth * zoom)
11
+ */
12
+ export declare function drawFurnitureIcon(ctx: CanvasRenderingContext2D, catalogId: string, w: number, d: number, color: string, strokeColor: string, heatmapMatrix?: any, hasPerson?: boolean): void;
@@ -0,0 +1 @@
1
+ export {};