@archilogic/extension-sdk 0.15.0 → 0.17.0

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.
@@ -0,0 +1,4448 @@
1
+ import { default as default_2 } from 'rbush';
2
+
3
+ export declare type ActionCommitOutcome = {
4
+ via: 'action';
5
+ result: ActionCommitResult;
6
+ }
7
+ /** No live run to commit through (idle, legacy host, or ended mid-commit) — a plain `runOperations` apply carrying the same label. */
8
+ | {
9
+ via: 'operations';
10
+ result: OperationsResult_2;
11
+ };
12
+
13
+ /** An ended run falls back to `runOperations`, so `'ended'` never reaches the caller. */
14
+ export declare type ActionCommitResult = Extract<CommitActionResult, {
15
+ status: 'committed';
16
+ } | {
17
+ status: 'invalid';
18
+ }>;
19
+
20
+ /**
21
+ * A live gesture run. Everything speaks the run — a handle held past its end is refused, so a
22
+ * stale closure can never commit into a later activation of the same tool.
23
+ */
24
+ declare type ActionRunHandle = {
25
+ runId: string;
26
+ /** Replace the declared controls — the newest declaration wins. */
27
+ update(controls: ExtensionActionControls): Promise<void>;
28
+ /** Apply operations as exactly one labeled undo step — all-or-nothing, never a partial apply. */
29
+ commit(args: {
30
+ operations: OperationJson[];
31
+ label?: string;
32
+ }): Promise<CommitActionResult>;
33
+ /** Clean finish. Idempotent; no `onEnd` fires for the extension's own stop. */
34
+ stop(): Promise<void>;
35
+ };
36
+
37
+ export declare type ActionRunner = {
38
+ /** Make this the running action, ending whatever ran before. Stale handshakes never clobber a newer start. */
39
+ start(name: string): Promise<ActionRunStart>;
40
+ /** Start only when idle — the canvas re-arm. No-op while running, starting, or on a legacy host. */
41
+ ensure(name: string): void;
42
+ stop(): void;
43
+ /** Re-declare `controls()` on the live run, if any. */
44
+ sync(): void;
45
+ /**
46
+ * Apply operations as one labeled undo step: through the live run when there is one,
47
+ * otherwise as a plain `runOperations` apply with the same label. Commit never starts
48
+ * or restarts a run.
49
+ */
50
+ commit(args: CommitArgs): Promise<ActionCommitOutcome>;
51
+ readonly running: boolean;
52
+ readonly legacyHost: boolean;
53
+ };
54
+
55
+ export declare type ActionRunnerOptions = {
56
+ hostApi: Pick<HostApi, 'startActionRun' | 'runOperations'>;
57
+ /**
58
+ * The current control declaration. Consulted whenever the runner declares: at start, on
59
+ * every `sync()`, and again right after the handshake resolves — so state that advanced while
60
+ * the start was in flight (the very click that re-armed the run) is never announced stale.
61
+ */
62
+ controls: () => ExtensionActionControls;
63
+ onControl?: (control: ExtensionActionControl) => void;
64
+ /**
65
+ * The host ended the run — the rollback signal. The runner is already idle when this
66
+ * fires, and an end racing a newer `start` is swallowed so it can never roll the new
67
+ * activation back.
68
+ */
69
+ onEnd?: (reason: ExtensionActionEndReason) => void;
70
+ /** A start failure that is NOT a legacy host. Defaults to `console.warn` — never silent. */
71
+ onError?: (error: unknown) => void;
72
+ };
73
+
74
+ export declare type ActionRunStart = {
75
+ status: 'started';
76
+ } | {
77
+ status: 'unavailable';
78
+ reason: StartActionUnavailableReason;
79
+ }
80
+ /** A newer `start` or a `stop` happened during the handshake — this activation never won. */
81
+ | {
82
+ status: 'superseded';
83
+ }
84
+ /** The host has no custom-actions API — latched; later starts return this without a round trip. */
85
+ | {
86
+ status: 'legacy-host';
87
+ } | {
88
+ status: 'error';
89
+ error: unknown;
90
+ };
91
+
92
+ declare class AnnotationCreate extends OperationBase {
93
+ type: typeof AnnotationCreateTypeValue;
94
+ value: LayoutAnnotationJson;
95
+ constructor(value: LayoutAnnotationJson);
96
+ do(layout: SpaceGraphLayout): void;
97
+ undo(layout: SpaceGraphLayout): void;
98
+ }
99
+
100
+ declare type AnnotationCreateOperationJson = Pick<AnnotationCreate, 'type' | 'value'>;
101
+
102
+ declare const AnnotationCreateTypeValue: "operation:annotationCreate";
103
+
104
+ declare class AnnotationRemove extends OperationBase {
105
+ type: typeof AnnotationRemoveTypeValue;
106
+ previousValue: LayoutAnnotationJson;
107
+ constructor(node: LayoutAnnotation | string, previousValue?: LayoutAnnotationJson);
108
+ do(layout: SpaceGraphLayout): void;
109
+ undo(layout: SpaceGraphLayout): void;
110
+ }
111
+
112
+ declare type AnnotationRemoveOperationJson = Pick<AnnotationRemove, 'nodeId' | 'type'> & Partial<Pick<AnnotationRemove, 'previousValue'>>;
113
+
114
+ declare const AnnotationRemoveTypeValue: "operation:annotationRemove";
115
+
116
+ declare class AnnotationUpdate extends OperationBase {
117
+ type: typeof AnnotationUpdateTypeValue;
118
+ value: AnnotationUpdateValue;
119
+ constructor(node: LayoutAnnotation | string, value: AnnotationUpdateValue, previousValue?: AnnotationUpdateValue);
120
+ private setPreviousValue;
121
+ private update;
122
+ do(layout: SpaceGraphLayout): void;
123
+ undo(layout: SpaceGraphLayout): void;
124
+ }
125
+
126
+ declare type AnnotationUpdateOperationJson = Pick<AnnotationUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<AnnotationUpdate, 'previousValue'>>;
127
+
128
+ declare const AnnotationUpdateTypeValue: "operation:annotationUpdate";
129
+
130
+ declare type AnnotationUpdateValue = Partial<LayoutAnnotationJson> & {
131
+ parameters?: Partial<LayoutAnnotationJson['parameters']>;
132
+ };
133
+
134
+ declare interface ArcCurve extends CurveBase {
135
+ type: ArcCurveType;
136
+ position?: Vector2;
137
+ radius: number;
138
+ startAngle: number;
139
+ endAngle: number;
140
+ }
141
+
142
+ declare type ArcCurveType = typeof ArcCurveTypeValue;
143
+
144
+ declare const ArcCurveTypeValue = "curve:arc";
145
+
146
+ /**
147
+ * Background of the floor plan canvas
148
+ */
149
+ declare type BackgroundOptions = {
150
+ /** background-color: hex code for color, set to 'transparent' for transparent background */
151
+ color?: string;
152
+ /** show a dynamic grid */
153
+ showGrid?: boolean;
154
+ };
155
+
156
+ declare interface BaseData {
157
+ id: string;
158
+ name: string;
159
+ type: string;
160
+ customId: string;
161
+ customAttributes: SpaceGraphCustomAttributeValue;
162
+ /** dimensions in meters */
163
+ dimensions: {
164
+ width: number;
165
+ length: number;
166
+ height: number;
167
+ };
168
+ /**
169
+ * axis alignend bounding box in root space
170
+ * @example
171
+ * {
172
+ * min: [0, 0, 0],
173
+ * max: [1, 2, 1]
174
+ * }
175
+ * */
176
+ boundingBox: BoundingBox3d;
177
+ /** contour of the object aligned bounding box in root space */
178
+ boundingBoxContour: Polygon;
179
+ labelPoint: Vector2;
180
+ contour: PolygonWithHoles;
181
+ }
182
+
183
+ declare interface BaseField {
184
+ label?: string;
185
+ type: FieldType;
186
+ default?: FieldValueType;
187
+ required?: boolean;
188
+ }
189
+
190
+ declare interface BaseNodeFilter {
191
+ id?: StringComparator;
192
+ type?: StringComparator;
193
+ name?: StringComparator | NullComparator;
194
+ customId?: StringComparator | NullComparator;
195
+ customAttributes?: Record<string, StringComparator | NumberComparator | BooleanComparator | NullComparator>;
196
+ dimensions?: {
197
+ width?: NumberComparator;
198
+ length?: NumberComparator;
199
+ height?: NumberComparator;
200
+ };
201
+ }
202
+
203
+ declare interface BaseSelect {
204
+ id?: boolean;
205
+ type?: boolean;
206
+ name?: boolean;
207
+ customId?: boolean;
208
+ customAttributes?: boolean | Record<string, boolean>;
209
+ dimensions?: boolean | {
210
+ width?: boolean;
211
+ length?: boolean;
212
+ height?: boolean;
213
+ };
214
+ boundingBox?: boolean;
215
+ boundingBoxContour?: boolean;
216
+ labelPoint?: boolean;
217
+ contour?: boolean;
218
+ }
219
+
220
+ declare interface BezierCurve extends CurveBase {
221
+ type: BezierCurveType;
222
+ points: Vector2[];
223
+ }
224
+
225
+ declare type BezierCurveType = typeof BezierCurveTypeValue;
226
+
227
+ declare const BezierCurveTypeValue = "curve:quadraticBezier";
228
+
229
+ declare type BooleanComparator = boolean | {
230
+ eq: boolean;
231
+ } | {
232
+ neq: boolean;
233
+ };
234
+
235
+ declare interface BooleanField extends BaseField {
236
+ type: 'boolean';
237
+ default?: boolean;
238
+ }
239
+
240
+ declare interface BoundaryData {
241
+ profile: Vector2[];
242
+ segments: BoundarySegmentData[];
243
+ }
244
+
245
+ declare interface BoundarySegmentData {
246
+ points: [Vector2, Vector2];
247
+ element: {
248
+ id: string;
249
+ type: string;
250
+ } | null;
251
+ adjacentSpaceId: string | null;
252
+ }
253
+
254
+ declare type BoundingBox3d = {
255
+ min: Vector3;
256
+ max: Vector3;
257
+ };
258
+
259
+ /**
260
+ * The canvas viewport as delivered to `onCanvasChange`. Today it is always the 2D view; a future
261
+ * 3D canvas would add a `CanvasView3d` (`canvasMode: '3d'`, camera pose) and widen this to
262
+ * `CanvasView2d | CanvasView3d` — extensions that switch on `canvasMode` stay forward-compatible.
263
+ */
264
+ declare type CanvasChange = CanvasView2d;
265
+
266
+ /**
267
+ * Keyboard modifier state at the moment of a canvas pointer event. Extensions can't listen to
268
+ * keys on the host document, so the host snapshots the modifiers into each event — e.g. for
269
+ * CAD-style selection where shift-click adds and alt-click removes.
270
+ */
271
+ declare type CanvasModifiers = {
272
+ shift: boolean;
273
+ alt: boolean;
274
+ ctrl: boolean;
275
+ meta: boolean;
276
+ };
277
+
278
+ /**
279
+ * State of the 2D canvas viewport, emitted whenever the user pans, zooms or the canvas resizes.
280
+ * Lets an extension work in screen space — e.g. keep a pick tolerance at a constant pixel size
281
+ * (`tolerancePx / pixelsPerMeter` meters) so it tightens as the user zooms in. The `canvasMode`
282
+ * discriminant leaves room for a future 3D canvas without changing the `CanvasChange` name.
283
+ */
284
+ declare type CanvasView2d = {
285
+ canvasMode: '2d';
286
+ /** Visible plan area in meters, `[x, y]` corners in layout space. */
287
+ viewBox: {
288
+ min: Vector2;
289
+ max: Vector2;
290
+ };
291
+ /** Screen pixels per plan meter — the zoom scale. */
292
+ pixelsPerMeter: number;
293
+ /** Canvas size in CSS pixels. */
294
+ canvas: {
295
+ width: number;
296
+ height: number;
297
+ };
298
+ };
299
+
300
+ declare interface CircleCurve extends CurveBase {
301
+ type: CircleCurveType;
302
+ position?: Vector2;
303
+ radius: number;
304
+ }
305
+
306
+ declare type CircleCurveType = typeof CircleCurveTypeValue;
307
+
308
+ declare const CircleCurveTypeValue = "curve:circle";
309
+
310
+ declare type ClosedCurve = RectangleCurve | PolygonCurve | PolygonWithHolesCurve | CircleCurve | CompositeCurve;
311
+
312
+ declare type ClosedCurveType = RectangleCurveType | PolygonCurveType | PolygonWithHolesCurveType | CircleCurveType | CompositeCurveType;
313
+
314
+ declare type CommitActionResult = {
315
+ status: 'committed';
316
+ } | {
317
+ status: 'invalid';
318
+ errors: string[];
319
+ } | {
320
+ status: 'ended';
321
+ };
322
+
323
+ declare type CommitArgs = Parameters<ActionRunHandle['commit']>[0];
324
+
325
+ declare interface CommonParameters {
326
+ materials: LayoutBeamMaterials;
327
+ }
328
+
329
+ declare interface CommonParameters_2 {
330
+ counterHeight: number;
331
+ materials: LayoutCaseworkMaterials;
332
+ }
333
+
334
+ declare interface CommonParameters_3 {
335
+ /** thickness of the frame in x direction */
336
+ frameThickness: number;
337
+ /** depth of the frame in z direction */
338
+ frameDepth: number;
339
+ doorType: DoorType;
340
+ doorAngle: number;
341
+ hardware: boolean;
342
+ hingeSide: HingeSide;
343
+ doorSide: DoorSide;
344
+ materials: LayoutDoorMaterials;
345
+ }
346
+
347
+ declare interface CommonParameters_4 {
348
+ wallCabinet: boolean;
349
+ leftHighCabinetCount: number;
350
+ rightHighCabinetCount: number;
351
+ sinkElementSlot: number;
352
+ cooktopElementSlot: number;
353
+ ovenElementSlot: number;
354
+ materials: LayoutKitchenMaterials;
355
+ }
356
+
357
+ declare interface CommonParameters_5 {
358
+ segmentCount: number;
359
+ segmentLength: number;
360
+ materials: LayoutRailingMaterials;
361
+ }
362
+
363
+ declare interface CommonParameters_6 {
364
+ materials: LayoutRampMaterials;
365
+ }
366
+
367
+ declare interface CommonParameters_7 {
368
+ /** thickness of the frame in x direction */
369
+ frameThickness: number;
370
+ /** depth of the frame in z direction */
371
+ frameDepth: number;
372
+ panelLength: number;
373
+ panelCount: number;
374
+ materials: LayoutWindowMaterials;
375
+ }
376
+
377
+ declare type CommonStairsParameters = {
378
+ railing: 'none' | 'left' | 'right' | 'both';
379
+ materials: LayoutStairsMaterials;
380
+ };
381
+
382
+ declare interface CompositeCurve extends CurveBase {
383
+ type: CompositeCurveType;
384
+ segments: OpenCurve[];
385
+ }
386
+
387
+ declare type CompositeCurveType = typeof CompositeCurveTypeValue;
388
+
389
+ declare const CompositeCurveTypeValue = "curve:composite";
390
+
391
+ declare interface ConfirmArgs {
392
+ title: string;
393
+ message?: string;
394
+ confirmLabel?: string;
395
+ cancelLabel?: string;
396
+ }
397
+
398
+ /**
399
+ * The run-lifecycle state machine every action-driven extension needs, in one place: start/stop
400
+ * with stale-response guards, control re-declaration, host-end rollback, commit with a
401
+ * `runOperations` fallback, and an explicit legacy-host downgrade.
402
+ *
403
+ * @example
404
+ * const action = createActionRunner({
405
+ * hostApi,
406
+ * controls: describeControls,
407
+ * onControl: handleControl,
408
+ * onEnd: reason => rollbackGesture(reason)
409
+ * })
410
+ * // switching tools: action.start(`My ext: ${tool}`)
411
+ * // after any gesture change: action.sync()
412
+ * // on canvas re-engagement: action.ensure(name)
413
+ * // committing a gesture: const outcome = await action.commit({ operations, label })
414
+ */
415
+ export declare const createActionRunner: (options: ActionRunnerOptions) => ActionRunner;
416
+
417
+ declare class CuboidGeometry extends ParametricGeometryBase {
418
+ type: CuboidGeometryType;
419
+ dimensions: Vector3;
420
+ constructor(id: string);
421
+ }
422
+
423
+ declare interface CuboidGeometryJson extends ParametricGeometryBaseJson {
424
+ type: CuboidGeometryType;
425
+ dimensions: Vector3;
426
+ }
427
+
428
+ declare type CuboidGeometryType = typeof CuboidGeometryTypeValue;
429
+
430
+ declare const CuboidGeometryTypeValue = "geometry:cuboid";
431
+
432
+ declare type Curve = ClosedCurve | OpenCurve;
433
+
434
+ declare interface CurveBase {
435
+ type: CurveType;
436
+ }
437
+
438
+ declare type CurveShape = Curve & {
439
+ style?: ShapeStyle;
440
+ };
441
+
442
+ declare type CurveType = ClosedCurveType | OpenCurveType;
443
+
444
+ declare class CustomAttributeCreate extends OperationBase {
445
+ type: typeof CustomAttributeCreateTypeValue;
446
+ value: CustomAttributeCreateValue;
447
+ constructor(value: CustomAttributeCreateValue);
448
+ do(layout: SpaceGraphLayout): void;
449
+ undo(layout: SpaceGraphLayout): void;
450
+ }
451
+
452
+ declare type CustomAttributeCreateOperationJson = Pick<CustomAttributeCreate, 'type' | 'value'>;
453
+
454
+ declare const CustomAttributeCreateTypeValue = "operation:customAttributeCreate";
455
+
456
+ declare type CustomAttributeCreateValue = SpaceGraphCustomAttributeJson;
457
+
458
+ declare type CustomAttributeInputType = 'Text' | 'Number' | 'Boolean' | 'Integer' | 'Select';
459
+
460
+ declare class CustomAttributeRemove extends OperationBase {
461
+ type: typeof CustomAttributeRemoveTypeValue;
462
+ value: CustomAttributeRemoveValue;
463
+ previousValue: CustomAttributeRemoveValue;
464
+ constructor(node: SpaceGraphCustomAttribute | string, previousValue?: CustomAttributeRemoveValue);
465
+ do(layout: SpaceGraphLayout): void;
466
+ undo(layout: SpaceGraphLayout): void;
467
+ }
468
+
469
+ declare type CustomAttributeRemoveOperationJson = Pick<CustomAttributeRemove, 'nodeId' | 'type'> & Partial<Pick<CustomAttributeRemove, 'previousValue'>>;
470
+
471
+ declare const CustomAttributeRemoveTypeValue = "operation:customAttributeRemove";
472
+
473
+ declare type CustomAttributeRemoveValue = SpaceGraphCustomAttributeJson;
474
+
475
+ declare type CustomAttributeResourceType = 'building' | 'element' | 'floor' | 'layout' | 'product' | 'space';
476
+
477
+ declare type CustomAttributeSchema = CustomAttributeSchemaText | CustomAttributeSchemaSelect | CustomAttributeSchemaNumber | CustomAttributeSchemaInteger | CustomAttributeSchemaBoolean;
478
+
479
+ declare type CustomAttributeSchemaBoolean = {
480
+ type: 'boolean';
481
+ };
482
+
483
+ declare type CustomAttributeSchemaInteger = {
484
+ type: 'integer';
485
+ };
486
+
487
+ declare type CustomAttributeSchemaNumber = {
488
+ type: 'number';
489
+ };
490
+
491
+ declare type CustomAttributeSchemaSelect = {
492
+ type: 'string';
493
+ enum: string[];
494
+ };
495
+
496
+ declare type CustomAttributeSchemaText = {
497
+ type: 'string';
498
+ };
499
+
500
+ declare class CustomAttributeUpdate extends OperationBase {
501
+ type: typeof CustomAttributeUpdateTypeValue;
502
+ value: CustomAttributeUpdateValue;
503
+ constructor(node: SpaceGraphCustomAttribute | string, value: CustomAttributeUpdateValue, previousValue?: CustomAttributeUpdateValue);
504
+ private setPreviousValue;
505
+ do(layout: SpaceGraphLayout): void;
506
+ undo(layout: SpaceGraphLayout): void;
507
+ }
508
+
509
+ declare type CustomAttributeUpdateOperationJson = Pick<CustomAttributeUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<CustomAttributeUpdate, 'previousValue'>>;
510
+
511
+ declare const CustomAttributeUpdateTypeValue = "operation:customAttributeUpdate";
512
+
513
+ declare type CustomAttributeUpdateValue = Partial<SpaceGraphCustomAttributeJson>;
514
+
515
+ /** @deprecated */
516
+ declare type CustomAttributeValueType = 'Text' | 'Number' | 'Boolean' | 'Schema';
517
+
518
+ declare type CustomStairsParameters = {
519
+ stairsType: CustomStairsType;
520
+ /** @minimum 0.01 */
521
+ height: number;
522
+ /** @minimum 0.01 */
523
+ stepWidth: number;
524
+ } & CommonStairsParameters;
525
+
526
+ declare type CustomStairsParametersJson = Partial<CustomStairsParameters>;
527
+
528
+ declare type CustomStairsType = 'custom';
529
+
530
+ declare type DefaultSelect = {
531
+ id: true;
532
+ type: true;
533
+ };
534
+
535
+ declare type DimensionParameters = {
536
+ /** @minimum 0.01 */
537
+ length: number;
538
+ /** @minimum 0.01 */
539
+ width: number;
540
+ /** @minimum 0.01 */
541
+ height: number;
542
+ };
543
+
544
+ declare interface DimensionParameters_2 {
545
+ /** @minimum 0.01 */
546
+ length: number;
547
+ /** @minimum 0.01 */
548
+ height: number;
549
+ }
550
+
551
+ declare interface DimensionParameters_3 {
552
+ /** @minimum 0.01 */
553
+ length: number;
554
+ /** @minimum 0.01 */
555
+ height: number;
556
+ }
557
+
558
+ declare type DoorSide = 'side1' | 'side2';
559
+
560
+ declare type DoorType = 'singleSwing' | 'doubleSwing' | 'slidingDoor' | 'opening' | 'elevatorDoor' | 'garageDoor';
561
+
562
+ declare enum DxfUnits {
563
+ unitLess = 0,
564
+ inches = 1,
565
+ feet = 2,
566
+ miles = 3,
567
+ millimeters = 4,
568
+ centimeters = 5,
569
+ meters = 6,
570
+ kilometers = 7
571
+ }
572
+
573
+ declare type DxfUnitsString = keyof typeof DxfUnits;
574
+
575
+ declare interface EdgeCanSplitOptions {
576
+ minimumLength?: number;
577
+ }
578
+
579
+ declare class EdgeConnect extends OperationBase {
580
+ type: typeof EdgeConnectTypeValue;
581
+ value: EdgeConnectValue;
582
+ previousVertex: {
583
+ [edgeId: string]: {
584
+ start: SpatialGraphVertexJson | null;
585
+ end: SpatialGraphVertexJson | null;
586
+ };
587
+ };
588
+ newEdgeId: {
589
+ [originEdgeId: string]: string;
590
+ };
591
+ constructor(edge: SpatialGraphEdge | string, value: EdgeConnectValue);
592
+ isInRange(value: number, range: [number, number]): boolean;
593
+ splitEdge(layout: SpaceGraphLayout, edgeId: string, u: number): SpatialGraphVertex;
594
+ undoSplitEdge(layout: SpaceGraphLayout, edgeId: string): void;
595
+ extendEdge(layout: SpaceGraphLayout, edgeId: string, u: number, point: Vector2, vertex?: SpatialGraphVertex): SpatialGraphVertex;
596
+ undoExtendEdge(layout: SpaceGraphLayout, edgeId: string): void;
597
+ safeRemoveVertexById(layout: SpaceGraphLayout, vertexId: string): void;
598
+ do(layout: SpaceGraphLayout): void;
599
+ undo(layout: SpaceGraphLayout): void;
600
+ }
601
+
602
+ declare type EdgeConnectOperationJson = Pick<EdgeConnect, 'nodeId' | 'type' | 'value'>;
603
+
604
+ declare const EdgeConnectTypeValue: "operation:edgeConnect";
605
+
606
+ declare type EdgeConnectValue = {
607
+ edgeId: string;
608
+ };
609
+
610
+ declare class EdgeCreate extends OperationBase {
611
+ type: typeof EdgeCreateTypeValue;
612
+ value: EdgeCreateValueType;
613
+ constructor(value: EdgeCreateValueType);
614
+ do(layout: SpaceGraphLayout): void;
615
+ undo(layout: SpaceGraphLayout): void;
616
+ }
617
+
618
+ declare type EdgeCreateOperationJson = Pick<EdgeCreate, 'value' | 'type'>;
619
+
620
+ declare const EdgeCreateTypeValue: "operation:edgeCreate";
621
+
622
+ declare type EdgeCreateValueType = Omit<SpatialGraphEdgeJson, 'type'>;
623
+
624
+ declare type EdgeElementMap = {
625
+ -readonly [Key in LayoutEdgeElementType]: LayoutElementTypeMap[Key];
626
+ };
627
+
628
+ declare class EdgeMerge extends OperationBase {
629
+ type: typeof EdgeMergeTypeValue;
630
+ value: EdgeMergeValue;
631
+ previousValue: {
632
+ splitEdgeU: number;
633
+ elementId?: string;
634
+ };
635
+ constructor(edge: SpatialGraphEdge | string, value: EdgeMergeValue, previousValue?: {
636
+ splitEdgeU: number;
637
+ });
638
+ do(layout: SpaceGraphLayout): void;
639
+ undo(layout: SpaceGraphLayout): void;
640
+ }
641
+
642
+ declare type EdgeMergeOperationJson = Pick<EdgeMerge, 'nodeId' | 'type' | 'value'> & Partial<Pick<EdgeMerge, 'previousValue'>>;
643
+
644
+ declare const EdgeMergeTypeValue: "operation:edgeMerge";
645
+
646
+ declare type EdgeMergeValue = {
647
+ vertexId: string;
648
+ edgeId: string;
649
+ };
650
+
651
+ declare class EdgeRemove extends OperationBase {
652
+ type: typeof EdgeRemoveTypeValue;
653
+ previousValue: EdgeVertexValue;
654
+ constructor(edge: SpatialGraphEdge | string, previousValue?: EdgeVertexValue);
655
+ do(layout: SpaceGraphLayout): void;
656
+ undo(layout: SpaceGraphLayout): void;
657
+ }
658
+
659
+ declare type EdgeRemoveOperationJson = Pick<EdgeRemove, 'nodeId' | 'type'> & Partial<Pick<EdgeRemove, 'previousValue'>>;
660
+
661
+ declare const EdgeRemoveTypeValue: "operation:edgeRemove";
662
+
663
+ declare class EdgeReplace extends OperationBase {
664
+ type: typeof EdgeReplaceTypeValue;
665
+ value: EdgeReplaceValue;
666
+ previousValue: SpatialGraphEdgeJson;
667
+ constructor(edge: SpatialGraphEdge | string, value: EdgeReplaceValue, previousValue?: SpatialGraphEdgeJson);
668
+ do(layout: SpaceGraphLayout): void;
669
+ undo(layout: SpaceGraphLayout): void;
670
+ }
671
+
672
+ declare type EdgeReplaceOperationJson = Pick<EdgeReplace, 'nodeId' | 'type' | 'value'> & Partial<Pick<EdgeReplace, 'previousValue'>>;
673
+
674
+ declare const EdgeReplaceTypeValue: "operation:edgeReplace";
675
+
676
+ declare type EdgeReplaceValue = Pick<SpatialGraphEdgeJson, 'id'> & Partial<SpatialGraphEdgeJson>;
677
+
678
+ declare class EdgeSplit extends OperationBase {
679
+ type: typeof EdgeSplitTypeValue;
680
+ value: EdgeSplitValue;
681
+ constructor(edge: SpatialGraphEdge | string, value: EdgeSplitValue);
682
+ do(layout: SpaceGraphLayout): void;
683
+ undo(layout: SpaceGraphLayout): void;
684
+ }
685
+
686
+ declare type EdgeSplitOperationJson = Pick<EdgeSplit, 'nodeId' | 'type' | 'value'>;
687
+
688
+ declare interface EdgeSplitOptions {
689
+ vertexId?: string;
690
+ edgeId?: string;
691
+ elementId?: string;
692
+ }
693
+
694
+ declare interface EdgeSplitReturnValue {
695
+ vertex: SpatialGraphVertex;
696
+ edge: SpatialGraphEdge;
697
+ element?: LayoutEdgeElement;
698
+ }
699
+
700
+ declare const EdgeSplitTypeValue: "operation:edgeSplit";
701
+
702
+ declare type EdgeSplitValue = {
703
+ splitEdgeU: number;
704
+ newVertexId: string;
705
+ newEdgeId: string;
706
+ newElementId?: string;
707
+ updateSpaceBoundaries?: boolean;
708
+ };
709
+
710
+ declare class EdgeUpdate extends OperationBase {
711
+ type: typeof EdgeUpdateTypeValue;
712
+ value: EdgeVertexValue;
713
+ previousValue: EdgeVertexValue;
714
+ constructor(edge: SpatialGraphEdge | string, value: EdgeVertexValue, previousValue?: EdgeVertexValue);
715
+ private setPreviousValue;
716
+ private update;
717
+ do(layout: SpaceGraphLayout): void;
718
+ undo(layout: SpaceGraphLayout): void;
719
+ }
720
+
721
+ declare type EdgeUpdateOperationJson = Pick<EdgeUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<EdgeUpdate, 'previousValue'>>;
722
+
723
+ declare const EdgeUpdateTypeValue: "operation:edgeUpdate";
724
+
725
+ declare type EdgeVertexValue = Required<Pick<SpatialGraphEdgeJson, 'vertices'>> & Partial<SpatialGraphEdgeJson>;
726
+
727
+ declare class ElementCreate extends OperationBase {
728
+ type: typeof ElementCreateTypeValue;
729
+ value: LayoutElementJson;
730
+ parentId?: string;
731
+ constructor(value: Partial<LayoutElementJson>, parentId?: string);
732
+ do(layout: SpaceGraphLayout): void;
733
+ undo(layout: SpaceGraphLayout): void;
734
+ }
735
+
736
+ declare type ElementCreateOperationJson = Pick<ElementCreate, 'type' | 'value' | 'parentId'>;
737
+
738
+ declare const ElementCreateTypeValue: "operation:elementCreate";
739
+
740
+ declare interface ElementData extends BaseData {
741
+ type: LayoutElementJson['type'];
742
+ isExternal: boolean;
743
+ parameters: LayoutElementJson['parameters'];
744
+ category: string;
745
+ subCategory: string;
746
+ product: ProductData;
747
+ /** local transform for nested elements like openings, windows */
748
+ localTransform: SimpleTransform3d;
749
+ /** transform in root space */
750
+ transform: SimpleTransform3d;
751
+ /** local object aligned bounding box */
752
+ localBoundingBox: BoundingBox3d;
753
+ elements: ElementData[];
754
+ parent: ElementData;
755
+ }
756
+
757
+ declare interface ElementFilter extends BaseNodeFilter {
758
+ product?: ProductFilter;
759
+ category?: StringComparator;
760
+ subCategory?: StringComparator;
761
+ /** point query */
762
+ at?: Vector2;
763
+ /** 2d bounding box intersection */
764
+ within?: {
765
+ min: Vector2;
766
+ max: Vector2;
767
+ };
768
+ isExternal?: BooleanComparator;
769
+ }
770
+
771
+ declare type ElementQuery = {
772
+ select?: ElementSelect;
773
+ where?: ElementFilter;
774
+ };
775
+
776
+ declare class ElementRemove extends OperationBase {
777
+ type: typeof ElementRemoveTypeValue;
778
+ previousValue: LayoutElementJson;
779
+ parentId?: string;
780
+ constructor(element: LayoutElement | string, previousValue?: ElementUpdateValue);
781
+ private setPreviousValue;
782
+ do(layout: SpaceGraphLayout): void;
783
+ undo(layout: SpaceGraphLayout): void;
784
+ }
785
+
786
+ declare type ElementRemoveOperationJson = Pick<ElementRemove, 'nodeId' | 'type'> & Partial<Pick<ElementUpdate, 'previousValue'>>;
787
+
788
+ declare const ElementRemoveTypeValue: "operation:elementRemove";
789
+
790
+ declare interface ElementSelect extends BaseSelect {
791
+ product?: ProductSelect | boolean;
792
+ category?: boolean;
793
+ subCategory?: boolean;
794
+ isExternal?: boolean;
795
+ localBoundingBox?: boolean;
796
+ localTransform?: boolean;
797
+ transform?: boolean;
798
+ parent?: ElementSelect | boolean;
799
+ elements?: ElementQuery | boolean;
800
+ }
801
+
802
+ declare class ElementUpdate extends OperationBase {
803
+ type: typeof ElementUpdateTypeValue;
804
+ value: ElementUpdateValue;
805
+ constructor(element: LayoutElement | string, value: ElementUpdateValue, previousValue?: ElementUpdateValue);
806
+ private setPreviousValue;
807
+ private update;
808
+ do(layout: SpaceGraphLayout): void;
809
+ undo(layout: SpaceGraphLayout): void;
810
+ }
811
+
812
+ declare type ElementUpdateOperationJson = Pick<ElementUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<ElementUpdate, 'previousValue'>>;
813
+
814
+ declare const ElementUpdateTypeValue: "operation:elementUpdate";
815
+
816
+ declare type ElementUpdateValue = Partial<LayoutElementJson> & {
817
+ parameters?: Partial<LayoutElementJson['parameters']>;
818
+ };
819
+
820
+ declare type EntityResult = {
821
+ id: string;
822
+ };
823
+
824
+ declare interface ExportPdfOptions {
825
+ orientation: 'landscape' | 'portrait';
826
+ format: 'a4' | 'a3' | 'letter';
827
+ skipDownload?: boolean;
828
+ }
829
+
830
+ declare type ExportPdfResult = {
831
+ data: ArrayBuffer;
832
+ };
833
+
834
+ declare interface ExportSvgOptions {
835
+ skipDownload?: boolean;
836
+ }
837
+
838
+ declare type ExportSvgResult = {
839
+ data: string;
840
+ };
841
+
842
+ declare type ExtensionActionControl = 'cancel' | 'back' | 'commit';
843
+
844
+ /**
845
+ * What the three gesture keys mean right now. Declaring a control makes its key live; the label
846
+ * is what the host UI calls it (exit control, shortcut sheet). Escape with no `cancel` declared
847
+ * ends the action host-side, and a quick second Escape always does — the extension owns
848
+ * *cancel*, never *exit*.
849
+ */
850
+ declare type ExtensionActionControls = {
851
+ /** Escape — e.g. "Discard trace" */
852
+ cancel?: string;
853
+ /** Backspace — e.g. "Remove last vertex" */
854
+ back?: string;
855
+ /** Enter — e.g. "Close contour" */
856
+ commit?: string;
857
+ };
858
+
859
+ /**
860
+ * Why a run ended without the extension asking: `user-exit` (Escape with nothing to cancel,
861
+ * double-Escape, or the exit control) or `host` (a native tool started, floor switch, panel
862
+ * close, disconnect). This is the rollback signal — undo any pending gesture state here.
863
+ */
864
+ declare type ExtensionActionEndReason = 'user-exit' | 'host';
865
+
866
+ declare type ExtensionApi = {
867
+ onConnect(parameters?: Record<string, unknown>): Promise<unknown> | void;
868
+ onDestroy(): void;
869
+ onLayoutChange({ operations }: {
870
+ operations?: OperationJson[];
871
+ }): void;
872
+ onSelectionChange({ selectedNodes }: {
873
+ selectedNodes: {
874
+ id: string;
875
+ type: string;
876
+ }[];
877
+ }): void;
878
+ onGraphicDrag({ position, nodeId }: {
879
+ position: [number, number];
880
+ nodeId: string;
881
+ }): void;
882
+ onCanvasClick({ position, nodeId, modifiers }: {
883
+ position: [number, number];
884
+ nodeId?: string;
885
+ /** Absent on hosts that predate modifier forwarding. */
886
+ modifiers?: CanvasModifiers;
887
+ }): void;
888
+ onCanvasMouseMove({ position, nodeId, modifiers }: {
889
+ position: [number, number];
890
+ nodeId?: string;
891
+ /** Absent on hosts that predate modifier forwarding. */
892
+ modifiers?: CanvasModifiers;
893
+ }): void;
894
+ onCanvasChange(change: CanvasChange): void;
895
+ /** The host's display settings changed — e.g. the user switched measurement units. Optional: extensions built before settings forwarding don't expose it, and hosts feature-check before calling. */
896
+ onSettingsChange?(settings: HostSettings): void;
897
+ /** The user pressed a declared control of the running custom action. */
898
+ onActionControl(args: {
899
+ runId: string;
900
+ control: ExtensionActionControl;
901
+ }): void;
902
+ /** The host ended the running custom action — the rollback signal. */
903
+ onActionEnd(args: {
904
+ runId: string;
905
+ reason: ExtensionActionEndReason;
906
+ }): void;
907
+ };
908
+
909
+ declare type ExtensionEventKey = keyof ExtensionEventMap;
910
+
911
+ declare type ExtensionEventListener<K extends ExtensionEventKey> = (args: ExtensionEventMap[K]) => unknown | Promise<unknown>;
912
+
913
+ declare type ExtensionEventMap = {
914
+ 'layout-change': Parameters<ExtensionApi['onLayoutChange']>[0];
915
+ 'selection-change': Parameters<ExtensionApi['onSelectionChange']>[0];
916
+ 'graphic-drag': Parameters<ExtensionApi['onGraphicDrag']>[0];
917
+ 'canvas-click': Parameters<ExtensionApi['onCanvasClick']>[0];
918
+ 'canvas-mousemove': Parameters<ExtensionApi['onCanvasMouseMove']>[0];
919
+ 'canvas-change': Parameters<ExtensionApi['onCanvasChange']>[0];
920
+ 'settings-change': HostSettings;
921
+ 'action-control': Parameters<ExtensionApi['onActionControl']>[0];
922
+ 'action-end': Parameters<ExtensionApi['onActionEnd']>[0];
923
+ };
924
+
925
+ declare class ExtrusionGeometry extends ParametricGeometryBase {
926
+ type: ExtrusionGeometryType;
927
+ profile: ClosedCurve;
928
+ height: number;
929
+ constructor(id: string, profile: ClosedCurve);
930
+ }
931
+
932
+ declare interface ExtrusionGeometryJson extends ParametricGeometryBaseJson {
933
+ type: ExtrusionGeometryType;
934
+ profile: ClosedCurve;
935
+ height: number;
936
+ }
937
+
938
+ declare type ExtrusionGeometryType = typeof ExtrusionGeometryTypeValue;
939
+
940
+ declare const ExtrusionGeometryTypeValue = "geometry:extrusion";
941
+
942
+ declare type FieldType = 'text' | 'number' | 'boolean' | 'select';
943
+
944
+ declare type FieldValueType = string | number | boolean;
945
+
946
+ declare type FloorAddress = {
947
+ line1?: string;
948
+ line2?: string;
949
+ city?: string;
950
+ state?: string;
951
+ postalCode?: string;
952
+ country?: string;
953
+ floor?: string;
954
+ };
955
+
956
+ declare type FloorData = {
957
+ id: string;
958
+ name: string;
959
+ level: string;
960
+ area: number;
961
+ createdAt: string;
962
+ updatedAt: string;
963
+ isPrivate: boolean;
964
+ isArchived: boolean;
965
+ labels: {
966
+ name: string;
967
+ color: string;
968
+ }[];
969
+ transform: {
970
+ position: [number, number, number];
971
+ rotation: number;
972
+ };
973
+ location: {
974
+ address: FloorAddress;
975
+ coordinates: {
976
+ lat: number;
977
+ long: number;
978
+ bearing: number;
979
+ };
980
+ };
981
+ };
982
+
983
+ declare type FloorDefaultSelect = {
984
+ id: true;
985
+ name: true;
986
+ area: true;
987
+ level: true;
988
+ labels: true;
989
+ transform: true;
990
+ location: true;
991
+ };
992
+
993
+ /**
994
+ * This is the place to give the floor plan your own style
995
+ */
996
+ declare type FloorPlanTheme = {
997
+ /** define the background */
998
+ background?: BackgroundOptions;
999
+ /** wall contours are merged to one continuous outline, needed if you want white walls */
1000
+ wallContours?: boolean;
1001
+ /** render assets with textures rather than solid colors */
1002
+ showAssetTextures?: boolean;
1003
+ fontFamily?: string;
1004
+ roomStamps?: {
1005
+ /** show the area information in room stamps */
1006
+ roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id' | ['customAttribute', string])[];
1007
+ /** text color for room stamps */
1008
+ text?: Rgb;
1009
+ /** whether the room stamp text should have an outline to assist with contrast issues */
1010
+ textOutline?: boolean;
1011
+ /** if set room stamps have a fixed size - otherwise they adapt to the zoom level */
1012
+ fontSize?: number;
1013
+ };
1014
+ byId?: StyleByKey;
1015
+ byFilter?: ThemeStyles['byFilter'];
1016
+ /* Excluded from this release type: byResolvedFilter */
1017
+ byType?: ThemeStyles['byType'];
1018
+ };
1019
+
1020
+ declare type FloorSelect = {
1021
+ id?: boolean;
1022
+ name?: boolean;
1023
+ level?: boolean;
1024
+ area?: boolean;
1025
+ createdAt?: boolean;
1026
+ updatedAt?: boolean;
1027
+ isPrivate?: boolean;
1028
+ isArchived?: boolean;
1029
+ labels?: boolean | {
1030
+ name?: boolean;
1031
+ color?: boolean;
1032
+ };
1033
+ transform?: boolean | {
1034
+ position?: boolean;
1035
+ rotation?: boolean;
1036
+ };
1037
+ location?: boolean | {
1038
+ address?: boolean;
1039
+ coordinates?: boolean;
1040
+ };
1041
+ };
1042
+
1043
+ declare const geometriesTypeValues: {
1044
+ readonly 'geometry:plane': typeof PlaneGeometry;
1045
+ readonly 'geometry:cuboid': typeof CuboidGeometry;
1046
+ readonly 'geometry:sphere': typeof SphereGeometry;
1047
+ readonly 'geometry:extrusion': typeof ExtrusionGeometry;
1048
+ readonly 'geometry:mesh': typeof MeshGeometry;
1049
+ readonly 'geometry:uri': typeof UriGeometry;
1050
+ };
1051
+
1052
+ declare class GeometryBase extends SpaceGraphNodeBase {
1053
+ type: SpaceGraphGeometryType;
1054
+ position: PositionEntry;
1055
+ rotation: RotationEntry;
1056
+ rotationAxis: Vector3;
1057
+ boundingBox: BoundingBox3d;
1058
+ surfaces: Surfaces;
1059
+ materials: SurfaceMaterialsJson;
1060
+ constructor(id: string, type: SpaceGraphGeometryType);
1061
+ }
1062
+
1063
+ declare interface GeometryBaseJson extends SpaceGraphNodeBaseJson {
1064
+ id: string;
1065
+ type: SpaceGraphGeometryType;
1066
+ position?: PositionEntry;
1067
+ rotation?: RotationEntry;
1068
+ rotationAxis?: Vector3;
1069
+ boundingBox?: BoundingBox3d;
1070
+ surfaces?: Surfaces;
1071
+ materials?: SurfaceMaterialsJson;
1072
+ material?: SpaceGraphMaterialJson;
1073
+ }
1074
+
1075
+ declare class GeometryClip extends GeometryOperationPlaneBase {
1076
+ type: GeometryClipType;
1077
+ constructor(id: string, plane: Plane, material: SpaceGraphMaterial);
1078
+ }
1079
+
1080
+ declare interface GeometryClipJson extends GeometryOperationPlaneBaseJson {
1081
+ type: GeometryClipType;
1082
+ }
1083
+
1084
+ declare type GeometryClipType = typeof GeometryClipTypeValue;
1085
+
1086
+ declare const GeometryClipTypeValue = "csg:clip";
1087
+
1088
+ declare type GeometryFaceIndices = number[] | IndexRange | 'all';
1089
+
1090
+ declare class GeometryIntersect extends GeometryOperationGeometryBase {
1091
+ type: GeometryIntersectType;
1092
+ }
1093
+
1094
+ declare interface GeometryIntersectJson extends GeometryOperationGeometryBaseJson {
1095
+ type: GeometryIntersectType;
1096
+ }
1097
+
1098
+ declare type GeometryIntersectType = typeof GeometryIntersectTypeValue;
1099
+
1100
+ declare const GeometryIntersectTypeValue = "csg:intersect";
1101
+
1102
+ declare type GeometryOperation = GeometryOperationGeometry | GeometryOperationPlane;
1103
+
1104
+ declare class GeometryOperationBase extends SpaceGraphTypedValue {
1105
+ type: GeometryOperationType;
1106
+ constructor(type: GeometryOperationType);
1107
+ }
1108
+
1109
+ declare interface GeometryOperationBaseJson extends SpaceGraphTypedValueJson {
1110
+ type: GeometryOperationType;
1111
+ }
1112
+
1113
+ declare type GeometryOperationGeometry = GeometryReference | GeometrySubtract | GeometryUnion | GeometryIntersect;
1114
+
1115
+ declare class GeometryOperationGeometryBase extends GeometryOperationBase {
1116
+ type: GeometryOperationGeometryType;
1117
+ geometry: SpaceGraphGeometry;
1118
+ position: PositionEntry;
1119
+ rotation: RotationEntry;
1120
+ rotationAxis: Vector3;
1121
+ materials: SurfaceMaterials;
1122
+ constructor(type: GeometryOperationGeometryType, geometry: SpaceGraphGeometry, materials: SurfaceMaterials);
1123
+ }
1124
+
1125
+ declare interface GeometryOperationGeometryBaseJson extends GeometryOperationBaseJson {
1126
+ type: GeometryOperationGeometryType;
1127
+ geometry: string | SpaceGraphGeometryJson;
1128
+ position?: PositionEntry;
1129
+ rotation?: RotationEntry;
1130
+ rotationAxis?: Vector3;
1131
+ materials?: SurfaceMaterialsJson;
1132
+ material?: SpaceGraphMaterialJson;
1133
+ }
1134
+
1135
+ declare type GeometryOperationGeometryJson = string | GeometryReferenceJson | GeometrySubtractJson | GeometryIntersectJson | GeometryUnionJson;
1136
+
1137
+ declare type GeometryOperationGeometryType = GeometryReferenceType | GeometrySubtractType | GeometryUnionType | GeometryIntersectType;
1138
+
1139
+ declare type GeometryOperationJson = GeometryOperationGeometryJson | GeometryOperationPlaneJson;
1140
+
1141
+ declare type GeometryOperationPlane = GeometryClip;
1142
+
1143
+ declare class GeometryOperationPlaneBase extends GeometryOperationBase {
1144
+ type: GeometryOperationPlaneType;
1145
+ plane: Plane;
1146
+ material: SpaceGraphMaterial;
1147
+ constructor(type: GeometryOperationPlaneType, plane: Plane, material: SpaceGraphMaterial);
1148
+ }
1149
+
1150
+ declare interface GeometryOperationPlaneBaseJson extends GeometryOperationBaseJson {
1151
+ type: GeometryOperationPlaneType;
1152
+ plane: Plane;
1153
+ material: SpaceGraphMaterialJson;
1154
+ }
1155
+
1156
+ declare type GeometryOperationPlaneJson = GeometryClipJson;
1157
+
1158
+ declare type GeometryOperationPlaneType = GeometryClipType;
1159
+
1160
+ declare type GeometryOperationType = GeometryOperationGeometryType | GeometryOperationPlaneType;
1161
+
1162
+ declare class GeometryReference extends GeometryOperationGeometryBase {
1163
+ type: GeometryReferenceType;
1164
+ }
1165
+
1166
+ declare interface GeometryReferenceJson extends GeometryOperationGeometryBaseJson {
1167
+ type: GeometryReferenceType;
1168
+ }
1169
+
1170
+ declare type GeometryReferenceType = typeof GeometryReferenceTypeValue;
1171
+
1172
+ declare const GeometryReferenceTypeValue = "reference:geometry";
1173
+
1174
+ declare class GeometrySubtract extends GeometryOperationGeometryBase {
1175
+ type: GeometrySubtractType;
1176
+ }
1177
+
1178
+ declare interface GeometrySubtractJson extends GeometryOperationGeometryBaseJson {
1179
+ type: GeometrySubtractType;
1180
+ }
1181
+
1182
+ declare type GeometrySubtractType = typeof GeometrySubtractTypeValue;
1183
+
1184
+ declare const GeometrySubtractTypeValue = "csg:subtract";
1185
+
1186
+ declare class GeometryUnion extends GeometryOperationGeometryBase {
1187
+ type: GeometryUnionType;
1188
+ }
1189
+
1190
+ declare interface GeometryUnionJson extends GeometryOperationGeometryBaseJson {
1191
+ type: GeometryUnionType;
1192
+ }
1193
+
1194
+ declare type GeometryUnionType = typeof GeometryUnionTypeValue;
1195
+
1196
+ declare const GeometryUnionTypeValue = "csg:union";
1197
+
1198
+ /**
1199
+ * undirected graph for traversal without edge weights
1200
+ */
1201
+ declare class Graph<T extends GraphNodeType = GraphNodeType, K extends string = GraphEdgeType> {
1202
+ nodeMap: Map<T, Map<K, Set<T>>>;
1203
+ addNode(node: T): Map<K, Set<T>>;
1204
+ addEdge(type: K, source: T, destination: T): void;
1205
+ removeNode(node: T): void;
1206
+ removeEdge(type: K, source: T, destination: T): void;
1207
+ /**
1208
+ * Breadth-First Search
1209
+ * if edges have weights this needs to be replaces with dijkstra algorithm
1210
+ */
1211
+ findShortestPath(edgeType: K, start: T, end: T, options?: {
1212
+ depthLimit?: number;
1213
+ }): T[] | null;
1214
+ toJSON(): {
1215
+ nodes: {
1216
+ id: string;
1217
+ type: string;
1218
+ }[];
1219
+ edges: {
1220
+ type: string;
1221
+ nodes: string[];
1222
+ }[];
1223
+ };
1224
+ }
1225
+
1226
+ declare type GraphEdgeType = 'graph:adjacentTo' | 'graph:connectedTo';
1227
+
1228
+ declare type GraphNodeType = {
1229
+ id: string;
1230
+ type: string;
1231
+ };
1232
+
1233
+ declare class GroupRelation extends SpaceGraphNodeBase {
1234
+ type: GroupRelationType;
1235
+ elements: Set<LayoutElement>;
1236
+ constructor(id: string);
1237
+ insertElements(elements: LayoutElement[]): void;
1238
+ removeElements(elements: LayoutElement[]): void;
1239
+ copyForClone(product: GroupRelation): void;
1240
+ toJSON(): GroupRelationJson;
1241
+ }
1242
+
1243
+ declare interface GroupRelationJson extends SpaceGraphNodeBaseJson {
1244
+ type: GroupRelationType;
1245
+ elements: string[];
1246
+ }
1247
+
1248
+ declare type GroupRelationType = typeof GroupRelationTypeValue;
1249
+
1250
+ declare const GroupRelationTypeValue = "relation:group";
1251
+
1252
+ declare type GroupShape = Omit<GroupShape_2, 'children'> & {
1253
+ children: Shape[];
1254
+ };
1255
+
1256
+ declare interface GroupShape_2 {
1257
+ type: 'group';
1258
+ position?: Vector2;
1259
+ rotation?: number;
1260
+ children: Shape_2[];
1261
+ style?: ShapeStyle;
1262
+ }
1263
+
1264
+ /**
1265
+ * Elements that can be hidden in the floor plan
1266
+ */
1267
+ declare type HideableElement = LayoutElement['type'] | LayoutSpace['type'] | SpatialGraphEdge['type'] | LayoutAnnotation['type'] | 'roomStamp';
1268
+
1269
+ declare type HingeSide = 'left' | 'right';
1270
+
1271
+ declare type HostApi = {
1272
+ /**
1273
+ * @example
1274
+ * ```ts
1275
+ * const element = await hostApi.getElementsById({
1276
+ * id,
1277
+ * select: { type: true, dimensions: { length: true }}
1278
+ * })
1279
+ * ```
1280
+ */
1281
+ getElementById: <S extends ElementSelect = DefaultSelect>(args: {
1282
+ id: string;
1283
+ select?: S;
1284
+ }) => Promise<QueryPick<ElementData, S> | null>;
1285
+ /**
1286
+ * @example
1287
+ * ```ts
1288
+ * const elements = await hostApi.getElements({
1289
+ * where: {
1290
+ * customAttributes: { broken: true }
1291
+ * }
1292
+ * })
1293
+ * ```
1294
+ */
1295
+ getElements: <S extends ElementSelect = DefaultSelect>(args?: {
1296
+ select?: S;
1297
+ where?: ElementFilter;
1298
+ }) => Promise<QueryPick<ElementData, S>[]>;
1299
+ getSpaceById: <S extends SpaceSelect = DefaultSelect>(args: {
1300
+ id: string;
1301
+ select?: S;
1302
+ }) => Promise<QueryPick<SpaceData, S> | null>;
1303
+ getSpaces: <S extends SpaceSelect = DefaultSelect>(args?: {
1304
+ select?: S;
1305
+ where?: SpaceFilter;
1306
+ }) => Promise<QueryPick<SpaceData, S>[]>;
1307
+ getProductById: <S extends ProductSelect = DefaultSelect>(args: {
1308
+ id: string;
1309
+ select?: S;
1310
+ }) => Promise<QueryPick<ProductData, S> | null>;
1311
+ getProducts: <S extends ProductSelect = DefaultSelect>(args?: {
1312
+ select?: S;
1313
+ where?: ProductFilter;
1314
+ }) => Promise<QueryPick<ProductData, S>[]>;
1315
+ getLayout: <S extends LayoutSelect = DefaultSelect>(args?: {
1316
+ select?: S;
1317
+ }) => Promise<QueryPick<LayoutData, S>>;
1318
+ getFloor: <S extends FloorSelect = FloorDefaultSelect>(args?: {
1319
+ select?: S;
1320
+ }) => Promise<QueryPick<FloorData, S>>;
1321
+ /** `label` names the undo step on hosts that support it; older hosts ignore it. */
1322
+ runOperations: (args: {
1323
+ operations: OperationJson[];
1324
+ label?: string;
1325
+ }) => Promise<OperationsResult>;
1326
+ setPlanConfig: (config: {
1327
+ theme?: FloorPlanTheme;
1328
+ hideElements?: HideableElement[];
1329
+ }) => Promise<boolean>;
1330
+ addPlanLayer: (args: {
1331
+ id?: string;
1332
+ baseLayer?: string;
1333
+ }) => Promise<EntityResult>;
1334
+ addPlanGraphic: (args: {
1335
+ shapes: Shape[];
1336
+ interaction?: {
1337
+ click?: boolean;
1338
+ drag?: boolean;
1339
+ };
1340
+ position?: Vector2;
1341
+ fixedScreenSize?: boolean;
1342
+ id?: string;
1343
+ layerId?: string;
1344
+ clearLayer?: boolean;
1345
+ }) => Promise<EntityResult>;
1346
+ zoomToNode: (args: {
1347
+ nodeId: string;
1348
+ margin?: number;
1349
+ animate?: number | boolean;
1350
+ }) => Promise<boolean>;
1351
+ zoomExtents: (args?: {
1352
+ margin?: number;
1353
+ animate?: number | boolean;
1354
+ }) => Promise<boolean>;
1355
+ /**
1356
+ * Frame an arbitrary area in plan meters — e.g. a custom drawing the extension rendered that
1357
+ * the host floor's own extents don't cover.
1358
+ */
1359
+ zoomToBoundingBox: (args: {
1360
+ min: Vector2;
1361
+ max: Vector2;
1362
+ animate?: number | boolean;
1363
+ }) => Promise<boolean>;
1364
+ drawNodeUpdate: (args: {
1365
+ nodeId: string;
1366
+ style: 'selected' | ShapeStyle | false;
1367
+ }) => Promise<boolean>;
1368
+ selectNodes: (args: {
1369
+ nodeIds: string[];
1370
+ }) => Promise<NodeResult[]>;
1371
+ getSpaceGraphJson: () => Promise<SpaceGraphJson>;
1372
+ exportPdf: (args?: ExportPdfOptions) => Promise<void | ExportPdfResult>;
1373
+ exportSvg: (args?: ExportSvgOptions) => Promise<void | ExportSvgResult>;
1374
+ getPath: (args: {
1375
+ start: Vector2;
1376
+ end: Vector2;
1377
+ }) => Promise<{
1378
+ path: Vector2[];
1379
+ distance: number;
1380
+ }>;
1381
+ findClosest: (args: {
1382
+ start: Vector2;
1383
+ where: ElementFilter | SpaceFilter;
1384
+ }) => Promise<{
1385
+ path: Vector2[];
1386
+ distance: number;
1387
+ target: {
1388
+ id?: string;
1389
+ position: Vector2;
1390
+ } | null;
1391
+ }>;
1392
+ /**
1393
+ * @example
1394
+ * ```ts
1395
+ * const layoutConfig = await hostApi.prompt({
1396
+ * title: 'Specify layout configuration',
1397
+ * fields: {
1398
+ * chairCount: { type: 'number', label: 'Chair count', min: 3, max: 20, step: 1, default: 5 },
1399
+ * radius: { type: 'number', min: 1, max: 10, step: 0.1 }
1400
+ * }
1401
+ * })
1402
+ * ```
1403
+ */
1404
+ prompt: (args: PromptArgs) => Promise<Record<string, FieldValueType> | false>;
1405
+ confirm: (args: ConfirmArgs) => Promise<boolean>;
1406
+ /**
1407
+ * Make a gesture the running action. Ends whatever gesture is running first — the editor's
1408
+ * own tool or another extension's. `name` labels the host's exit control; everything after
1409
+ * start speaks the returned `runId`.
1410
+ * Prefer `startActionRun`, which wraps the runId in a handle with scoped callbacks.
1411
+ */
1412
+ startAction: (args: {
1413
+ name: string;
1414
+ controls?: ExtensionActionControls;
1415
+ }) => Promise<StartActionResult>;
1416
+ /** Replace the declared controls — the newest declaration wins. No-op on an ended run. */
1417
+ updateAction: (args: {
1418
+ runId: string;
1419
+ controls: ExtensionActionControls;
1420
+ }) => Promise<void>;
1421
+ /**
1422
+ * Apply operations as exactly one labeled undo step. All-or-nothing: an undecodable or invalid
1423
+ * batch is refused whole with the errors, and a run that already ended is refused `'ended'`.
1424
+ */
1425
+ commitAction: (args: {
1426
+ runId: string;
1427
+ operations: OperationJson[];
1428
+ label?: string;
1429
+ }) => Promise<CommitActionResult>;
1430
+ /** The extension's own clean finish. Idempotent; never echoed back as `onActionEnd`. */
1431
+ stopAction: (args: {
1432
+ runId: string;
1433
+ }) => Promise<void>;
1434
+ /** Called by the SDK runtime, not by extensions — forwards a gesture key pressed while focus is in the iframe. */
1435
+ forwardActionKey: (args: {
1436
+ runId: string;
1437
+ key: 'Escape' | 'Enter' | 'Backspace';
1438
+ repeat?: boolean;
1439
+ }) => Promise<void>;
1440
+ /**
1441
+ * Start an action and get an {@link ActionRunHandle} whose callbacks are scoped to this run.
1442
+ * Implemented locally by the SDK runtime on top of `startAction` — a stale handle is refused
1443
+ * without a round trip.
1444
+ */
1445
+ startActionRun: (args: StartActionRunArgs) => Promise<StartActionRunResult>;
1446
+ on: <K extends ExtensionEventKey>(event: K, listener: ExtensionEventListener<K>, ctx?: unknown) => void;
1447
+ once: <K extends ExtensionEventKey>(event: K, listener: ExtensionEventListener<K>, ctx?: unknown) => void;
1448
+ off: <K extends ExtensionEventKey>(event: K, listener?: ExtensionEventListener<K>) => void;
1449
+ };
1450
+
1451
+ /**
1452
+ * Display settings of the host, sent in the `onConnect` parameters (as `settings`) and again on
1453
+ * every change via `onSettingsChange` — so an extension can render measurements the way the
1454
+ * host does instead of hardcoding a unit system.
1455
+ */
1456
+ declare type HostSettings = {
1457
+ units?: {
1458
+ system?: 'metric' | 'imperial';
1459
+ /** Decimal places the host displays area values with. */
1460
+ areaDecimals?: number;
1461
+ /** Decimal places the host displays length values with. */
1462
+ lengthDecimals?: number;
1463
+ };
1464
+ };
1465
+
1466
+ /**
1467
+ * A resolved icon placed in the plan — first-class in fpe's render
1468
+ * vocabulary so every renderer consumes the icon svg natively instead of
1469
+ * decoding it from a data-uri fill.
1470
+ */
1471
+ declare interface IconShape {
1472
+ type: 'icon';
1473
+ /** Center, world coordinates */
1474
+ position: Vector2;
1475
+ /** Width and height of the square icon, meters */
1476
+ size: number;
1477
+ /** Degrees, about the center — same convention as node transforms */
1478
+ rotation?: number;
1479
+ /** Raw icon svg using currentColor, resolved from a symbol library */
1480
+ svg?: string;
1481
+ /** Remote svg source for icons outside the symbol library */
1482
+ uri?: string;
1483
+ /** Symbol id the icon svg resolved from, e.g. 'hc:user-md' */
1484
+ symbol?: string;
1485
+ /**
1486
+ * `fill` completely overrides the icon color; without it, source colors
1487
+ * render as-is, with currentColor resolved from the surrounding context.
1488
+ */
1489
+ style?: ShapeStyle;
1490
+ }
1491
+
1492
+ declare type IndexedNodeReference = {
1493
+ id: string;
1494
+ type: LayoutBoundingBoxNode['type'];
1495
+ minX: number;
1496
+ minY: number;
1497
+ maxX: number;
1498
+ maxY: number;
1499
+ };
1500
+
1501
+ declare type IndexRange = {
1502
+ type: 'index:range';
1503
+ start: number;
1504
+ end: number;
1505
+ };
1506
+
1507
+ declare type InstancesOf<ConstructorMap extends NodeConstructorMap> = {
1508
+ -readonly [Key in keyof ConstructorMap]: InstanceType<ConstructorMap[Key]>;
1509
+ };
1510
+
1511
+ declare interface LabelAppearance {
1512
+ text?: string;
1513
+ icon?: LabelIcon;
1514
+ fontSize?: number;
1515
+ color?: string;
1516
+ textOutline?: boolean;
1517
+ /** Only render within this zoom range */
1518
+ visible?: [number, number];
1519
+ fixedScreenSize?: boolean | [number, number];
1520
+ }
1521
+
1522
+ declare interface LabelIcon {
1523
+ /** Well-known symbol id, e.g. 'iso7010:F001' (fire extinguisher). Preferred over uri */
1524
+ symbol?: string;
1525
+ /** Custom SVG by URI (SVG-only, so every output stays vector), for icons outside the symbol library */
1526
+ uri?: string;
1527
+ /** Icon height in meters at world scale; the label's fixedScreenSize applies on top */
1528
+ size?: number;
1529
+ /** Arrangement relative to the text when both are set. Default 'above' */
1530
+ placement?: 'above' | 'below' | 'left' | 'right';
1531
+ /** Tint for monochrome symbols */
1532
+ color?: string;
1533
+ }
1534
+
1535
+ declare interface LabelRule extends LabelAppearance {
1536
+ query: NodeQuery;
1537
+ offset?: Vector2;
1538
+ frame?: 'local' | 'world';
1539
+ overrides?: Record<string, {
1540
+ offset?: Vector2;
1541
+ hidden?: boolean;
1542
+ }>;
1543
+ name?: string;
1544
+ }
1545
+
1546
+ declare class Layout2dView extends LayoutViewBase {
1547
+ type: Layout2dViewType;
1548
+ parameters: Layout2dViewParameters;
1549
+ constructor(id: string);
1550
+ setParameters(parameters: RecursivePartial<Layout2dViewParameters>): void;
1551
+ }
1552
+
1553
+ declare interface Layout2dViewJson extends LayoutViewBaseJson {
1554
+ type: Layout2dViewType;
1555
+ parameters?: Layout2dViewParametersJson;
1556
+ }
1557
+
1558
+ declare interface Layout2dViewNodeStyle {
1559
+ tags: string[];
1560
+ fill: string;
1561
+ fillOpacity: number;
1562
+ stroke: string;
1563
+ strokeWidth: number;
1564
+ }
1565
+
1566
+ declare type Layout2dViewNodeStyleJson = Partial<Layout2dViewNodeStyle>;
1567
+
1568
+ declare interface Layout2dViewParameters {
1569
+ style: Layout2dViewStyle;
1570
+ hidden: LayoutElementType[];
1571
+ }
1572
+
1573
+ declare interface Layout2dViewParametersJson {
1574
+ style: Layout2dViewStyleJson;
1575
+ hidden: LayoutElementType[];
1576
+ }
1577
+
1578
+ declare interface Layout2dViewStyle {
1579
+ background: Pick<Layout2dViewNodeStyle, 'fill'>;
1580
+ units: 'imperial' | 'metric';
1581
+ byId: Record<string, Layout2dViewNodeStyle>;
1582
+ byType: Record<string, Layout2dViewNodeStyle>;
1583
+ byAttribute: {
1584
+ program: Record<string, Layout2dViewNodeStyle>;
1585
+ usage: Record<string, Layout2dViewNodeStyle>;
1586
+ };
1587
+ }
1588
+
1589
+ declare interface Layout2dViewStyleJson {
1590
+ background?: Pick<Layout2dViewNodeStyleJson, 'fill'>;
1591
+ units?: 'imperial' | 'metric';
1592
+ byId?: Record<string, Layout2dViewNodeStyleJson>;
1593
+ byType?: Record<string, Layout2dViewNodeStyleJson>;
1594
+ byAttribute?: {
1595
+ program?: Record<string, Layout2dViewNodeStyleJson>;
1596
+ usage?: Record<string, Layout2dViewNodeStyleJson>;
1597
+ };
1598
+ }
1599
+
1600
+ declare type Layout2dViewType = typeof Layout2dViewTypeValue;
1601
+
1602
+ declare const Layout2dViewTypeValue = "view:2d";
1603
+
1604
+ declare class Layout3dView extends LayoutViewBase {
1605
+ type: Layout3dViewType;
1606
+ parameters: Layout3dViewParameters;
1607
+ constructor(id: string);
1608
+ setParameters(parameters: RecursivePartial<Layout3dViewParameters>): void;
1609
+ }
1610
+
1611
+ declare interface Layout3dViewJson extends LayoutViewBaseJson {
1612
+ type: Layout3dViewType;
1613
+ parameters?: Layout3dViewParametersJson;
1614
+ }
1615
+
1616
+ declare interface Layout3dViewParameters {
1617
+ position: Vector3;
1618
+ normal: Vector3;
1619
+ fov: number | 'default';
1620
+ scale: number | 'auto';
1621
+ lensShiftX: number;
1622
+ lensShiftY: number;
1623
+ projection: 'perspective' | 'orthographic';
1624
+ }
1625
+
1626
+ declare type Layout3dViewParametersJson = Partial<Layout3dViewParameters>;
1627
+
1628
+ declare type Layout3dViewType = typeof Layout3dViewTypeValue;
1629
+
1630
+ declare const Layout3dViewTypeValue = "view:3d";
1631
+
1632
+ declare type LayoutAnnotation = LayoutFloorPlanDxfAnnotation | LayoutFloorPlanImageAnnotation | LayoutLabelAnnotation;
1633
+
1634
+ declare class LayoutAnnotationBase extends LayoutNodeBase {
1635
+ type: LayoutAnnotationType;
1636
+ parameters: LayoutAnnotationParameters;
1637
+ position: Vector3;
1638
+ rotation: number;
1639
+ copyForClone(annotation: LayoutAnnotation): void;
1640
+ setTransform(position: Vector3, rotation: number): void;
1641
+ setParameters(parameters: RecursivePartial<LayoutAnnotationParameters>): void;
1642
+ toJSON(): LayoutAnnotationJson;
1643
+ }
1644
+
1645
+ declare interface LayoutAnnotationBaseJson extends LayoutNodeBaseJson {
1646
+ type: LayoutAnnotationType;
1647
+ position: Vector3;
1648
+ rotation: number;
1649
+ parameters?: LayoutAnnotationParametersJson;
1650
+ }
1651
+
1652
+ declare type LayoutAnnotationJson = LayoutFloorPlanDxfAnnotationJson | LayoutFloorPlanImageAnnotationJson | LayoutLabelAnnotationJson;
1653
+
1654
+ declare type LayoutAnnotationParameters = LayoutFloorPlanDxfParameters | LayoutFloorPlanImageParameters | LayoutLabelAnnotationParameters;
1655
+
1656
+ declare type LayoutAnnotationParametersJson = LayoutFloorPlanDxfParametersJson | LayoutFloorPlanImageParametersJson | LayoutLabelAnnotationParametersJson;
1657
+
1658
+ declare type LayoutAnnotationsByType = NodesByType<LayoutAnnotationTypeMap>;
1659
+
1660
+ declare type LayoutAnnotationType = LayoutFloorPlanDxfType | LayoutFloorPlanImageType | LayoutLabelAnnotationType;
1661
+
1662
+ declare type LayoutAnnotationTypeMap = InstancesOf<typeof layoutAnnotationTypeValues>;
1663
+
1664
+ declare const layoutAnnotationTypeValues: {
1665
+ readonly 'annotation:floorPlanDxf': typeof LayoutFloorPlanDxfAnnotation;
1666
+ readonly 'annotation:floorPlanImage': typeof LayoutFloorPlanImageAnnotation;
1667
+ readonly 'annotation:label': typeof LayoutLabelAnnotation;
1668
+ };
1669
+
1670
+ declare class LayoutAsset extends LayoutTransformElementBase {
1671
+ type: LayoutAssetType;
1672
+ parameters: LayoutAssetParameters;
1673
+ product: SpaceGraphProduct | null;
1674
+ constructor(id: string);
1675
+ get isComponentInstance(): boolean;
1676
+ get isComponentInstanceChild(): boolean;
1677
+ setParameters(parameters: RecursivePartial<LayoutAssetParameters>): void;
1678
+ setProduct(product: SpaceGraphProduct): void;
1679
+ calculateBoundingBox(): {
1680
+ min: Vector3;
1681
+ max: Vector3;
1682
+ };
1683
+ }
1684
+
1685
+ declare interface LayoutAssetJson extends LayoutTransformElementBaseJson {
1686
+ type: LayoutAssetType;
1687
+ product?: string;
1688
+ }
1689
+
1690
+ declare interface LayoutAssetMaterials {
1691
+ }
1692
+
1693
+ declare interface LayoutAssetParameters {
1694
+ materials: LayoutAssetMaterials;
1695
+ }
1696
+
1697
+ declare type LayoutAssetType = typeof LayoutAssetTypeValue;
1698
+
1699
+ declare const LayoutAssetTypeValue = "element:asset";
1700
+
1701
+ declare class LayoutBeam extends LayoutTransformElementBase {
1702
+ type: LayoutBeamType;
1703
+ parameters: LayoutBeamParameters;
1704
+ constructor(id: string);
1705
+ setParameters(parameters: RecursivePartial<LayoutBeamParameters>): void;
1706
+ }
1707
+
1708
+ declare interface LayoutBeamJson extends LayoutTransformElementBaseJson {
1709
+ type: LayoutBeamType;
1710
+ parameters?: LayoutBeamParametersJson;
1711
+ }
1712
+
1713
+ declare interface LayoutBeamMaterials {
1714
+ top: SpaceGraphMaterialJson;
1715
+ bottom: SpaceGraphMaterialJson;
1716
+ sides: SpaceGraphMaterialJson;
1717
+ }
1718
+
1719
+ declare type LayoutBeamParameters = DimensionParameters & CommonParameters;
1720
+
1721
+ declare type LayoutBeamParametersJson = DimensionParameters & Partial<CommonParameters>;
1722
+
1723
+ declare type LayoutBeamType = typeof LayoutBeamTypeValue;
1724
+
1725
+ declare const LayoutBeamTypeValue = "element:beam";
1726
+
1727
+ declare class LayoutBoundary {
1728
+ vertices: SpatialGraphVertex[];
1729
+ edges: SpatialGraphEdge[];
1730
+ geometryProfile: Vector2[];
1731
+ toJSON(): LayoutBoundaryJson;
1732
+ }
1733
+
1734
+ declare type LayoutBoundaryElement = LayoutBoundarySlab | LayoutBoundaryWall;
1735
+
1736
+ declare class LayoutBoundaryElementBase extends LayoutElementBase {
1737
+ type: LayoutBoundaryElementType;
1738
+ parameters: LayoutBoundaryElementParameters;
1739
+ boundaries: LayoutBoundary[];
1740
+ constructor(id: string, type: LayoutBoundaryElementType, boundaries: LayoutBoundary[]);
1741
+ calculateBoundingBox(): {
1742
+ min: Vector3;
1743
+ max: Vector3;
1744
+ };
1745
+ }
1746
+
1747
+ declare interface LayoutBoundaryElementBaseJson extends LayoutElementBaseJson {
1748
+ type: LayoutBoundaryElementType;
1749
+ boundaries: LayoutBoundaryJson[];
1750
+ parameters?: LayoutBoundaryElementParametersJson;
1751
+ }
1752
+
1753
+ declare type LayoutBoundaryElementJson = LayoutBoundarySlabJson | LayoutBoundaryWallJson;
1754
+
1755
+ declare type LayoutBoundaryElementParameters = LayoutBoundarySlabParameters | LayoutBoundaryWallParameters;
1756
+
1757
+ declare type LayoutBoundaryElementParametersJson = LayoutBoundarySlabParametersJson | LayoutBoundaryWallParametersJson;
1758
+
1759
+ declare type LayoutBoundaryElementType = LayoutBoundarySlabType | LayoutBoundaryWallType;
1760
+
1761
+ declare interface LayoutBoundaryJson {
1762
+ edges: string[];
1763
+ }
1764
+
1765
+ declare class LayoutBoundarySlab extends LayoutBoundaryElementBase {
1766
+ type: LayoutBoundarySlabType;
1767
+ parameters: LayoutBoundarySlabParameters;
1768
+ space: LayoutSpace | null;
1769
+ constructor(id: string, type: LayoutBoundarySlabType, boundaries: LayoutBoundary[]);
1770
+ setParameters(parameters: RecursivePartial<LayoutBoundarySlabParameters>): void;
1771
+ getSpaces(): LayoutSpace[];
1772
+ }
1773
+
1774
+ declare interface LayoutBoundarySlabJson extends LayoutBoundaryElementBaseJson {
1775
+ type: LayoutBoundarySlabType;
1776
+ parameters?: LayoutBoundarySlabParametersJson;
1777
+ }
1778
+
1779
+ declare interface LayoutBoundarySlabMaterials {
1780
+ top: SpaceGraphMaterialJson;
1781
+ bottom: SpaceGraphMaterialJson;
1782
+ sides: SpaceGraphMaterialJson;
1783
+ }
1784
+
1785
+ declare interface LayoutBoundarySlabParameters {
1786
+ height: number;
1787
+ elevation: number;
1788
+ materials: LayoutBoundarySlabMaterials;
1789
+ }
1790
+
1791
+ declare type LayoutBoundarySlabParametersJson = Partial<LayoutBoundarySlabParameters>;
1792
+
1793
+ declare type LayoutBoundarySlabType = LayoutFloorType | LayoutCeilingType;
1794
+
1795
+ declare class LayoutBoundaryWall extends LayoutBoundaryElementBase {
1796
+ type: LayoutBoundaryWallType;
1797
+ parameters: LayoutBoundaryWallParameters;
1798
+ constructor(id: string, boundaries: LayoutBoundary[]);
1799
+ setParameters(parameters: RecursivePartial<LayoutBoundaryWallParameters>): void;
1800
+ }
1801
+
1802
+ declare interface LayoutBoundaryWallJson extends LayoutBoundaryElementBaseJson {
1803
+ type: LayoutBoundaryWallType;
1804
+ parameters?: LayoutBoundaryWallParametersJson;
1805
+ }
1806
+
1807
+ declare interface LayoutBoundaryWallMaterials {
1808
+ top: SpaceGraphMaterialJson;
1809
+ bottom: SpaceGraphMaterialJson;
1810
+ sides: SpaceGraphMaterialJson;
1811
+ }
1812
+
1813
+ declare interface LayoutBoundaryWallParameters {
1814
+ height: number;
1815
+ elevation: number;
1816
+ surfaces: {
1817
+ top: [0];
1818
+ bottom: [1];
1819
+ sides: '...';
1820
+ };
1821
+ materials: LayoutBoundaryWallMaterials;
1822
+ }
1823
+
1824
+ declare type LayoutBoundaryWallParametersJson = Partial<LayoutBoundaryWallParameters>;
1825
+
1826
+ declare type LayoutBoundaryWallType = typeof LayoutBoundaryWallTypeValue;
1827
+
1828
+ declare const LayoutBoundaryWallTypeValue = "element:boundaryWall";
1829
+
1830
+ declare class LayoutBoundingBoxNode extends LayoutNodeBase {
1831
+ protected axisAlignedBoundingBox: BoundingBox3d | null;
1832
+ protected objectAlignedBoundingBox: BoundingBox3d | null;
1833
+ protected boundingBoxContour: Vector2[] | null;
1834
+ protected transform: Transform3d | null;
1835
+ protected worldTransform: Transform3d | null;
1836
+ calculateTransform(): Transform3d;
1837
+ getTransform(): Transform3d;
1838
+ calculateWorldTransform(): Transform3d;
1839
+ getWorldTransform(): Transform3d;
1840
+ resetTransform(resetIndex?: boolean): void;
1841
+ resetBoundingBox(resetIndex?: boolean): void;
1842
+ resetSpatialIndexing(): void;
1843
+ calculateBoundingBox(): BoundingBox3d;
1844
+ /**
1845
+ * returns the node's object aligned bounding box with transform
1846
+ */
1847
+ getBoundingBox(localTransform?: boolean): TransformBoundingBox3d;
1848
+ /**
1849
+ * returns the node's axis aligned bounding box with transform applied
1850
+ */
1851
+ getAxisAlignedBoundingBox(): BoundingBox3d;
1852
+ calculateBoundingBoxContour(localTransform?: boolean): Vector2[];
1853
+ getBoundingBoxContour(): Vector2[];
1854
+ }
1855
+
1856
+ declare class LayoutCasework extends LayoutTransformElementBase {
1857
+ type: LayoutCaseworkType;
1858
+ parameters: LayoutCaseworkParameters;
1859
+ constructor(id: string);
1860
+ setParameters(parameters: RecursivePartial<LayoutCaseworkParameters>): void;
1861
+ }
1862
+
1863
+ declare interface LayoutCaseworkJson extends LayoutTransformElementBaseJson {
1864
+ type: LayoutCaseworkType;
1865
+ parameters?: LayoutCaseworkParametersJson;
1866
+ }
1867
+
1868
+ declare interface LayoutCaseworkMaterials {
1869
+ cabinet: SpaceGraphMaterialJson;
1870
+ cabinetDoors: SpaceGraphMaterialJson;
1871
+ counter: SpaceGraphMaterialJson;
1872
+ }
1873
+
1874
+ declare type LayoutCaseworkParameters = DimensionParameters & CommonParameters_2;
1875
+
1876
+ declare type LayoutCaseworkParametersJson = DimensionParameters & Partial<CommonParameters_2>;
1877
+
1878
+ declare type LayoutCaseworkType = typeof LayoutCaseworkTypeValue;
1879
+
1880
+ declare const LayoutCaseworkTypeValue = "element:casework";
1881
+
1882
+ declare type LayoutCeilingType = typeof LayoutCeilingTypeValue;
1883
+
1884
+ declare const LayoutCeilingTypeValue = "element:ceiling";
1885
+
1886
+ declare class LayoutColumn extends LayoutTransformElementBase {
1887
+ type: LayoutColumnType;
1888
+ parameters: LayoutColumnParameters;
1889
+ constructor(id: string);
1890
+ setParameters(parameters: RecursivePartial<LayoutColumnParameters>): void;
1891
+ }
1892
+
1893
+ declare interface LayoutColumnJson extends LayoutTransformElementBaseJson {
1894
+ type: LayoutColumnType;
1895
+ parameters?: LayoutColumnParametersJson;
1896
+ }
1897
+
1898
+ declare interface LayoutColumnMaterials {
1899
+ top: SpaceGraphMaterialJson;
1900
+ bottom: SpaceGraphMaterialJson;
1901
+ sides: SpaceGraphMaterialJson;
1902
+ }
1903
+
1904
+ declare interface LayoutColumnParameters {
1905
+ profile: LayoutColumnProfile;
1906
+ /** @minimum 0.01 */
1907
+ height: number;
1908
+ materials: LayoutColumnMaterials;
1909
+ }
1910
+
1911
+ declare type LayoutColumnParametersJson = Partial<LayoutColumnParameters>;
1912
+
1913
+ declare type LayoutColumnProfile = RectangleCurve | CircleCurve | PolygonCurve | PolygonWithHolesCurve;
1914
+
1915
+ declare type LayoutColumnType = typeof LayoutColumnTypeValue;
1916
+
1917
+ declare const LayoutColumnTypeValue = "element:column";
1918
+
1919
+ declare class LayoutCurtainWall extends LayoutEdgeElementBase {
1920
+ type: LayoutCurtainWallType;
1921
+ parameters: LayoutCurtainWallParameters;
1922
+ constructor(id: string, edges: SpatialGraphEdge[]);
1923
+ setParameters(parameters: RecursivePartial<LayoutCurtainWallParameters>): void;
1924
+ }
1925
+
1926
+ declare interface LayoutCurtainWallJson extends LayoutEdgeElementBaseJson {
1927
+ type: LayoutCurtainWallType;
1928
+ parameters?: LayoutCurtainWallParametersJson;
1929
+ }
1930
+
1931
+ declare interface LayoutCurtainWallParameters {
1932
+ }
1933
+
1934
+ declare type LayoutCurtainWallParametersJson = Partial<LayoutCurtainWallParameters>;
1935
+
1936
+ declare type LayoutCurtainWallType = typeof LayoutCurtainWallTypeValue;
1937
+
1938
+ declare const LayoutCurtainWallTypeValue = "element:curtainWall";
1939
+
1940
+ declare interface LayoutData extends BaseData {
1941
+ type: SpaceGraphLayout['type'];
1942
+ }
1943
+
1944
+ declare class LayoutDoor extends LayoutTransformElementBase {
1945
+ type: LayoutDoorType;
1946
+ parent: LayoutOpening | null;
1947
+ parameters: LayoutDoorParameters;
1948
+ constructor(id: string);
1949
+ setParameters(parameters: RecursivePartial<LayoutDoorParameters>): void;
1950
+ calculateBoundingBox(): {
1951
+ min: Vector3;
1952
+ max: Vector3;
1953
+ };
1954
+ }
1955
+
1956
+ declare interface LayoutDoorJson extends LayoutTransformElementBaseJson {
1957
+ type: LayoutDoorType;
1958
+ parameters?: LayoutDoorParametersJson;
1959
+ }
1960
+
1961
+ declare interface LayoutDoorMaterials {
1962
+ frame: SpaceGraphMaterialJson;
1963
+ leaf: SpaceGraphMaterialJson;
1964
+ }
1965
+
1966
+ declare type LayoutDoorParameters = DimensionParameters_2 & CommonParameters_3;
1967
+
1968
+ declare type LayoutDoorParametersJson = DimensionParameters_2 & Partial<CommonParameters_3>;
1969
+
1970
+ declare type LayoutDoorType = typeof LayoutDoorTypeValue;
1971
+
1972
+ declare const LayoutDoorTypeValue = "element:door";
1973
+
1974
+ declare type LayoutEdgeElement = LayoutCurtainWall | LayoutSpaceDivider | LayoutWall;
1975
+
1976
+ declare class LayoutEdgeElementBase extends LayoutElementBase {
1977
+ #private;
1978
+ type: LayoutEdgeElementType;
1979
+ parameters: LayoutEdgeElementParameters;
1980
+ private edges;
1981
+ private vertices;
1982
+ private boundingBoxTransform;
1983
+ edgesChanged: boolean;
1984
+ constructor(id: string, type: LayoutEdgeElementType, edges: SpatialGraphEdge[]);
1985
+ setEdges(edges: SpatialGraphEdge[]): void;
1986
+ getEdges(): SpatialGraphEdge[];
1987
+ getVertices(): SpatialGraphVertex[];
1988
+ getStartVertex(): SpatialGraphVertex | undefined;
1989
+ getEndVertex(): SpatialGraphVertex | undefined;
1990
+ getAxisPoints(): [Vector2, Vector2] | [];
1991
+ getAxisLength(): number;
1992
+ getEdgeAtLinearPosition(u: number): SpatialGraphEdge | undefined;
1993
+ getEdgesAtLinearSegment(u: number, v: number): SpatialGraphEdge[];
1994
+ resetTransform(): void;
1995
+ getBoundingBox(): TransformBoundingBox3d;
1996
+ calculateBoundingBoxTransform(): Transform3d;
1997
+ /**
1998
+ * @deprecated Use getEdges() instead of edge
1999
+ */
2000
+ get edge(): SpatialGraphEdge;
2001
+ getAdjacentElementsByVertex(): [LayoutEdgeElement[], LayoutEdgeElement[]];
2002
+ getAdjacentSpacesBySide(): [LayoutSpace[], LayoutSpace[]];
2003
+ getSpaces(): LayoutSpace[];
2004
+ getElementsAtLinearPosition(u: number): LayoutElement[];
2005
+ get isExternal(): boolean;
2006
+ }
2007
+
2008
+ declare interface LayoutEdgeElementBaseJson extends LayoutElementBaseJson {
2009
+ type: LayoutEdgeElementType;
2010
+ edge: string | string[];
2011
+ parameters?: LayoutEdgeElementParametersJson;
2012
+ }
2013
+
2014
+ declare type LayoutEdgeElementJson = LayoutCurtainWallJson | LayoutSpaceDividerJson | LayoutWallJson;
2015
+
2016
+ declare type LayoutEdgeElementParameters = LayoutCurtainWallParameters | LayoutSpaceDividerParameters | LayoutWallParameters;
2017
+
2018
+ declare type LayoutEdgeElementParametersJson = LayoutCurtainWallParametersJson | LayoutSpaceDividerParametersJson | LayoutWallParametersJson;
2019
+
2020
+ declare type LayoutEdgeElementType = LayoutCurtainWallType | LayoutSpaceDividerType | LayoutWallType;
2021
+
2022
+ declare type LayoutElement = LayoutBoundaryElement | LayoutEdgeElement | LayoutOpeningElement | LayoutTransformElement;
2023
+
2024
+ declare class LayoutElementBase extends LayoutBoundingBoxNode {
2025
+ type: LayoutElementType;
2026
+ parameters: LayoutElementParameters;
2027
+ parent: LayoutElement | null;
2028
+ elements: LayoutElement[];
2029
+ geometries: GeometryOperationJson[];
2030
+ insertElement(element: LayoutElement): void;
2031
+ get isExternal(): boolean;
2032
+ resetTransform(resetIndex?: boolean): void;
2033
+ resetBoundingBox(resetIndex?: boolean): void;
2034
+ removeElement(element: LayoutElement): void;
2035
+ copyForClone(element: LayoutElement): void;
2036
+ setParameters(parameters: RecursivePartial<LayoutElementParameters>): void;
2037
+ getSpaces(): LayoutSpace[];
2038
+ toJSON(): LayoutElementJson;
2039
+ }
2040
+
2041
+ declare interface LayoutElementBaseJson extends LayoutNodeBaseJson {
2042
+ type: LayoutElementType;
2043
+ geometries?: GeometryOperationJson[];
2044
+ parameters?: LayoutElementParametersJson;
2045
+ elements?: LayoutElementJson[];
2046
+ }
2047
+
2048
+ declare type LayoutElementJson = LayoutBoundaryElementJson | LayoutEdgeElementJson | LayoutOpeningElementJson | LayoutTransformElementJson;
2049
+
2050
+ declare type LayoutElementParameters = LayoutBoundaryElementParameters | LayoutEdgeElementParameters | LayoutOpeningElementParameters | LayoutTransformElementParameters;
2051
+
2052
+ declare type LayoutElementParametersJson = LayoutBoundaryElementParametersJson | LayoutEdgeElementParametersJson | LayoutOpeningElementParametersJson | LayoutTransformElementParametersJson;
2053
+
2054
+ declare type LayoutElementsByType = NodesByType<LayoutElementTypeMap>;
2055
+
2056
+ declare type LayoutElementType = LayoutBoundaryElementType | LayoutEdgeElementType | LayoutOpeningElementType | LayoutTransformElementType;
2057
+
2058
+ declare type LayoutElementTypeMap = InstancesOf<typeof layoutElementTypeValues>;
2059
+
2060
+ declare const layoutElementTypeValues: {
2061
+ readonly 'element:ceiling': typeof LayoutBoundarySlab;
2062
+ readonly 'element:floor': typeof LayoutBoundarySlab;
2063
+ readonly 'element:boundaryWall': typeof LayoutBoundaryWall;
2064
+ readonly 'element:curtainWall': typeof LayoutCurtainWall;
2065
+ readonly 'element:spaceDivider': typeof LayoutSpaceDivider;
2066
+ readonly 'element:wall': typeof LayoutWall;
2067
+ readonly 'element:opening': typeof LayoutOpening;
2068
+ readonly 'element:asset': typeof LayoutAsset;
2069
+ readonly 'element:beam': typeof LayoutBeam;
2070
+ readonly 'element:casework': typeof LayoutCasework;
2071
+ readonly 'element:column': typeof LayoutColumn;
2072
+ readonly 'element:door': typeof LayoutDoor;
2073
+ readonly 'element:generic': typeof LayoutGeneric;
2074
+ readonly 'element:kitchen': typeof LayoutKitchen;
2075
+ readonly 'element:railing': typeof LayoutRailing;
2076
+ readonly 'element:ramp': typeof LayoutRamp;
2077
+ readonly 'element:roof': typeof LayoutRoof;
2078
+ readonly 'element:slab': typeof LayoutSlab;
2079
+ readonly 'element:stairs': typeof LayoutStairs;
2080
+ readonly 'element:stairFlight': typeof LayoutStairFlight;
2081
+ readonly 'element:window': typeof LayoutWindow;
2082
+ };
2083
+
2084
+ declare class LayoutFloorPlanDxfAnnotation extends LayoutAnnotationBase {
2085
+ type: LayoutFloorPlanDxfType;
2086
+ parameters: LayoutFloorPlanDxfParameters;
2087
+ constructor(id: string);
2088
+ setParameters(parameters: RecursivePartial<LayoutFloorPlanDxfParameters>): void;
2089
+ }
2090
+
2091
+ declare interface LayoutFloorPlanDxfAnnotationJson extends LayoutAnnotationBaseJson {
2092
+ type: LayoutFloorPlanDxfType;
2093
+ parameters?: LayoutFloorPlanDxfParametersJson;
2094
+ }
2095
+
2096
+ declare interface LayoutFloorPlanDxfParameters {
2097
+ uri: string;
2098
+ drawingOrigin: Vector2;
2099
+ drawingUnits: DxfUnitsString;
2100
+ hiddenLayers: string[];
2101
+ }
2102
+
2103
+ declare type LayoutFloorPlanDxfParametersJson = Partial<LayoutFloorPlanDxfParameters>;
2104
+
2105
+ declare type LayoutFloorPlanDxfType = typeof LayoutFloorPlanDxfTypeValue;
2106
+
2107
+ declare const LayoutFloorPlanDxfTypeValue = "annotation:floorPlanDxf";
2108
+
2109
+ declare class LayoutFloorPlanImageAnnotation extends LayoutAnnotationBase {
2110
+ type: LayoutFloorPlanImageType;
2111
+ parameters: LayoutFloorPlanImageParameters;
2112
+ constructor(id: string);
2113
+ setParameters(parameters: RecursivePartial<LayoutFloorPlanImageParameters>): void;
2114
+ }
2115
+
2116
+ declare interface LayoutFloorPlanImageAnnotationJson extends LayoutAnnotationBaseJson {
2117
+ type: LayoutFloorPlanImageType;
2118
+ parameters?: LayoutFloorPlanImageParametersJson;
2119
+ }
2120
+
2121
+ declare interface LayoutFloorPlanImageParameters {
2122
+ uri: string;
2123
+ length: number;
2124
+ width: number;
2125
+ }
2126
+
2127
+ declare type LayoutFloorPlanImageParametersJson = Partial<LayoutFloorPlanImageParameters>;
2128
+
2129
+ declare type LayoutFloorPlanImageType = typeof LayoutFloorPlanImageTypeValue;
2130
+
2131
+ declare const LayoutFloorPlanImageTypeValue = "annotation:floorPlanImage";
2132
+
2133
+ declare type LayoutFloorType = typeof LayoutFloorTypeValue;
2134
+
2135
+ declare const LayoutFloorTypeValue = "element:floor";
2136
+
2137
+ declare class LayoutGeneric extends LayoutTransformElementBase {
2138
+ type: LayoutGenericType;
2139
+ parameters: LayoutGenericParameters;
2140
+ constructor(id: string);
2141
+ setParameters(parameters: RecursivePartial<LayoutGenericParameters>): void;
2142
+ }
2143
+
2144
+ declare interface LayoutGenericJson extends LayoutTransformElementBaseJson {
2145
+ type: LayoutGenericType;
2146
+ parameters?: LayoutGenericParametersJson;
2147
+ }
2148
+
2149
+ declare interface LayoutGenericMaterials {
2150
+ top: SpaceGraphMaterialJson;
2151
+ bottom: SpaceGraphMaterialJson;
2152
+ sides: SpaceGraphMaterialJson;
2153
+ }
2154
+
2155
+ declare interface LayoutGenericParameters {
2156
+ profile: LayoutGenericProfile;
2157
+ height: number;
2158
+ materials: LayoutGenericMaterials;
2159
+ }
2160
+
2161
+ declare type LayoutGenericParametersJson = Partial<LayoutGenericParameters>;
2162
+
2163
+ declare type LayoutGenericProfile = 'none' | RectangleCurve | CircleCurve | PolygonCurve | PolygonWithHolesCurve;
2164
+
2165
+ declare type LayoutGenericType = typeof LayoutGenericTypeValue;
2166
+
2167
+ declare const LayoutGenericTypeValue = "element:generic";
2168
+
2169
+ declare class LayoutKitchen extends LayoutTransformElementBase {
2170
+ type: LayoutKitchenType;
2171
+ parameters: LayoutKitchenParameters;
2172
+ constructor(id: string);
2173
+ setParameters(parameters: RecursivePartial<LayoutKitchenParameters>, skipElementCreation?: boolean): void;
2174
+ }
2175
+
2176
+ declare interface LayoutKitchenJson extends LayoutTransformElementBaseJson {
2177
+ type: LayoutKitchenType;
2178
+ parameters?: LayoutKitchenParametersJson;
2179
+ }
2180
+
2181
+ declare interface LayoutKitchenMaterials {
2182
+ cabinet: SpaceGraphMaterialJson;
2183
+ cabinetDoors: SpaceGraphMaterialJson;
2184
+ counter: SpaceGraphMaterialJson;
2185
+ }
2186
+
2187
+ declare type LayoutKitchenParameters = DimensionParameters & CommonParameters_4;
2188
+
2189
+ declare type LayoutKitchenParametersJson = DimensionParameters & Partial<CommonParameters_4>;
2190
+
2191
+ declare type LayoutKitchenType = typeof LayoutKitchenTypeValue;
2192
+
2193
+ declare const LayoutKitchenTypeValue = "element:kitchen";
2194
+
2195
+ declare class LayoutLabelAnnotation extends LayoutAnnotationBase {
2196
+ type: LayoutLabelAnnotationType;
2197
+ parameters: LayoutLabelAnnotationParameters;
2198
+ constructor(id: string);
2199
+ setParameters(parameters: RecursivePartial<LayoutLabelAnnotationParameters>): void;
2200
+ }
2201
+
2202
+ declare interface LayoutLabelAnnotationJson extends LayoutAnnotationBaseJson {
2203
+ type: LayoutLabelAnnotationType;
2204
+ parameters?: LayoutLabelAnnotationParametersJson;
2205
+ }
2206
+
2207
+ declare interface LayoutLabelAnnotationParameters extends LabelAppearance {
2208
+ anchor?: {
2209
+ node: string;
2210
+ offset?: Vector2;
2211
+ frame?: 'local' | 'world';
2212
+ };
2213
+ }
2214
+
2215
+ declare type LayoutLabelAnnotationParametersJson = LayoutLabelAnnotationParameters;
2216
+
2217
+ declare type LayoutLabelAnnotationType = typeof LayoutLabelAnnotationTypeValue;
2218
+
2219
+ declare const LayoutLabelAnnotationTypeValue = "annotation:label";
2220
+
2221
+ declare type LayoutNode = SpatialGraphNode_2 | LayoutSpace | LayoutElement | LayoutAnnotation | LayoutView;
2222
+
2223
+ declare class LayoutNodeBase extends SpaceGraphNodeWithCustomAttributesBase {
2224
+ type: LayoutNodeType;
2225
+ layout: SpaceGraphLayout;
2226
+ constructor(id: string, type: LayoutNodeType);
2227
+ }
2228
+
2229
+ declare interface LayoutNodeBaseJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
2230
+ type: LayoutNodeType;
2231
+ }
2232
+
2233
+ declare type LayoutNodeType = SpatialGraphNodeType | LayoutSpaceType | LayoutElementType | LayoutAnnotationType | LayoutViewType;
2234
+
2235
+ declare type LayoutNodeTypeMap = LayoutElementTypeMap & LayoutAnnotationTypeMap & LayoutViewTypeMap & {
2236
+ 'spatialGraph:edge': SpatialGraphEdge;
2237
+ 'spatialGraph:vertex': SpatialGraphVertex;
2238
+ 'layout:space': LayoutSpace;
2239
+ };
2240
+
2241
+ declare class LayoutOpening extends LayoutOpeningElementBase {
2242
+ type: LayoutOpeningType;
2243
+ parameters: LayoutOpeningParameters;
2244
+ constructor(id: string);
2245
+ getTransform(): Transform3d;
2246
+ get position(): Vector3;
2247
+ get rotation(): number;
2248
+ setParameters(parameters: RecursivePartial<LayoutOpeningParameters>): void;
2249
+ getBoundingBox(localTransform?: boolean): {
2250
+ min: Vector3;
2251
+ max: Vector3;
2252
+ transform: Transform3d;
2253
+ };
2254
+ getSpaces(): LayoutSpace[];
2255
+ get isExternal(): boolean;
2256
+ }
2257
+
2258
+ declare type LayoutOpeningElement = LayoutOpening;
2259
+
2260
+ declare class LayoutOpeningElementBase extends LayoutElementBase {
2261
+ type: LayoutOpeningElementType;
2262
+ parameters: LayoutOpeningElementParameters;
2263
+ parent: LayoutEdgeElement | null;
2264
+ constructor(id: string, type: LayoutOpeningElementType);
2265
+ }
2266
+
2267
+ declare interface LayoutOpeningElementBaseJson extends LayoutElementBaseJson {
2268
+ type: LayoutOpeningElementType;
2269
+ parameters?: LayoutOpeningElementParametersJson;
2270
+ }
2271
+
2272
+ declare type LayoutOpeningElementJson = LayoutOpeningJson;
2273
+
2274
+ declare type LayoutOpeningElementParameters = LayoutOpeningParameters;
2275
+
2276
+ declare type LayoutOpeningElementParametersJson = LayoutOpeningParametersJson;
2277
+
2278
+ declare type LayoutOpeningElementType = LayoutOpeningType;
2279
+
2280
+ declare interface LayoutOpeningJson extends LayoutOpeningElementBaseJson {
2281
+ type: LayoutOpeningType;
2282
+ parameters?: LayoutOpeningParametersJson;
2283
+ }
2284
+
2285
+ declare interface LayoutOpeningMaterials {
2286
+ top: SpaceGraphMaterialJson;
2287
+ bottom: SpaceGraphMaterialJson;
2288
+ sides: SpaceGraphMaterialJson;
2289
+ }
2290
+
2291
+ declare interface LayoutOpeningParameters {
2292
+ position: Vector2;
2293
+ dimensions: Vector2;
2294
+ materials: LayoutOpeningMaterials;
2295
+ }
2296
+
2297
+ declare type LayoutOpeningParametersJson = Partial<LayoutOpeningParameters>;
2298
+
2299
+ declare type LayoutOpeningType = typeof LayoutOpeningTypeValue;
2300
+
2301
+ declare const LayoutOpeningTypeValue = "element:opening";
2302
+
2303
+ declare class LayoutRailing extends LayoutTransformElementBase {
2304
+ type: LayoutRailingType;
2305
+ parameters: LayoutRailingParameters;
2306
+ constructor(id: string);
2307
+ setParameters(parameters: RecursivePartial<LayoutRailingParameters>): void;
2308
+ }
2309
+
2310
+ declare interface LayoutRailingJson extends LayoutTransformElementBaseJson {
2311
+ type: LayoutRailingType;
2312
+ parameters?: LayoutRailingParametersJson;
2313
+ }
2314
+
2315
+ declare interface LayoutRailingMaterials {
2316
+ surface: SpaceGraphMaterialJson;
2317
+ }
2318
+
2319
+ declare type LayoutRailingParameters = DimensionParameters & CommonParameters_5;
2320
+
2321
+ declare type LayoutRailingParametersJson = DimensionParameters & Partial<CommonParameters_5>;
2322
+
2323
+ declare type LayoutRailingType = typeof LayoutRailingTypeValue;
2324
+
2325
+ declare const LayoutRailingTypeValue = "element:railing";
2326
+
2327
+ declare class LayoutRamp extends LayoutTransformElementBase {
2328
+ type: LayoutRampType;
2329
+ parameters: LayoutRampParameters;
2330
+ constructor(id: string);
2331
+ }
2332
+
2333
+ declare interface LayoutRampJson extends LayoutTransformElementBaseJson {
2334
+ type: LayoutRampType;
2335
+ parameters?: LayoutRampParametersJson;
2336
+ }
2337
+
2338
+ declare interface LayoutRampMaterials {
2339
+ top: SpaceGraphMaterialJson;
2340
+ bottom: SpaceGraphMaterialJson;
2341
+ sides: SpaceGraphMaterialJson;
2342
+ }
2343
+
2344
+ declare type LayoutRampParameters = DimensionParameters & CommonParameters_6;
2345
+
2346
+ declare type LayoutRampParametersJson = DimensionParameters & Partial<CommonParameters_6>;
2347
+
2348
+ declare type LayoutRampType = typeof LayoutRampTypeValue;
2349
+
2350
+ declare const LayoutRampTypeValue = "element:ramp";
2351
+
2352
+ declare class LayoutRoof extends LayoutTransformElementBase {
2353
+ type: LayoutRoofType;
2354
+ parameters: LayoutRoofParameters;
2355
+ constructor(id: string);
2356
+ }
2357
+
2358
+ declare interface LayoutRoofJson extends LayoutTransformElementBaseJson {
2359
+ type: LayoutRoofType;
2360
+ parameters?: LayoutRoofParametersJson;
2361
+ }
2362
+
2363
+ declare interface LayoutRoofMaterials {
2364
+ }
2365
+
2366
+ declare interface LayoutRoofParameters {
2367
+ materials: LayoutRoofMaterials;
2368
+ }
2369
+
2370
+ declare type LayoutRoofParametersJson = Partial<LayoutRoofParameters>;
2371
+
2372
+ declare type LayoutRoofType = typeof LayoutRoofTypeValue;
2373
+
2374
+ declare const LayoutRoofTypeValue = "element:roof";
2375
+
2376
+ declare interface LayoutSelect extends BaseSelect {
2377
+ spaces?: SpaceQuery;
2378
+ elements?: ElementQuery;
2379
+ }
2380
+
2381
+ declare class LayoutSlab extends LayoutTransformElementBase {
2382
+ type: LayoutSlabType;
2383
+ parameters: LayoutSlabParameters;
2384
+ constructor(id: string);
2385
+ setParameters(parameters: RecursivePartial<LayoutSlabParameters>): void;
2386
+ }
2387
+
2388
+ declare interface LayoutSlabJson extends LayoutTransformElementBaseJson {
2389
+ type: LayoutSlabType;
2390
+ parameters?: LayoutSlabParametersJson;
2391
+ }
2392
+
2393
+ declare interface LayoutSlabMaterials {
2394
+ top: SpaceGraphMaterialJson;
2395
+ bottom: SpaceGraphMaterialJson;
2396
+ sides: SpaceGraphMaterialJson;
2397
+ }
2398
+
2399
+ declare interface LayoutSlabParameters {
2400
+ profile: LayoutSlabProfile;
2401
+ height: number;
2402
+ materials: LayoutSlabMaterials;
2403
+ }
2404
+
2405
+ declare type LayoutSlabParametersJson = Partial<LayoutSlabParameters>;
2406
+
2407
+ declare type LayoutSlabProfile = RectangleCurve | CircleCurve | PolygonCurve | PolygonWithHolesCurve;
2408
+
2409
+ declare type LayoutSlabType = typeof LayoutSlabTypeValue;
2410
+
2411
+ declare const LayoutSlabTypeValue = "element:slab";
2412
+
2413
+ declare class LayoutSpace extends LayoutBoundingBoxNode {
2414
+ #private;
2415
+ type: LayoutSpaceType;
2416
+ attributes: LayoutSpaceAttributes;
2417
+ boundaries: LayoutBoundary[];
2418
+ geometry: LayoutSpaceGeometry;
2419
+ slabs: LayoutBoundarySlab[];
2420
+ constructor(id: string, boundaries: LayoutBoundary[]);
2421
+ copyForClone(space: LayoutSpace): void;
2422
+ setId(id: string): void;
2423
+ setAttributes(attributes: LayoutSpaceAttributesJson): void;
2424
+ get isExternal(): boolean;
2425
+ calculateArea(): number;
2426
+ getArea(): number;
2427
+ setPolygons(polygons: Vector2[][]): void;
2428
+ getAdjacentSpaces(graph: Graph, { connectivity }?: {
2429
+ connectivity?: number;
2430
+ }): LayoutSpace[];
2431
+ getElements<T extends LayoutElementType = LayoutElementType>(types?: T | readonly T[]): LayoutElementTypeMap[T][];
2432
+ getBoundaryFromVertex(vertex: SpatialGraphVertex): {
2433
+ boundary: LayoutBoundary | undefined;
2434
+ itemIndex: number;
2435
+ };
2436
+ getBoundaryFromEdge(edge: SpatialGraphEdge): {
2437
+ boundary: LayoutBoundary | undefined;
2438
+ edgeIndex: number;
2439
+ };
2440
+ calculateBoundingBox(): BoundingBox3d;
2441
+ getAxisAlignedBoundingBox(): BoundingBox3d;
2442
+ resetBoundingBox(resetIndex?: boolean): void;
2443
+ resetSpatialIndexing(): void;
2444
+ attachSlab(slab: LayoutBoundarySlab): void;
2445
+ detachSlab(slab: LayoutBoundarySlab): void;
2446
+ toJSON(): LayoutSpaceJson;
2447
+ }
2448
+
2449
+ declare interface LayoutSpaceAttributes {
2450
+ usage: string;
2451
+ program: string;
2452
+ }
2453
+
2454
+ declare interface LayoutSpaceAttributesJson {
2455
+ usage?: string;
2456
+ program?: string;
2457
+ }
2458
+
2459
+ declare class LayoutSpaceDivider extends LayoutEdgeElementBase {
2460
+ type: LayoutSpaceDividerType;
2461
+ parameters: LayoutSpaceDividerParameters;
2462
+ constructor(id: string, edges: SpatialGraphEdge[]);
2463
+ setParameters(parameters: RecursivePartial<LayoutSpaceDividerParameters>): void;
2464
+ calculateBoundingBox(): BoundingBox3d;
2465
+ }
2466
+
2467
+ declare interface LayoutSpaceDividerJson extends LayoutEdgeElementBaseJson {
2468
+ type: LayoutSpaceDividerType;
2469
+ parameters?: LayoutSpaceDividerParametersJson;
2470
+ }
2471
+
2472
+ declare interface LayoutSpaceDividerParameters {
2473
+ }
2474
+
2475
+ declare type LayoutSpaceDividerParametersJson = Partial<LayoutSpaceDividerParameters>;
2476
+
2477
+ declare type LayoutSpaceDividerType = typeof LayoutSpaceDividerTypeValue;
2478
+
2479
+ declare const LayoutSpaceDividerTypeValue = "element:spaceDivider";
2480
+
2481
+ declare interface LayoutSpaceGeometry {
2482
+ polygons: Vector2[][];
2483
+ }
2484
+
2485
+ declare interface LayoutSpaceJson extends LayoutNodeBaseJson {
2486
+ type: LayoutSpaceType;
2487
+ boundaries: LayoutBoundaryJson[];
2488
+ attributes?: LayoutSpaceAttributesJson;
2489
+ }
2490
+
2491
+ declare type LayoutSpaceType = typeof LayoutSpaceTypeValue;
2492
+
2493
+ declare const LayoutSpaceTypeValue = "layout:space";
2494
+
2495
+ declare class LayoutSpatialGraph {
2496
+ layout: SpaceGraphLayout;
2497
+ vertices: SpatialGraphVertex[];
2498
+ verticesById: Record<string, SpatialGraphVertex>;
2499
+ edges: SpatialGraphEdge[];
2500
+ edgesById: Record<string, SpatialGraphEdge>;
2501
+ graphChanged: boolean;
2502
+ debugVertexCount: number;
2503
+ debugEdgeCount: number;
2504
+ constructor(layout: SpaceGraphLayout);
2505
+ emit<EventType extends keyof SpaceGraphEventMap>(event: EventType, ...args: SpaceGraphEventMap[EventType]): void;
2506
+ copyForClone(spatialGraph: LayoutSpatialGraph): void;
2507
+ deleteVertexAtIndex(vertexIndex: number, removeNodes: boolean): SpatialGraphVertex | undefined;
2508
+ deleteEdgeAtIndex(edgeIndex: number, removeNodes: boolean): SpatialGraphEdge | undefined;
2509
+ insertVertex(vertex: SpatialGraphVertex): void;
2510
+ removeVertex(vertex: SpatialGraphVertex, removeNodes?: boolean): SpatialGraphVertex | undefined;
2511
+ removeVertexAtIndex(vertexIndex: number, removeNodes?: boolean): SpatialGraphVertex | undefined;
2512
+ removeVertexById(id: string, removeNodes?: boolean): SpatialGraphVertex | undefined;
2513
+ insertEdge(edge: SpatialGraphEdge, splitSpace?: boolean): void;
2514
+ removeEdge(edge: SpatialGraphEdge, removeNodes?: boolean): SpatialGraphEdge | undefined;
2515
+ removeEdgeAtIndex(edgeIndex: number, removeNodes?: boolean): SpatialGraphEdge | undefined;
2516
+ removeEdgeById(id: string, removeNodes?: boolean): SpatialGraphEdge | undefined;
2517
+ getEdgeFromVertices(vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex): SpatialGraphEdge | undefined;
2518
+ getVertexId(prefix?: string): string;
2519
+ getEdgeId(prefix?: string): string;
2520
+ createVertex(id: string, x: number, y: number): SpatialGraphVertex;
2521
+ createEdge(id: string, vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex, splitSpace?: boolean): SpatialGraphEdge;
2522
+ createEdgeByVertexIds(id: string, vertexId1: string, vertexId2: string, splitSpace?: boolean): SpatialGraphEdge;
2523
+ toJSON(): LayoutSpatialGraphJson;
2524
+ }
2525
+
2526
+ declare interface LayoutSpatialGraphJson {
2527
+ vertices: SpatialGraphVertexJson[];
2528
+ edges: SpatialGraphEdgeJson[];
2529
+ }
2530
+
2531
+ declare class LayoutStairFlight extends LayoutTransformElementBase {
2532
+ type: LayoutStairFlightType;
2533
+ parameters: LayoutStairFlightParameters;
2534
+ constructor(id: string);
2535
+ setParameters(parameters: RecursivePartial<LayoutStairFlightParameters>): void;
2536
+ }
2537
+
2538
+ declare interface LayoutStairFlightJson extends LayoutTransformElementBaseJson {
2539
+ type: LayoutStairFlightType;
2540
+ parameters?: LayoutStairFlightParametersJson;
2541
+ }
2542
+
2543
+ declare interface LayoutStairFlightMaterials {
2544
+ steps: SpaceGraphMaterialJson;
2545
+ tread: SpaceGraphMaterialJson;
2546
+ }
2547
+
2548
+ declare type LayoutStairFlightParameters = StraightStairFlightParameters | SpiralStairFlightParameters;
2549
+
2550
+ declare type LayoutStairFlightParametersJson = StraightStairFlightParametersJson | SpiralStairFlightParametersJson;
2551
+
2552
+ declare type LayoutStairFlightType = typeof LayoutStairFlightTypeValue;
2553
+
2554
+ declare const LayoutStairFlightTypeValue = "element:stairFlight";
2555
+
2556
+ declare class LayoutStairs extends LayoutTransformElementBase {
2557
+ type: LayoutStairsType;
2558
+ parameters: LayoutStairsParameters;
2559
+ constructor(id: string);
2560
+ setParameters(parameters: RecursivePartial<LayoutStairsParameters>, skipElementCreation?: boolean): void;
2561
+ calculateBoundingBox(): {
2562
+ min: Vector3;
2563
+ max: Vector3;
2564
+ };
2565
+ }
2566
+
2567
+ declare interface LayoutStairsJson extends LayoutTransformElementBaseJson {
2568
+ type: LayoutStairsType;
2569
+ parameters?: LayoutStairsParametersJson;
2570
+ }
2571
+
2572
+ declare interface LayoutStairsMaterials {
2573
+ steps: SpaceGraphMaterialJson;
2574
+ tread: SpaceGraphMaterialJson;
2575
+ railing: SpaceGraphMaterialJson;
2576
+ }
2577
+
2578
+ declare type LayoutStairsParameters = StraightStairsParameters | OrthogonalStairsParameters | SpiralStairsParameters | CustomStairsParameters;
2579
+
2580
+ declare type LayoutStairsParametersJson = StraightStairsParametersJson | OrthogonalStairsParametersJson | SpiralStairsParametersJson | CustomStairsParametersJson;
2581
+
2582
+ declare type LayoutStairsType = typeof LayoutStairsTypeValue;
2583
+
2584
+ declare const LayoutStairsTypeValue = "element:stairs";
2585
+
2586
+ declare type LayoutTransformElement = LayoutAsset | LayoutBeam | LayoutCasework | LayoutColumn | LayoutDoor | LayoutGeneric | LayoutKitchen | LayoutRailing | LayoutRamp | LayoutRoof | LayoutSlab | LayoutStairs | LayoutStairFlight | LayoutWindow;
2587
+
2588
+ declare class LayoutTransformElementBase extends LayoutElementBase {
2589
+ type: LayoutTransformElementType;
2590
+ parameters: LayoutTransformElementParameters;
2591
+ position: Vector3;
2592
+ rotation: number;
2593
+ rotationAxis: Vector3;
2594
+ constructor(id: string, type: LayoutTransformElementType);
2595
+ copyForClone(transformElement: LayoutTransformElement): void;
2596
+ setPosition(position: Vector3): void;
2597
+ setRotation(rotation: number, rotationAxis?: Vector3): void;
2598
+ setTransform(position: Vector3, rotation: number, rotationAxis?: Vector3): void;
2599
+ getSpaces(): LayoutSpace[];
2600
+ calculateTransform(): Transform3d;
2601
+ calculateWorldTransform(): Transform3d;
2602
+ calculateBoundingBox(): {
2603
+ min: Vector3;
2604
+ max: Vector3;
2605
+ };
2606
+ setParameters(parameters: RecursivePartial<LayoutTransformElementParameters>): void;
2607
+ }
2608
+
2609
+ declare interface LayoutTransformElementBaseJson extends LayoutElementBaseJson {
2610
+ type: LayoutTransformElementType;
2611
+ position: Vector3;
2612
+ rotation?: number;
2613
+ rotationAxis?: Vector3;
2614
+ parameters?: LayoutTransformElementParametersJson;
2615
+ }
2616
+
2617
+ declare type LayoutTransformElementJson = LayoutAssetJson | LayoutBeamJson | LayoutCaseworkJson | LayoutColumnJson | LayoutDoorJson | LayoutGenericJson | LayoutKitchenJson | LayoutRailingJson | LayoutRampJson | LayoutRoofJson | LayoutSlabJson | LayoutStairFlightJson | LayoutStairsJson | LayoutWindowJson;
2618
+
2619
+ declare type LayoutTransformElementParameters = LayoutAssetParameters | LayoutBeamParameters | LayoutCaseworkParameters | LayoutColumnParameters | LayoutDoorParameters | LayoutGenericParameters | LayoutKitchenParameters | LayoutRailingParameters | LayoutRampParameters | LayoutRoofParameters | LayoutSlabParameters | LayoutStairsParameters | LayoutStairFlightParameters | LayoutWindowParameters;
2620
+
2621
+ declare type LayoutTransformElementParametersJson = LayoutBeamParametersJson | LayoutCaseworkParametersJson | LayoutColumnParametersJson | LayoutDoorParametersJson | LayoutGenericParametersJson | LayoutKitchenParametersJson | LayoutRailingParametersJson | LayoutRampParametersJson | LayoutRoofParametersJson | LayoutSlabParametersJson | LayoutStairFlightParametersJson | LayoutStairsParametersJson | LayoutWindowParametersJson;
2622
+
2623
+ declare type LayoutTransformElementType = LayoutAssetType | LayoutBeamType | LayoutCaseworkType | LayoutColumnType | LayoutDoorType | LayoutGenericType | LayoutKitchenType | LayoutRailingType | LayoutRampType | LayoutRoofType | LayoutSlabType | LayoutStairsType | LayoutStairFlightType | LayoutWindowType;
2624
+
2625
+ declare type LayoutType = typeof LayoutTypeValue;
2626
+
2627
+ declare const LayoutTypeValue = "spatialStructure:layout";
2628
+
2629
+ declare class LayoutUpdate extends OperationBase {
2630
+ type: typeof LayoutUpdateTypeValue;
2631
+ value: LayoutUpdateValue;
2632
+ constructor(node: SpaceGraphLayout | string, value: LayoutUpdateValue, previousValue?: LayoutUpdateValue);
2633
+ private setPreviousValue;
2634
+ private update;
2635
+ do(layout: SpaceGraphLayout): void;
2636
+ undo(layout: SpaceGraphLayout): void;
2637
+ }
2638
+
2639
+ declare type LayoutUpdateOperationJson = Pick<LayoutUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<LayoutUpdate, 'previousValue'>>;
2640
+
2641
+ declare const LayoutUpdateTypeValue = "operation:layoutUpdate";
2642
+
2643
+ declare type LayoutUpdateValue = Partial<SpaceGraphNodeWithCustomAttributesBaseJson>;
2644
+
2645
+ declare type LayoutView = Layout2dView | Layout3dView | LayoutViewStyle;
2646
+
2647
+ declare class LayoutViewBase extends LayoutNodeBase {
2648
+ type: LayoutViewType;
2649
+ parameters: LayoutViewParameters;
2650
+ copyForClone(view: LayoutView): void;
2651
+ setParameters(parameters: RecursivePartial<LayoutViewParameters>): void;
2652
+ toJSON(): LayoutViewJson;
2653
+ }
2654
+
2655
+ declare interface LayoutViewBaseJson extends LayoutNodeBaseJson {
2656
+ type: LayoutViewType;
2657
+ parameters?: LayoutViewParametersJson;
2658
+ }
2659
+
2660
+ declare type LayoutViewJson = Layout2dViewJson | Layout3dViewJson | LayoutViewStyleJson;
2661
+
2662
+ declare type LayoutViewParameters = Layout2dViewParameters | Layout3dViewParameters | LayoutViewStyleParameters;
2663
+
2664
+ declare type LayoutViewParametersJson = Layout2dViewParametersJson | Layout3dViewParametersJson | LayoutViewStyleParametersJson;
2665
+
2666
+ declare type LayoutViewsByType = NodesByType<LayoutViewTypeMap>;
2667
+
2668
+ declare class LayoutViewStyle extends LayoutViewBase {
2669
+ type: LayoutViewStyleType;
2670
+ parameters: LayoutViewStyleParameters;
2671
+ constructor(id: string);
2672
+ setParameters(parameters: RecursivePartial<LayoutViewStyleParameters>): void;
2673
+ }
2674
+
2675
+ declare interface LayoutViewStyleJson extends LayoutViewBaseJson {
2676
+ type: LayoutViewStyleType;
2677
+ parameters?: LayoutViewStyleParametersJson;
2678
+ }
2679
+
2680
+ declare interface LayoutViewStyleParameters {
2681
+ labelRules?: LabelRule[];
2682
+ annotations?: string[];
2683
+ }
2684
+
2685
+ declare type LayoutViewStyleParametersJson = LayoutViewStyleParameters;
2686
+
2687
+ declare type LayoutViewStyleType = typeof LayoutViewStyleTypeValue;
2688
+
2689
+ declare const LayoutViewStyleTypeValue = "view:style";
2690
+
2691
+ declare type LayoutViewType = Layout2dViewType | Layout3dViewType | LayoutViewStyleType;
2692
+
2693
+ declare type LayoutViewTypeMap = InstancesOf<typeof layoutViewTypeValues>;
2694
+
2695
+ declare const layoutViewTypeValues: {
2696
+ readonly 'view:2d': typeof Layout2dView;
2697
+ readonly 'view:3d': typeof Layout3dView;
2698
+ readonly 'view:style': typeof LayoutViewStyle;
2699
+ };
2700
+
2701
+ declare class LayoutWall extends LayoutEdgeElementBase {
2702
+ type: LayoutWallType;
2703
+ parameters: LayoutWallParameters;
2704
+ geometryProfile: LayoutWallGeometryProfile;
2705
+ constructor(id: string, edges: SpatialGraphEdge[]);
2706
+ copyForClone(wall: LayoutWall): void;
2707
+ setParameters(parameters: RecursivePartial<LayoutWallParameters>): void;
2708
+ /** Width at normalized position u along the axis (0 = start vertex, 1 = end vertex) */
2709
+ getWidthAt(u: number): number;
2710
+ /** Offset at normalized position u along the axis (0 = start vertex, 1 = end vertex) */
2711
+ getOffsetAt(u: number): number;
2712
+ insertElement(element: LayoutElement): void;
2713
+ removeElement(element: LayoutElement): void;
2714
+ calculateBoundingBox(): BoundingBox3d;
2715
+ }
2716
+
2717
+ declare interface LayoutWallGeometryProfile {
2718
+ valid: boolean;
2719
+ skipped: boolean;
2720
+ selfIntersecting: boolean;
2721
+ sidePoints1: Vector2[];
2722
+ sidePoints2: Vector2[];
2723
+ joinPoints1: Vector2[];
2724
+ joinPoints2: Vector2[];
2725
+ points: Vector2[];
2726
+ }
2727
+
2728
+ declare interface LayoutWallJson extends LayoutEdgeElementBaseJson {
2729
+ type: LayoutWallType;
2730
+ parameters?: LayoutWallParametersJson;
2731
+ }
2732
+
2733
+ declare interface LayoutWallMaterials {
2734
+ top: SpaceGraphMaterialJson;
2735
+ bottom: SpaceGraphMaterialJson;
2736
+ side1: SpaceGraphMaterialJson;
2737
+ side2: SpaceGraphMaterialJson;
2738
+ join1: SpaceGraphMaterialJson;
2739
+ join2: SpaceGraphMaterialJson;
2740
+ }
2741
+
2742
+ declare interface LayoutWallParameters {
2743
+ /**
2744
+ * Width at the start vertex, and the uniform width when widthEnd is absent
2745
+ * @minimum 0.01
2746
+ */
2747
+ width: number;
2748
+ /**
2749
+ * Width at the end vertex — the wall tapers linearly from width to widthEnd along the axis
2750
+ * @minimum 0.01
2751
+ */
2752
+ widthEnd?: number;
2753
+ /** @minimum 0.01 */
2754
+ height: number;
2755
+ /** Lateral shift of the wall body relative to the axis, at the start vertex */
2756
+ offset: number;
2757
+ /** Offset at the end vertex — interpolates linearly from offset along the axis */
2758
+ offsetEnd?: number;
2759
+ elevation: number;
2760
+ materials: LayoutWallMaterials;
2761
+ }
2762
+
2763
+ declare type LayoutWallParametersJson = Partial<LayoutWallParameters>;
2764
+
2765
+ declare type LayoutWallType = typeof LayoutWallTypeValue;
2766
+
2767
+ declare const LayoutWallTypeValue = "element:wall";
2768
+
2769
+ declare class LayoutWindow extends LayoutTransformElementBase {
2770
+ type: LayoutWindowType;
2771
+ parent: LayoutOpening | null;
2772
+ parameters: LayoutWindowParameters;
2773
+ constructor(id: string);
2774
+ setParameters(parameters: RecursivePartial<LayoutWindowParameters>): void;
2775
+ }
2776
+
2777
+ declare interface LayoutWindowJson extends LayoutTransformElementBaseJson {
2778
+ type: LayoutWindowType;
2779
+ parameters?: LayoutWindowParametersJson;
2780
+ }
2781
+
2782
+ declare interface LayoutWindowMaterials {
2783
+ frame: SpaceGraphMaterialJson;
2784
+ panel: SpaceGraphMaterialJson;
2785
+ }
2786
+
2787
+ declare type LayoutWindowParameters = DimensionParameters_3 & CommonParameters_7;
2788
+
2789
+ declare type LayoutWindowParametersJson = DimensionParameters_3 & Partial<CommonParameters_7>;
2790
+
2791
+ declare type LayoutWindowType = typeof LayoutWindowTypeValue;
2792
+
2793
+ declare const LayoutWindowTypeValue = "element:window";
2794
+
2795
+ declare interface LineCurve extends CurveBase {
2796
+ type: LineCurveType;
2797
+ start: Vector2;
2798
+ end: Vector2;
2799
+ }
2800
+
2801
+ declare type LineCurveType = typeof LineCurveTypeValue;
2802
+
2803
+ declare const LineCurveTypeValue = "curve:line";
2804
+
2805
+ declare class MaterialCreate extends OperationBase {
2806
+ type: typeof MaterialCreateTypeValue;
2807
+ value: SpaceGraphMaterialResourceJson;
2808
+ constructor(value: SpaceGraphMaterialResourceJson);
2809
+ do(layout: SpaceGraphLayout): void;
2810
+ undo(layout: SpaceGraphLayout): void;
2811
+ }
2812
+
2813
+ declare type MaterialCreateOperationJson = Pick<MaterialCreate, 'type' | 'value'>;
2814
+
2815
+ declare const MaterialCreateTypeValue: "operation:materialCreate";
2816
+
2817
+ declare class MaterialRemove extends OperationBase {
2818
+ type: typeof MaterialRemoveTypeValue;
2819
+ previousValue: SpaceGraphMaterialResourceJson;
2820
+ constructor(node: SpaceGraphMaterial | string, previousValue?: SpaceGraphMaterialResourceJson);
2821
+ do(layout: SpaceGraphLayout): void;
2822
+ undo(layout: SpaceGraphLayout): void;
2823
+ }
2824
+
2825
+ declare type MaterialRemoveOperationJson = Pick<MaterialRemove, 'nodeId' | 'type'> & Partial<Pick<MaterialRemove, 'previousValue'>>;
2826
+
2827
+ declare const MaterialRemoveTypeValue: "operation:materialRemove";
2828
+
2829
+ declare class MaterialUpdate extends OperationBase {
2830
+ type: typeof MaterialUpdateTypeValue;
2831
+ value: MaterialUpdateValue;
2832
+ previousValue: MaterialUpdateValue;
2833
+ constructor(node: SpaceGraphMaterial | string, value: MaterialUpdateValue, previousValue?: MaterialUpdateValue);
2834
+ private setPreviousValue;
2835
+ do(layout: SpaceGraphLayout): void;
2836
+ undo(layout: SpaceGraphLayout): void;
2837
+ private updateMaterial;
2838
+ private updateBasicMaterial;
2839
+ private updateColorMaterial;
2840
+ private updateStandardMaterial;
2841
+ }
2842
+
2843
+ declare type MaterialUpdateOperationJson = Pick<MaterialUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<MaterialUpdate, 'previousValue'>>;
2844
+
2845
+ declare const MaterialUpdateTypeValue: "operation:materialUpdate";
2846
+
2847
+ declare type MaterialUpdateValue = Partial<SpaceGraphMaterialResourceJson>;
2848
+
2849
+ declare class MeshGeometry extends GeometryBase {
2850
+ type: MeshGeometryType;
2851
+ vertices: number[];
2852
+ indices: number[];
2853
+ normals: ParametricNormals | number[];
2854
+ uvs: ParametricUvs | number[];
2855
+ constructor(id: string);
2856
+ }
2857
+
2858
+ declare interface MeshGeometryJson extends GeometryBaseJson {
2859
+ type: MeshGeometryType;
2860
+ vertices: number[];
2861
+ indices: number[];
2862
+ normals?: ParametricNormals | number[];
2863
+ uvs?: ParametricUvs | number[];
2864
+ }
2865
+
2866
+ declare type MeshGeometryType = typeof MeshGeometryTypeValue;
2867
+
2868
+ declare const MeshGeometryTypeValue = "geometry:mesh";
2869
+
2870
+ declare type NodeConstructorMap = Record<string, abstract new (...args: any) => any>;
2871
+
2872
+ declare type NodeInstanceMap = Record<string, object>;
2873
+
2874
+ declare type NodeLabel = {
2875
+ display: 'customId'[];
2876
+ fontSize?: number;
2877
+ text?: Rgb;
2878
+ textOutline?: boolean;
2879
+ /** Only render the label when zoom is within [min, max]. */
2880
+ visible?: ZoomRange;
2881
+ /**
2882
+ * Controls fixed screen size (1/zoom) scaling:
2883
+ * - `false`: render at world scale
2884
+ * - `true` or omitted: always apply 1/zoom scaling
2885
+ * - `[min, max]`: apply 1/zoom scaling within the zoom range; outside it, clamp to the scale at the boundary (1/min or 1/max) to avoid jumps
2886
+ */
2887
+ fixedScreenSize?: boolean | ZoomRange;
2888
+ };
2889
+
2890
+ /**
2891
+ * A persisted node query. The explicit target tells consumers whether to
2892
+ * resolve the filter with queryElements or querySpaces
2893
+ */
2894
+ declare type NodeQuery = {
2895
+ target: 'elements';
2896
+ where: ElementFilter;
2897
+ } | {
2898
+ target: 'spaces';
2899
+ where: SpaceFilter;
2900
+ };
2901
+
2902
+ declare type NodeResult = {
2903
+ id: string;
2904
+ type: string;
2905
+ };
2906
+
2907
+ declare type NodesByType<NodeMap extends NodeInstanceMap> = {
2908
+ -readonly [Key in keyof NodeMap]: NodeMap[Key][];
2909
+ };
2910
+
2911
+ declare type NullComparator = {
2912
+ null: boolean;
2913
+ };
2914
+
2915
+ /** Operators apply conjunctively, so one lower and one upper bound combine into a bounded range */
2916
+ declare type NumberComparator = number | {
2917
+ eq: number;
2918
+ } | {
2919
+ neq: number;
2920
+ } | {
2921
+ in: number[];
2922
+ } | {
2923
+ nin: number[];
2924
+ } | {
2925
+ gt: number;
2926
+ } | {
2927
+ gte: number;
2928
+ } | {
2929
+ lt: number;
2930
+ } | {
2931
+ lte: number;
2932
+ } | {
2933
+ gt: number;
2934
+ lt: number;
2935
+ } | {
2936
+ gt: number;
2937
+ lte: number;
2938
+ } | {
2939
+ gte: number;
2940
+ lt: number;
2941
+ } | {
2942
+ gte: number;
2943
+ lte: number;
2944
+ };
2945
+
2946
+ declare interface NumberField extends BaseField {
2947
+ type: 'number';
2948
+ min: number;
2949
+ max: number;
2950
+ step: number;
2951
+ default?: number;
2952
+ }
2953
+
2954
+ declare interface NumberList extends SpaceGraphTypedValueJson {
2955
+ type: 'number:list';
2956
+ list: number[];
2957
+ }
2958
+
2959
+ declare interface NumberRange extends SpaceGraphTypedValueJson {
2960
+ type: 'number:range';
2961
+ range: {
2962
+ start: number;
2963
+ step: number;
2964
+ count: number;
2965
+ };
2966
+ }
2967
+
2968
+ declare type OpenCurve = LineCurve | PolylineCurve | ArcCurve | BezierCurve;
2969
+
2970
+ declare type OpenCurveType = LineCurveType | PolylineCurveType | ArcCurveType | BezierCurveType;
2971
+
2972
+ declare class OperationBase {
2973
+ /** @format uuid */
2974
+ nodeId: string;
2975
+ type: string;
2976
+ value: any;
2977
+ previousValue: any;
2978
+ constructor(operationType: string, nodeId: string, value: any, previousValue: any);
2979
+ do(layout: SpaceGraphLayout): void;
2980
+ undo(layout: SpaceGraphLayout): void;
2981
+ }
2982
+
2983
+ /**
2984
+ * @discriminator type
2985
+ */
2986
+ declare type OperationJson = VertexCreateOperationJson | EdgeCreateOperationJson | SpaceCreateOperationJson | ElementCreateOperationJson | AnnotationCreateOperationJson | ViewCreateOperationJson | ProductCreateOperationJson | RelationCreateOperationJson | MaterialCreateOperationJson | CustomAttributeCreateOperationJson | VertexRemoveOperationJson | VertexUpdateOperationJson | VertexReplaceOperationJson | EdgeConnectOperationJson | EdgeRemoveOperationJson | EdgeReplaceOperationJson | EdgeMergeOperationJson | EdgeSplitOperationJson | EdgeUpdateOperationJson | SpaceUpdateOperationJson | SpaceRemoveOperationJson | ElementUpdateOperationJson | ElementRemoveOperationJson | AnnotationUpdateOperationJson | AnnotationRemoveOperationJson | ViewUpdateOperationJson | ViewRemoveOperationJson | ProductUpdateOperationJson | ProductRemoveOperationJson | RelationUpdateOperationJson | RelationRemoveOperationJson | RelationInsertNodesOperationJson | RelationRemoveNodesOperationJson | MaterialUpdateOperationJson | MaterialRemoveOperationJson | LayoutUpdateOperationJson | CustomAttributeUpdateOperationJson | CustomAttributeRemoveOperationJson;
2987
+
2988
+ declare type OperationsResult = {
2989
+ created: NodeResult[];
2990
+ removed: NodeResult[];
2991
+ updated: NodeResult[];
2992
+ errors: string[];
2993
+ };
2994
+
2995
+ declare type OperationsResult_2 = Awaited<ReturnType<HostApi['runOperations']>>;
2996
+
2997
+ declare type OrthogonalStairsParameters = {
2998
+ stairsType: OrthogonalStairsType;
2999
+ /** @minimum 0.01 */
3000
+ stepWidth: number;
3001
+ circulation: 'left' | 'right';
3002
+ } & DimensionParameters & CommonStairsParameters;
3003
+
3004
+ declare type OrthogonalStairsParametersJson = Partial<OrthogonalStairsParameters>;
3005
+
3006
+ declare type OrthogonalStairsType = 'halfLanding' | 'quarterLanding' | 'twoQuarterLanding' | 'winder' | 'doubleWinder';
3007
+
3008
+ declare type ParametricGeometry = PlaneGeometry | CuboidGeometry | SphereGeometry | ExtrusionGeometry;
3009
+
3010
+ declare class ParametricGeometryBase extends GeometryBase {
3011
+ normals: ParametricNormals | 'generator';
3012
+ uvs: ParametricUvs | 'generator';
3013
+ geometries: GeometryOperation[];
3014
+ constructor(id: string, type: ParametricGeometryType);
3015
+ }
3016
+
3017
+ declare interface ParametricGeometryBaseJson extends GeometryBaseJson {
3018
+ normals?: ParametricNormals | 'generator';
3019
+ uvs?: ParametricUvs | 'generator';
3020
+ geometries?: GeometryOperationJson[];
3021
+ }
3022
+
3023
+ declare type ParametricGeometryJson = PlaneGeometryJson | CuboidGeometryJson | SphereGeometryJson | ExtrusionGeometryJson;
3024
+
3025
+ declare type ParametricGeometryType = PlaneGeometryType | CuboidGeometryType | SphereGeometryType | ExtrusionGeometryType;
3026
+
3027
+ declare type ParametricNormals = 'none' | 'flat' | 'smooth';
3028
+
3029
+ declare type ParametricUvs = 'none' | 'automatic' | 'spherical';
3030
+
3031
+ declare interface Plane {
3032
+ position: Vector3;
3033
+ normal: Vector3;
3034
+ }
3035
+
3036
+ declare class PlaneGeometry extends ParametricGeometryBase {
3037
+ type: PlaneGeometryType;
3038
+ normal: Vector3;
3039
+ size: number;
3040
+ doubleSided: boolean;
3041
+ constructor(id: string);
3042
+ }
3043
+
3044
+ declare interface PlaneGeometryJson extends ParametricGeometryBaseJson {
3045
+ type: PlaneGeometryType;
3046
+ normal: Vector3;
3047
+ size: number;
3048
+ doubleSided: boolean;
3049
+ }
3050
+
3051
+ declare type PlaneGeometryType = typeof PlaneGeometryTypeValue;
3052
+
3053
+ declare const PlaneGeometryTypeValue = "geometry:plane";
3054
+
3055
+ declare type Polygon = Vector2[];
3056
+
3057
+ declare interface PolygonCurve extends CurveBase {
3058
+ type: PolygonCurveType;
3059
+ points: Vector2[];
3060
+ }
3061
+
3062
+ declare type PolygonCurveType = typeof PolygonCurveTypeValue;
3063
+
3064
+ declare const PolygonCurveTypeValue = "curve:polygon";
3065
+
3066
+ declare type PolygonWithHoles = Vector2[][];
3067
+
3068
+ declare interface PolygonWithHolesCurve extends CurveBase {
3069
+ type: PolygonWithHolesCurveType;
3070
+ polygons: Vector2[][];
3071
+ }
3072
+
3073
+ declare type PolygonWithHolesCurveType = typeof PolygonWithHolesCurveTypeValue;
3074
+
3075
+ declare const PolygonWithHolesCurveTypeValue = "curve:polygonWithHoles";
3076
+
3077
+ declare interface PolylineCurve extends CurveBase {
3078
+ type: PolylineCurveType;
3079
+ points: Vector2[];
3080
+ }
3081
+
3082
+ declare type PolylineCurveType = typeof PolylineCurveTypeValue;
3083
+
3084
+ declare const PolylineCurveTypeValue = "curve:polyline";
3085
+
3086
+ declare type PositionEntry = Vector3 | Vector3List | Vector3Range;
3087
+
3088
+ declare type PositionValue = {
3089
+ position: Vector2;
3090
+ };
3091
+
3092
+ declare class ProductCreate extends OperationBase {
3093
+ type: typeof ProductCreateTypeValue;
3094
+ value: ProductCreateValue;
3095
+ constructor(value: ProductCreateValue);
3096
+ do(layout: SpaceGraphLayout): void;
3097
+ undo(layout: SpaceGraphLayout): void;
3098
+ }
3099
+
3100
+ declare type ProductCreateOperationJson = Pick<ProductCreate, 'type' | 'value'>;
3101
+
3102
+ declare const ProductCreateTypeValue: "operation:productCreate";
3103
+
3104
+ declare type ProductCreateValue = SpaceGraphProductJson;
3105
+
3106
+ declare interface ProductData extends BaseData {
3107
+ type: SpaceGraphProduct['type'];
3108
+ category: string;
3109
+ subCategory: string;
3110
+ seatCapacity: number;
3111
+ }
3112
+
3113
+ declare interface ProductFilter extends BaseNodeFilter {
3114
+ category?: StringComparator;
3115
+ subCategory?: StringComparator;
3116
+ seatCapacity?: NumberComparator;
3117
+ }
3118
+
3119
+ declare class ProductRemove extends OperationBase {
3120
+ type: typeof ProductRemoveTypeValue;
3121
+ value: ProductRemoveValue;
3122
+ previousValue: ProductRemoveValue;
3123
+ constructor(node: SpaceGraphProduct | string, previousValue?: ProductRemoveValue);
3124
+ do(layout: SpaceGraphLayout): void;
3125
+ undo(layout: SpaceGraphLayout): void;
3126
+ }
3127
+
3128
+ declare type ProductRemoveOperationJson = Pick<ProductRemove, 'nodeId' | 'type'> & Partial<Pick<ProductRemove, 'previousValue'>>;
3129
+
3130
+ declare const ProductRemoveTypeValue: "operation:productRemove";
3131
+
3132
+ declare type ProductRemoveValue = SpaceGraphProductJson;
3133
+
3134
+ declare interface ProductSelect extends BaseSelect {
3135
+ category?: boolean;
3136
+ subCategory?: boolean;
3137
+ seatCapacity?: boolean;
3138
+ }
3139
+
3140
+ declare class ProductUpdate extends OperationBase {
3141
+ type: typeof ProductUpdateTypeValue;
3142
+ value: ProductUpdateValue;
3143
+ constructor(node: SpaceGraphProduct | string, value: ProductUpdateValue, previousValue?: ProductUpdateValue);
3144
+ private setPreviousValue;
3145
+ do(layout: SpaceGraphLayout): void;
3146
+ undo(layout: SpaceGraphLayout): void;
3147
+ }
3148
+
3149
+ declare type ProductUpdateOperationJson = Pick<ProductUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<ProductUpdate, 'previousValue'>>;
3150
+
3151
+ declare const ProductUpdateTypeValue: "operation:productUpdate";
3152
+
3153
+ declare type ProductUpdateValue = Partial<SpaceGraphProductJson>;
3154
+
3155
+ declare interface PromptArgs extends ConfirmArgs {
3156
+ fields: PromptFieldSet;
3157
+ }
3158
+
3159
+ declare type PromptField = TextField | BooleanField | SelectField | NumberField;
3160
+
3161
+ declare type PromptFieldSet = Record<string, PromptField>;
3162
+
3163
+ declare type QueryPick<T, S> = {
3164
+ [K in keyof S as S[K] extends false | undefined ? never : K]: K extends keyof T ? S[K] extends true ? T[K] : S[K] extends ElementQuery ? QueryPick<ElementData, S[K]['select'] extends undefined ? DefaultSelect : NonNullable<S[K]['select']>>[] : S[K] extends object ? T[K] extends any[] ? QueryPick<T[K][number], S[K]>[] : QueryPick<T[K], S[K]> : never : never;
3165
+ };
3166
+
3167
+ declare interface RectangleCurve extends CurveBase {
3168
+ type: RectangleCurveType;
3169
+ position?: Vector2;
3170
+ dimensions: Vector2;
3171
+ }
3172
+
3173
+ declare type RectangleCurveType = typeof RectangleCurveTypeValue;
3174
+
3175
+ declare const RectangleCurveTypeValue = "curve:rectangle";
3176
+
3177
+ declare type RecursivePartial<T> = T extends Array<any> ? {
3178
+ [K in keyof T]: RecursivePartial<T[K]>;
3179
+ } : T extends object ? {
3180
+ [P in keyof T]?: RecursivePartial<T[P]>;
3181
+ } : T;
3182
+
3183
+ declare class RelationCreate extends OperationBase {
3184
+ type: typeof RelationCreateTypeValue;
3185
+ value: SpaceGraphRelationJson;
3186
+ constructor(value: SpaceGraphRelationJson);
3187
+ do(layout: SpaceGraphLayout): void;
3188
+ undo(layout: SpaceGraphLayout): void;
3189
+ }
3190
+
3191
+ declare type RelationCreateOperationJson = Pick<RelationCreate, 'type' | 'value'>;
3192
+
3193
+ declare const RelationCreateTypeValue: "operation:relationCreate";
3194
+
3195
+ declare class RelationInsertNodes extends OperationBase {
3196
+ type: typeof RelationInsertNodesTypeValue;
3197
+ value: RelationInsertNodesValue;
3198
+ constructor(node: SpaceGraphRelation | string, value: RelationInsertNodesValue);
3199
+ do(layout: SpaceGraphLayout): void;
3200
+ undo(layout: SpaceGraphLayout): void;
3201
+ }
3202
+
3203
+ declare type RelationInsertNodesOperationJson = Pick<RelationInsertNodes, 'nodeId' | 'type' | 'value'>;
3204
+
3205
+ declare const RelationInsertNodesTypeValue: "operation:relationInsertNodes";
3206
+
3207
+ declare type RelationInsertNodesValue = string[];
3208
+
3209
+ declare class RelationRemove extends OperationBase {
3210
+ type: typeof RelationRemoveTypeValue;
3211
+ previousValue: SpaceGraphRelationJson;
3212
+ constructor(node: SpaceGraphRelation | string, previousValue?: SpaceGraphRelationJson);
3213
+ do(layout: SpaceGraphLayout): void;
3214
+ undo(layout: SpaceGraphLayout): void;
3215
+ }
3216
+
3217
+ declare class RelationRemoveNodes extends OperationBase {
3218
+ type: typeof RelationRemoveNodesTypeValue;
3219
+ value: RelationRemoveNodesValue;
3220
+ constructor(node: SpaceGraphRelation | string, value: RelationRemoveNodesValue);
3221
+ do(layout: SpaceGraphLayout): void;
3222
+ undo(layout: SpaceGraphLayout): void;
3223
+ }
3224
+
3225
+ declare type RelationRemoveNodesOperationJson = Pick<RelationRemoveNodes, 'nodeId' | 'type' | 'value'>;
3226
+
3227
+ declare const RelationRemoveNodesTypeValue: "operation:relationRemoveNodes";
3228
+
3229
+ declare type RelationRemoveNodesValue = string[];
3230
+
3231
+ declare type RelationRemoveOperationJson = Pick<RelationRemove, 'nodeId' | 'type'> & Partial<Pick<RelationRemove, 'previousValue'>>;
3232
+
3233
+ declare const RelationRemoveTypeValue: "operation:relationRemove";
3234
+
3235
+ declare class RelationUpdate extends OperationBase {
3236
+ type: typeof RelationUpdateTypeValue;
3237
+ value: RelationUpdateValue;
3238
+ previousValue: RelationUpdateValue;
3239
+ constructor(node: SpaceGraphRelation | string, value: RelationUpdateValue, previousValue?: RelationUpdateValue);
3240
+ private setPreviousValue;
3241
+ private update;
3242
+ do(layout: SpaceGraphLayout): void;
3243
+ undo(layout: SpaceGraphLayout): void;
3244
+ }
3245
+
3246
+ declare type RelationUpdateOperationJson = Pick<RelationUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<RelationUpdate, 'previousValue'>>;
3247
+
3248
+ declare const RelationUpdateTypeValue: "operation:relationUpdate";
3249
+
3250
+ declare type RelationUpdateValue = Omit<Partial<SpaceGraphRelationJson>, 'type'>;
3251
+
3252
+ declare type Rgb = [number, number, number];
3253
+
3254
+ declare type RgbA = [number, number, number, number];
3255
+
3256
+ declare type RotationEntry = number | NumberList | NumberRange;
3257
+
3258
+ declare interface SelectField extends BaseField {
3259
+ type: 'select';
3260
+ options?: SelectOption[] | string[];
3261
+ }
3262
+
3263
+ declare interface SelectOption {
3264
+ value: string;
3265
+ label: string;
3266
+ }
3267
+
3268
+ declare type Shape = CurveShape | TextShape | GroupShape | IconShape;
3269
+
3270
+ declare type Shape_2 = CurveShape | TextShape | GroupShape_2;
3271
+
3272
+ declare interface ShapeStyle {
3273
+ stroke?: string | number | number[];
3274
+ strokeWidth?: number | 'native';
3275
+ strokeOpacity?: number;
3276
+ fill?: string | number | number[] | false;
3277
+ fillOpacity?: number;
3278
+ dash?: boolean;
3279
+ alignment?: 0 | 0.5 | 1;
3280
+ }
3281
+
3282
+ declare type SimpleTransform3d = {
3283
+ position: Vector3;
3284
+ rotation: number;
3285
+ };
3286
+
3287
+ declare class SpaceCreate extends OperationBase {
3288
+ type: typeof SpaceCreateTypeValue;
3289
+ value: SpaceCreateValue;
3290
+ constructor(value: SpaceCreateValue);
3291
+ do(layout: SpaceGraphLayout): void;
3292
+ undo(layout: SpaceGraphLayout): void;
3293
+ }
3294
+
3295
+ declare type SpaceCreateOperationJson = Pick<SpaceCreate, 'type' | 'value'>;
3296
+
3297
+ declare const SpaceCreateTypeValue: "operation:spaceCreate";
3298
+
3299
+ declare type SpaceCreateValue = LayoutSpaceJson;
3300
+
3301
+ declare interface SpaceData extends BaseData {
3302
+ type: LayoutSpaceJson['type'];
3303
+ isExternal: boolean;
3304
+ category: string;
3305
+ subCategory: string;
3306
+ seatCapacity: number;
3307
+ area: number;
3308
+ elements: ElementData[];
3309
+ boundaries: BoundaryData[];
3310
+ }
3311
+
3312
+ declare interface SpaceFilter extends BaseNodeFilter {
3313
+ category?: StringComparator;
3314
+ subCategory?: StringComparator;
3315
+ seatCapacity?: NumberComparator;
3316
+ isExternal?: BooleanComparator;
3317
+ area?: NumberComparator;
3318
+ /** point query */
3319
+ at?: Vector2;
3320
+ /** 2d bounding box intersection */
3321
+ within?: {
3322
+ min: Vector2;
3323
+ max: Vector2;
3324
+ };
3325
+ }
3326
+
3327
+ declare class SpaceGraph {
3328
+ spatialStructure: SpaceGraphSpatialStructure;
3329
+ products: SpaceGraphProduct[];
3330
+ productsById: Record<string, SpaceGraphProduct>;
3331
+ productsByType: SpaceGraphProductsByType;
3332
+ customAttributes: SpaceGraphCustomAttribute[];
3333
+ customAttributesById: Record<string, SpaceGraphCustomAttribute>;
3334
+ customAttributesByType: SpaceGraphCustomAttributesByType;
3335
+ geometries: SpaceGraphGeometryJson[];
3336
+ geometriesById: Record<string, SpaceGraphGeometryJson>;
3337
+ geometriesByType: SpaceGraphGeometriesByType;
3338
+ materials: SpaceGraphMaterial[];
3339
+ materialsById: Record<string, SpaceGraphMaterial>;
3340
+ materialsByType: SpaceGraphMaterialsByType;
3341
+ relations: SpaceGraphRelation[];
3342
+ relationsById: Record<string, SpaceGraphRelation>;
3343
+ relationsByType: SpaceGraphRelationsByType;
3344
+ nodes: SpaceGraphNode[];
3345
+ nodesById: Record<string, SpaceGraphNode>;
3346
+ nodesByType: SpaceGraphNodesByType;
3347
+ sourceSchemaVersion: string | undefined;
3348
+ private emitter;
3349
+ constructor(sourceSchemaVersion?: string);
3350
+ getEvents(): Record<string, Function>;
3351
+ copyEvents(spaceGraph: SpaceGraph): void;
3352
+ deleteNodeAtIndex(nodeIndex: number, nodes: SpaceGraphNode[], nodesById: Record<string, SpaceGraphNode>, nodesByType: NodesByType<Record<string, SpaceGraphNode>>): SpaceGraphNode | undefined;
3353
+ insertNode(node: SpaceGraphNode, nodes: SpaceGraphNode[], nodesById: Record<string, SpaceGraphNode>, nodesByType: NodesByType<Record<string, SpaceGraphNode>>): void;
3354
+ removeNode(node: SpaceGraphNode, nodes: SpaceGraphNode[], nodesById: Record<string, SpaceGraphNode>, nodesByType: NodesByType<Record<string, SpaceGraphNode>>): SpaceGraphNode | undefined;
3355
+ /**
3356
+ * Look up a node by ID, optionally narrowing to a type. Passing a type both narrows the
3357
+ * return type and rejects a node of a different type, so it doubles as a check.
3358
+ */
3359
+ getNodeById<T extends SpaceGraphNodeType>(id: string, type: T): SpaceGraphNodeTypeMap[T] | undefined;
3360
+ getNodeById(id: string): SpaceGraphNode | undefined;
3361
+ registerNode(node: SpaceGraphNode): void;
3362
+ unregisterNode(node: SpaceGraphNode): void;
3363
+ insertSpatialStructure(spatialStructure: SpaceGraphSpatialStructure): void;
3364
+ removeSpatialStructure(): SpaceGraphSpatialStructure | undefined;
3365
+ insertProduct(product: SpaceGraphProduct): void;
3366
+ removeProduct(product: SpaceGraphProduct): void;
3367
+ createProduct(id: string, type: SpaceGraphProductType): SpaceGraphProduct;
3368
+ insertGeometry(geometryJson: SpaceGraphGeometryJson): void;
3369
+ removeGeometry(geometryJson: SpaceGraphGeometryJson): void;
3370
+ insertMaterial(material: SpaceGraphMaterial): void;
3371
+ removeMaterial(material: SpaceGraphMaterial): void;
3372
+ createMaterial(type: SpaceGraphColorMaterialType, id: string, color: Rgb, opacity: number): SpaceGraphColorMaterial;
3373
+ createMaterial(type: SpaceGraphStandardMaterialType, id: string, reference: string): SpaceGraphStandardMaterial;
3374
+ createMaterial(type: SpaceGraphEmbeddedMaterialType, id: string, reference: string, format: SpaceGraphEmbeddedMaterialFormat): SpaceGraphEmbeddedMaterial;
3375
+ createMaterial(type: SpaceGraphBasicMaterialType, id: string): SpaceGraphBasicMaterial;
3376
+ insertRelation(relation: SpaceGraphRelation): void;
3377
+ removeRelation(relation: SpaceGraphRelation): void;
3378
+ createRelation(type: SpaceGraphRelationType, id: string): SpaceGraphRelation;
3379
+ insertCustomAttribute(customAttribute: SpaceGraphCustomAttribute): void;
3380
+ removeCustomAttribute(customAttribute: SpaceGraphCustomAttribute): void;
3381
+ getId(): string;
3382
+ emit<EventType extends keyof SpaceGraphEventMap>(event: EventType, ...args: SpaceGraphEventMap[EventType]): void;
3383
+ on<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler: (...args: SpaceGraphEventMap[EventType]) => void, context?: any): void;
3384
+ once<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler: (...args: SpaceGraphEventMap[EventType]) => void, context?: any): void;
3385
+ off<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler?: (...args: SpaceGraphEventMap[EventType]) => void): void;
3386
+ toJSON(): SpaceGraphJson;
3387
+ static fromJSON(spaceGraphJson: SpaceGraphJson): SpaceGraph;
3388
+ }
3389
+
3390
+ declare class SpaceGraphBasicMaterial extends SpaceGraphNodeBase {
3391
+ type: SpaceGraphBasicMaterialType;
3392
+ colorDiffuse: Rgb;
3393
+ colorSpecular: Rgb;
3394
+ specularCoefficient: number;
3395
+ opacity: number;
3396
+ textureDiffuse?: Texture;
3397
+ textureSpecular?: Texture;
3398
+ textureNormal?: Texture;
3399
+ textureAlpha?: Texture;
3400
+ dimensions?: [number, number];
3401
+ constructor(id: string);
3402
+ copyForClone(material: SpaceGraphBasicMaterial): void;
3403
+ toJSON(): SpaceGraphMaterialResourceJson;
3404
+ }
3405
+
3406
+ declare interface SpaceGraphBasicMaterialJson extends SpaceGraphMaterialBaseJson {
3407
+ type: SpaceGraphBasicMaterialType;
3408
+ colorDiffuse: Rgb;
3409
+ colorSpecular?: Rgb;
3410
+ specularCoefficient?: number;
3411
+ opacity?: number;
3412
+ textureDiffuse?: Texture;
3413
+ textureSpecular?: Texture;
3414
+ textureNormal?: Texture;
3415
+ textureAlpha?: Texture;
3416
+ dimensions?: [number, number];
3417
+ }
3418
+
3419
+ declare type SpaceGraphBasicMaterialType = typeof SpaceGraphBasicMaterialTypeValue;
3420
+
3421
+ declare const SpaceGraphBasicMaterialTypeValue = "material:basic";
3422
+
3423
+ declare class SpaceGraphBuilding extends SpaceGraphSpatialStructureBase {
3424
+ type: SpaceGraphBuildingType;
3425
+ location: SpaceGraphLocation;
3426
+ floors: SpaceGraphFloor[];
3427
+ /** multiple floors can be on the same level */
3428
+ floorsByLevel: Record<string, SpaceGraphFloor[]>;
3429
+ constructor(id: string);
3430
+ copyForClone(building: SpaceGraphBuilding): void;
3431
+ /**
3432
+ * returns levels sorted by the vertical position of the first floor with that level
3433
+ */
3434
+ getLevelOrder(): string[];
3435
+ insertFloor(floor: SpaceGraphFloor): void;
3436
+ removeFloor(floor: SpaceGraphFloor): void;
3437
+ createFloor(id: string): SpaceGraphFloor;
3438
+ toJSON(): SpaceGraphBuildingJson;
3439
+ static fromJSON(buildingJson: SpaceGraphBuildingJson, options: {
3440
+ spaceGraph: SpaceGraph;
3441
+ skipInsert?: boolean;
3442
+ }): SpaceGraphBuilding;
3443
+ }
3444
+
3445
+ declare interface SpaceGraphBuildingJson extends SpaceGraphSpatialStructureBaseJson {
3446
+ type: SpaceGraphBuildingType;
3447
+ location?: SpaceGraphLocation;
3448
+ floors: SpaceGraphFloorJson[];
3449
+ }
3450
+
3451
+ declare type SpaceGraphBuildingType = typeof SpaceGraphBuildingTypeValue;
3452
+
3453
+ declare const SpaceGraphBuildingTypeValue = "spatialStructure:building";
3454
+
3455
+ declare class SpaceGraphColorMaterial extends SpaceGraphNodeBase {
3456
+ type: SpaceGraphColorMaterialType;
3457
+ color: Rgb;
3458
+ opacity: number;
3459
+ constructor(id: string, color?: Rgb, opacity?: number);
3460
+ toJSON(): SpaceGraphMaterialResourceJson;
3461
+ }
3462
+
3463
+ declare interface SpaceGraphColorMaterialJson extends SpaceGraphMaterialBaseJson {
3464
+ type: SpaceGraphColorMaterialType;
3465
+ value: Rgb | RgbA | string;
3466
+ }
3467
+
3468
+ declare type SpaceGraphColorMaterialType = typeof SpaceGraphColorMaterialTypeValue;
3469
+
3470
+ declare const SpaceGraphColorMaterialTypeValue = "material:color";
3471
+
3472
+ declare class SpaceGraphCustomAttribute extends SpaceGraphNodeBase {
3473
+ type: SpaceGraphCustomAttributeType;
3474
+ attributes: SpaceGraphCustomAttributeAttributes;
3475
+ constructor(id: string, attributesJson?: SpaceGraphCustomAttributeAttributesJson);
3476
+ getInputType(): CustomAttributeInputType;
3477
+ setAttributes(attributesJson: SpaceGraphCustomAttributeAttributesJson): void;
3478
+ copyForClone(customAttribute: SpaceGraphCustomAttribute): void;
3479
+ toJSON(): SpaceGraphCustomAttributeJson;
3480
+ }
3481
+
3482
+ declare type SpaceGraphCustomAttributeAttributes = {
3483
+ resourceType: CustomAttributeResourceType;
3484
+ schema: CustomAttributeSchema;
3485
+ updatedAt?: string;
3486
+ description?: string;
3487
+ };
3488
+
3489
+ declare type SpaceGraphCustomAttributeAttributesJson = {
3490
+ resourceType: CustomAttributeResourceType;
3491
+ valueType?: CustomAttributeValueType;
3492
+ schema?: CustomAttributeSchema;
3493
+ updatedAt?: string;
3494
+ /** @minLength 3 @maxLength 200 @type string */
3495
+ description?: string;
3496
+ };
3497
+
3498
+ declare interface SpaceGraphCustomAttributeJson extends SpaceGraphNodeBaseJson {
3499
+ /** @type string @minLength 3 @maxLength 70 @pattern ^(?![_-])[A-Za-z0-9_:-]*$ */
3500
+ id: string;
3501
+ /** @minLength 3 @maxLength 30 @type string */
3502
+ name: string;
3503
+ type: SpaceGraphCustomAttributeType;
3504
+ attributes: SpaceGraphCustomAttributeAttributesJson;
3505
+ }
3506
+
3507
+ declare type SpaceGraphCustomAttributesByType = NodesByType<SpaceGraphCustomAttributeTypeMap>;
3508
+
3509
+ declare type SpaceGraphCustomAttributeType = typeof SpaceGraphCustomAttributeTypeValue;
3510
+
3511
+ declare type SpaceGraphCustomAttributeTypeMap = InstancesOf<typeof spaceGraphCustomAttributeTypeValues>;
3512
+
3513
+ declare const SpaceGraphCustomAttributeTypeValue = "customAttribute:definition";
3514
+
3515
+ declare const spaceGraphCustomAttributeTypeValues: {
3516
+ readonly 'customAttribute:definition': typeof SpaceGraphCustomAttribute;
3517
+ };
3518
+
3519
+ declare type SpaceGraphCustomAttributeValue = Record<string, string | boolean | number>;
3520
+
3521
+ declare type SpaceGraphCustomAttributeValueJson = Record<string, string | boolean | number | null>;
3522
+
3523
+ declare class SpaceGraphEmbeddedMaterial extends SpaceGraphNodeBase {
3524
+ type: SpaceGraphEmbeddedMaterialType;
3525
+ reference: string;
3526
+ format: SpaceGraphEmbeddedMaterialFormat;
3527
+ constructor(id: string, reference: string, format: SpaceGraphEmbeddedMaterialFormat);
3528
+ toJSON(): SpaceGraphMaterialResourceJson;
3529
+ }
3530
+
3531
+ declare type SpaceGraphEmbeddedMaterialFormat = 'data3d';
3532
+
3533
+ declare type SpaceGraphEmbeddedMaterialType = typeof SpaceGraphEmbeddedMaterialTypeValue;
3534
+
3535
+ declare const SpaceGraphEmbeddedMaterialTypeValue = "material:embedded";
3536
+
3537
+ declare interface SpaceGraphEventMap {
3538
+ 'spatial-structure-create': [SpaceGraphSpatialStructure];
3539
+ 'spatial-structure-delete': [SpaceGraphSpatialStructure];
3540
+ 'floor-transform-change': [SpaceGraphFloor];
3541
+ 'product-create': [SpaceGraphProduct];
3542
+ 'product-delete': [SpaceGraphProduct];
3543
+ 'material-create': [SpaceGraphMaterial];
3544
+ 'material-delete': [SpaceGraphMaterial];
3545
+ 'relation-create': [SpaceGraphRelation];
3546
+ 'relation-delete': [SpaceGraphRelation];
3547
+ 'custom-attribute-create': [SpaceGraphCustomAttribute];
3548
+ 'custom-attribute-delete': [SpaceGraphCustomAttribute];
3549
+ 'node-id-change': [SpaceGraphNodeBase, string];
3550
+ 'node-property-change': [SpaceGraphNodeBase, string];
3551
+ 'node-custom-attributes-change': [SpaceGraphNodeBase];
3552
+ 'vertex-create': [SpatialGraphVertex];
3553
+ 'vertex-delete': [SpatialGraphVertex];
3554
+ 'vertex-add-edge': [SpatialGraphVertex, SpatialGraphEdge];
3555
+ 'vertex-remove-edge': [SpatialGraphVertex, SpatialGraphEdge];
3556
+ 'vertex-set-position': [SpatialGraphVertex];
3557
+ 'edge-create': [SpatialGraphEdge];
3558
+ 'edge-delete': [SpatialGraphEdge];
3559
+ 'edge-set-vertices': [SpatialGraphEdge, {
3560
+ previousVertices: [SpatialGraphVertex, SpatialGraphVertex];
3561
+ }];
3562
+ 'space-create': [LayoutSpace];
3563
+ 'space-delete': [LayoutSpace];
3564
+ 'space-split': [LayoutSpace, [LayoutSpace, LayoutSpace]];
3565
+ 'space-attributes-change': [LayoutSpace];
3566
+ 'element-create': [LayoutElement];
3567
+ 'element-delete': [LayoutElement, LayoutElement | null];
3568
+ 'element-parameters-change': [LayoutElementBase];
3569
+ 'element-transform-change': [LayoutTransformElementBase];
3570
+ 'element-edges-change': [LayoutEdgeElementBase];
3571
+ 'annotation-create': [LayoutAnnotation];
3572
+ 'annotation-delete': [LayoutAnnotation];
3573
+ 'annotation-transform-change': [LayoutAnnotationBase];
3574
+ 'annotation-parameters-change': [LayoutAnnotationBase];
3575
+ 'view-create': [LayoutView];
3576
+ 'view-delete': [LayoutView];
3577
+ 'view-parameters-change': [LayoutViewBase];
3578
+ 'geometry-update': [LayoutElement];
3579
+ 'geometry-profile-update': [LayoutSpace | LayoutElement];
3580
+ }
3581
+
3582
+ declare class SpaceGraphFloor extends SpaceGraphSpatialStructureBase {
3583
+ type: SpaceGraphFloorType;
3584
+ parent: SpaceGraphBuilding | null;
3585
+ position: Vector3;
3586
+ rotation: number;
3587
+ level: string | null;
3588
+ layouts: SpaceGraphLayout[];
3589
+ constructor(id: string);
3590
+ copyForClone(floor: SpaceGraphFloor): void;
3591
+ setPosition(position: Vector3): void;
3592
+ setRotation(rotation: number): void;
3593
+ setTransform(position: Vector3, rotation: number): void;
3594
+ insertLayout(layout: SpaceGraphLayout): void;
3595
+ removeLayout(layout: SpaceGraphLayout): void;
3596
+ createLayout(id: string): SpaceGraphLayout;
3597
+ toJSON(): SpaceGraphFloorJson;
3598
+ static fromJSON(floorJson: SpaceGraphFloorJson, options?: {
3599
+ spaceGraph: SpaceGraph;
3600
+ skipInsert?: boolean;
3601
+ }): SpaceGraphFloor;
3602
+ }
3603
+
3604
+ declare interface SpaceGraphFloorJson extends SpaceGraphSpatialStructureBaseJson {
3605
+ type: SpaceGraphFloorType;
3606
+ position: Vector3;
3607
+ rotation: number;
3608
+ level?: string;
3609
+ layouts: SpaceGraphLayoutJson[];
3610
+ }
3611
+
3612
+ declare type SpaceGraphFloorType = typeof SpaceGraphFloorTypeValue;
3613
+
3614
+ declare const SpaceGraphFloorTypeValue = "spatialStructure:floor";
3615
+
3616
+ declare type SpaceGraphGeometriesByType = NodesByType<SpaceGraphGeometryTypeMap>;
3617
+
3618
+ declare type SpaceGraphGeometry = ParametricGeometry | MeshGeometry | UriGeometry;
3619
+
3620
+ declare type SpaceGraphGeometryJson = ParametricGeometryJson | MeshGeometryJson | UriGeometryJson;
3621
+
3622
+ declare type SpaceGraphGeometryType = ParametricGeometryType | MeshGeometryType | UriGeometryType;
3623
+
3624
+ declare type SpaceGraphGeometryTypeMap = InstancesOf<typeof geometriesTypeValues>;
3625
+
3626
+ declare interface SpaceGraphJson {
3627
+ schemaVersion: string;
3628
+ spatialStructure: SpaceGraphSpatialStructureJson;
3629
+ sharedResources: SpaceGraphSharedResourcesJson;
3630
+ }
3631
+
3632
+ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
3633
+ #private;
3634
+ type: LayoutType;
3635
+ parent: SpaceGraphFloor | null;
3636
+ spatialGraph: LayoutSpatialGraph;
3637
+ spaces: LayoutSpace[];
3638
+ spacesById: Record<string, LayoutSpace>;
3639
+ elements: LayoutElement[];
3640
+ elementsById: Record<string, LayoutElement>;
3641
+ elementsByType: LayoutElementsByType;
3642
+ annotations: LayoutAnnotation[];
3643
+ annotationsById: Record<string, LayoutAnnotation>;
3644
+ annotationsByType: LayoutAnnotationsByType;
3645
+ views: LayoutView[];
3646
+ viewsById: Record<string, LayoutView>;
3647
+ viewsByType: LayoutViewsByType;
3648
+ spatialIndex: SpatialIndex;
3649
+ debugIds: boolean;
3650
+ suggestedIds: Record<string, boolean>;
3651
+ constructor(id: string);
3652
+ copyForClone(layout: SpaceGraphLayout): void;
3653
+ insertSpace(space: LayoutSpace): void;
3654
+ removeSpace(space: LayoutSpace): LayoutSpace | undefined;
3655
+ createSpace(id: string, boundaries: LayoutBoundary[]): LayoutSpace;
3656
+ insertElement(element: LayoutElement): void;
3657
+ removeElement(element: LayoutElement): LayoutElement | undefined;
3658
+ createElement(type: LayoutOpeningType, id: string): LayoutOpening;
3659
+ createElement(type: LayoutBoundarySlabType, id: string, boundaries: LayoutBoundary[]): LayoutBoundarySlab;
3660
+ createElement(type: LayoutBoundaryWallType, id: string, boundaries: LayoutBoundary[]): LayoutBoundaryWall;
3661
+ createElement<T extends LayoutEdgeElementType>(type: T, id: string, edges: SpatialGraphEdge[]): EdgeElementMap[T];
3662
+ createElement<T extends LayoutTransformElementType>(type: T, id: string): TransformElementMap[T];
3663
+ createElement(type: LayoutElementType, id: string, ...args: any[]): LayoutElement | undefined;
3664
+ insertNode(node: LayoutAnnotation | LayoutView): boolean;
3665
+ removeNode(node: LayoutAnnotation | LayoutView): void;
3666
+ insertAnnotation(annotation: LayoutAnnotation): void;
3667
+ removeAnnotation(annotation: LayoutAnnotation): LayoutAnnotation | undefined;
3668
+ createAnnotation(type: LayoutAnnotationType, id: string): LayoutAnnotation | undefined;
3669
+ insertView(view: LayoutView): void;
3670
+ removeView(view: LayoutView): LayoutView;
3671
+ createView(type: LayoutViewType, id: string): LayoutView | undefined;
3672
+ clearSpaces(): void;
3673
+ getElementList(): LayoutElement[];
3674
+ /**
3675
+ * Look up an element by ID, optionally narrowing to a type. Passing a type both narrows
3676
+ * the return type and rejects an element of a different type, so it doubles as a check.
3677
+ */
3678
+ getElementById<T extends LayoutElementType>(id: string, type: T): LayoutElementTypeMap[T] | undefined;
3679
+ getElementById(id: string): LayoutElement | undefined;
3680
+ /**
3681
+ * Look up any layout node by ID, across all six registries. Consumers otherwise
3682
+ * hand-roll this chain, which means each of them has to know the full set. Passing a
3683
+ * type both narrows the return type and rejects a node of a different type.
3684
+ */
3685
+ getNodeById<T extends LayoutNodeType>(id: string, type: T): LayoutNodeTypeMap[T] | undefined;
3686
+ getNodeById(id: string): LayoutNode | undefined;
3687
+ /**
3688
+ * Nodes of one type, from whichever registry owns it. Avoids callers having to know
3689
+ * that elements, annotations and views live in separate maps.
3690
+ */
3691
+ getNodesByType<T extends LayoutNodeType>(type: T): LayoutNodeTypeMap[T][];
3692
+ getArea(filter?: {
3693
+ program?: {
3694
+ exclude?: string[];
3695
+ include?: string[];
3696
+ };
3697
+ }): number;
3698
+ getLayoutGraph(): Graph<LayoutNode>;
3699
+ getUniqueId(prefix: string, nodesById: Record<string, SpaceGraphNode>): string;
3700
+ getSpaceId(prefix?: string): string;
3701
+ getElementId(element: LayoutElement, prefix?: string): string;
3702
+ getBoundingBox(): TransformBoundingBox3d;
3703
+ toJSON(): SpaceGraphLayoutJson;
3704
+ static fromJSON(layoutJson: SpaceGraphLayoutJson, options?: {
3705
+ spaceGraph?: SpaceGraph;
3706
+ skipInsert?: boolean;
3707
+ }): SpaceGraphLayout;
3708
+ }
3709
+
3710
+ declare interface SpaceGraphLayoutJson extends SpaceGraphSpatialStructureBaseJson {
3711
+ type: LayoutType;
3712
+ spatialGraph: LayoutSpatialGraphJson;
3713
+ spaces: LayoutSpaceJson[];
3714
+ elements: LayoutElementJson[];
3715
+ annotations?: LayoutAnnotationJson[];
3716
+ views?: LayoutViewJson[];
3717
+ }
3718
+
3719
+ declare type SpaceGraphLocation = {
3720
+ latLong: Vector2;
3721
+ rotation: number;
3722
+ };
3723
+
3724
+ declare type SpaceGraphMaterial = SpaceGraphColorMaterial | SpaceGraphStandardMaterial | SpaceGraphEmbeddedMaterial | SpaceGraphBasicMaterial;
3725
+
3726
+ declare interface SpaceGraphMaterialBaseJson extends SpaceGraphNodeBaseJson {
3727
+ id: string;
3728
+ }
3729
+
3730
+ declare type SpaceGraphMaterialJson = Rgb | RgbA | string | SpaceGraphMaterialResourceJson;
3731
+
3732
+ declare type SpaceGraphMaterialResourceJson = SpaceGraphColorMaterialJson | SpaceGraphStandardMaterialJson | SpaceGraphBasicMaterialJson;
3733
+
3734
+ declare type SpaceGraphMaterialsByType = NodesByType<SpaceGraphMaterialTypeMap>;
3735
+
3736
+ declare type SpaceGraphMaterialType = SpaceGraphColorMaterialType | SpaceGraphStandardMaterialType | SpaceGraphEmbeddedMaterialType | SpaceGraphBasicMaterialType;
3737
+
3738
+ declare type SpaceGraphMaterialTypeMap = InstancesOf<typeof spaceGraphMaterialTypeValues>;
3739
+
3740
+ declare const spaceGraphMaterialTypeValues: {
3741
+ readonly 'material:embedded': typeof SpaceGraphEmbeddedMaterial;
3742
+ readonly 'material:basic': typeof SpaceGraphBasicMaterial;
3743
+ readonly 'material:color': typeof SpaceGraphColorMaterial;
3744
+ readonly 'material:standard': typeof SpaceGraphStandardMaterial;
3745
+ };
3746
+
3747
+ declare type SpaceGraphNode = SpaceGraphProduct | SpaceGraphGeometry | SpaceGraphMaterial | SpaceGraphRelation | SpaceGraphCustomAttribute | SpaceGraphBuilding | SpaceGraphFloor | LayoutNode | SpaceGraphLayout | LayoutAnnotation;
3748
+
3749
+ declare class SpaceGraphNodeBase extends SpaceGraphTypedValue {
3750
+ id: string;
3751
+ name: string;
3752
+ customId: string;
3753
+ constructor(id: string, type: string);
3754
+ copyForClone(node: SpaceGraphNode): void;
3755
+ setName(name: string): void;
3756
+ setCustomId(customId: string): void;
3757
+ emit<EventType extends keyof SpaceGraphEventMap>(event: EventType, ...args: SpaceGraphEventMap[EventType]): void;
3758
+ toJSON(): SpaceGraphNodeBaseJson;
3759
+ }
3760
+
3761
+ declare interface SpaceGraphNodeBaseJson extends SpaceGraphTypedValueJson {
3762
+ /** @format uuid */
3763
+ id: string;
3764
+ name?: string;
3765
+ customId?: string;
3766
+ }
3767
+
3768
+ declare type SpaceGraphNodesByType = NodesByType<SpaceGraphNodeTypeMap>;
3769
+
3770
+ declare type SpaceGraphNodeType = SpaceGraphProductType | SpaceGraphGeometryType | SpaceGraphMaterialType | SpaceGraphRelationType | SpaceGraphBuildingType | SpaceGraphFloorType | LayoutNodeType | LayoutType | LayoutAnnotationType;
3771
+
3772
+ declare type SpaceGraphNodeTypeMap = LayoutNodeTypeMap & SpaceGraphGeometryTypeMap & SpaceGraphMaterialTypeMap & SpaceGraphProductTypeMap & SpaceGraphRelationTypeMap & {
3773
+ 'spatialStructure:building': SpaceGraphBuilding;
3774
+ 'spatialStructure:floor': SpaceGraphFloor;
3775
+ 'spatialStructure:layout': SpaceGraphLayout;
3776
+ };
3777
+
3778
+ declare type SpaceGraphNodeWithCustomAttributes = LayoutNode | SpaceGraphSpatialStructure | SpaceGraphProduct;
3779
+
3780
+ declare class SpaceGraphNodeWithCustomAttributesBase extends SpaceGraphNodeBase {
3781
+ customAttributes: SpaceGraphCustomAttributeValue;
3782
+ constructor(id: string, type: string);
3783
+ setCustomAttributes(customAttributes?: SpaceGraphCustomAttributeValueJson | null, customAttributesById?: Record<string, SpaceGraphCustomAttribute>): void;
3784
+ toJSON(): SpaceGraphNodeWithCustomAttributesBaseJson;
3785
+ copyForClone(node: SpaceGraphNodeWithCustomAttributes): void;
3786
+ }
3787
+
3788
+ declare interface SpaceGraphNodeWithCustomAttributesBaseJson extends SpaceGraphNodeBaseJson {
3789
+ customAttributes?: SpaceGraphCustomAttributeValueJson | null;
3790
+ }
3791
+
3792
+ declare type SpaceGraphProduct = SpaceGraphProductStatic | SpaceGraphProductComponent;
3793
+
3794
+ declare type SpaceGraphProductAttributes = {
3795
+ manufacturer: string;
3796
+ categories: string[];
3797
+ subCategories: string[];
3798
+ thumbnail: string;
3799
+ boundingBox: BoundingBox3d;
3800
+ seatCapacity: number;
3801
+ updatedAt: string;
3802
+ };
3803
+
3804
+ declare type SpaceGraphProductAttributesJson = {
3805
+ manufacturer?: string;
3806
+ categories?: string[];
3807
+ subCategories?: string[];
3808
+ thumbnail?: string;
3809
+ boundingBox?: BoundingBox3d;
3810
+ seatCapacity?: number;
3811
+ updatedAt?: string;
3812
+ };
3813
+
3814
+ declare class SpaceGraphProductBase extends SpaceGraphNodeWithCustomAttributesBase {
3815
+ type: SpaceGraphProductType;
3816
+ attributes: SpaceGraphProductAttributes;
3817
+ instances: Set<LayoutAsset>;
3818
+ constructor(id: string, type: SpaceGraphProductType);
3819
+ copyForClone(product: SpaceGraphProductStatic | SpaceGraphProductComponent): void;
3820
+ setAttributes(attributesJson: SpaceGraphProductAttributesJson): void;
3821
+ getBoundingBox(): BoundingBox3d;
3822
+ toJSON(): SpaceGraphProductJson;
3823
+ }
3824
+
3825
+ declare class SpaceGraphProductComponent extends SpaceGraphProductBase {
3826
+ type: SpaceGraphProductComponentType;
3827
+ attributes: SpaceGraphProductAttributes;
3828
+ products: {
3829
+ position: PositionEntry;
3830
+ rotation: RotationEntry;
3831
+ product: string;
3832
+ }[];
3833
+ geometries: GeometryOperationJson[];
3834
+ constructor(id: string);
3835
+ copyForClone(product: SpaceGraphProductComponent): void;
3836
+ toJSON(): SpaceGraphProductComponentJson;
3837
+ setProducts(products: {
3838
+ position: PositionEntry;
3839
+ rotation: RotationEntry;
3840
+ product: string;
3841
+ }[]): void;
3842
+ setInstances(): void;
3843
+ }
3844
+
3845
+ declare interface SpaceGraphProductComponentJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
3846
+ type: SpaceGraphProductComponentType;
3847
+ attributes?: SpaceGraphProductAttributesJson;
3848
+ products: {
3849
+ position: PositionEntry;
3850
+ rotation: RotationEntry;
3851
+ product: string;
3852
+ }[];
3853
+ geometries: GeometryOperationJson[];
3854
+ }
3855
+
3856
+ declare type SpaceGraphProductComponentType = typeof SpaceGraphProductComponentTypeValue;
3857
+
3858
+ declare const SpaceGraphProductComponentTypeValue = "product:component";
3859
+
3860
+ declare type SpaceGraphProductJson = SpaceGraphProductStaticJson | SpaceGraphProductComponentJson;
3861
+
3862
+ declare type SpaceGraphProductsByType = NodesByType<SpaceGraphProductTypeMap>;
3863
+
3864
+ declare class SpaceGraphProductStatic extends SpaceGraphProductBase {
3865
+ type: SpaceGraphProductStaticType;
3866
+ geometries: GeometryOperationJson[];
3867
+ constructor(id: string);
3868
+ copyForClone(product: SpaceGraphProductStatic): void;
3869
+ toJSON(): SpaceGraphProductStaticJson;
3870
+ }
3871
+
3872
+ declare interface SpaceGraphProductStaticJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
3873
+ type: SpaceGraphProductStaticType;
3874
+ attributes?: SpaceGraphProductAttributesJson;
3875
+ geometries: GeometryOperationJson[];
3876
+ }
3877
+
3878
+ declare type SpaceGraphProductStaticType = typeof SpaceGraphProductStaticTypeValue;
3879
+
3880
+ declare const SpaceGraphProductStaticTypeValue = "product:static";
3881
+
3882
+ declare type SpaceGraphProductType = SpaceGraphProductStaticType | SpaceGraphProductComponentType;
3883
+
3884
+ declare type SpaceGraphProductTypeMap = InstancesOf<typeof spaceGraphProductTypeValues>;
3885
+
3886
+ declare const spaceGraphProductTypeValues: {
3887
+ readonly 'product:static': typeof SpaceGraphProductStatic;
3888
+ readonly 'product:component': typeof SpaceGraphProductComponent;
3889
+ };
3890
+
3891
+ declare type SpaceGraphRelation = GroupRelation;
3892
+
3893
+ declare type SpaceGraphRelationJson = GroupRelationJson;
3894
+
3895
+ declare type SpaceGraphRelationsByType = NodesByType<SpaceGraphRelationTypeMap>;
3896
+
3897
+ declare type SpaceGraphRelationType = GroupRelationType;
3898
+
3899
+ declare type SpaceGraphRelationTypeMap = InstancesOf<typeof spaceGraphRelationTypeValues>;
3900
+
3901
+ declare const spaceGraphRelationTypeValues: {
3902
+ readonly 'relation:group': typeof GroupRelation;
3903
+ };
3904
+
3905
+ declare interface SpaceGraphSharedResourcesJson {
3906
+ products: SpaceGraphProductJson[];
3907
+ geometries: SpaceGraphGeometryJson[];
3908
+ materials: SpaceGraphMaterialResourceJson[];
3909
+ relations: SpaceGraphRelationJson[];
3910
+ customAttributes?: SpaceGraphCustomAttributeJson[];
3911
+ }
3912
+
3913
+ declare type SpaceGraphSpatialStructure = SpaceGraphBuilding | SpaceGraphFloor | SpaceGraphLayout;
3914
+
3915
+ declare class SpaceGraphSpatialStructureBase extends SpaceGraphNodeWithCustomAttributesBase {
3916
+ type: SpaceGraphSpatialStructureType;
3917
+ constructor(id: string, type: SpaceGraphSpatialStructureType);
3918
+ }
3919
+
3920
+ declare interface SpaceGraphSpatialStructureBaseJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
3921
+ type: SpaceGraphSpatialStructureType;
3922
+ }
3923
+
3924
+ declare type SpaceGraphSpatialStructureJson = SpaceGraphBuildingJson | SpaceGraphFloorJson | SpaceGraphLayoutJson;
3925
+
3926
+ declare type SpaceGraphSpatialStructureType = SpaceGraphBuildingType | SpaceGraphFloorType | LayoutType;
3927
+
3928
+ declare class SpaceGraphStandardMaterial extends SpaceGraphNodeBase {
3929
+ type: SpaceGraphStandardMaterialType;
3930
+ reference: string;
3931
+ constructor(id: string, reference: string);
3932
+ toJSON(): SpaceGraphMaterialResourceJson;
3933
+ }
3934
+
3935
+ declare interface SpaceGraphStandardMaterialJson extends SpaceGraphMaterialBaseJson {
3936
+ type: SpaceGraphStandardMaterialType;
3937
+ reference: string;
3938
+ }
3939
+
3940
+ declare type SpaceGraphStandardMaterialType = typeof SpaceGraphStandardMaterialTypeValue;
3941
+
3942
+ declare const SpaceGraphStandardMaterialTypeValue = "material:standard";
3943
+
3944
+ declare class SpaceGraphTypedValue {
3945
+ spaceGraph: SpaceGraph;
3946
+ type: string;
3947
+ constructor(type: string);
3948
+ }
3949
+
3950
+ declare interface SpaceGraphTypedValueJson {
3951
+ type: string;
3952
+ }
3953
+
3954
+ declare type SpaceQuery = {
3955
+ select?: SpaceSelect;
3956
+ where?: SpaceFilter;
3957
+ };
3958
+
3959
+ declare class SpaceRemove extends OperationBase {
3960
+ type: typeof SpaceRemoveTypeValue;
3961
+ previousValue: SpaceRemoveValue;
3962
+ constructor(node: LayoutSpace | string, previousValue?: SpaceRemoveValue);
3963
+ do(layout: SpaceGraphLayout): void;
3964
+ undo(layout: SpaceGraphLayout): void;
3965
+ }
3966
+
3967
+ declare type SpaceRemoveOperationJson = Pick<SpaceRemove, 'nodeId' | 'type'> & Partial<Pick<SpaceRemove, 'previousValue'>>;
3968
+
3969
+ declare const SpaceRemoveTypeValue: "operation:spaceRemove";
3970
+
3971
+ declare type SpaceRemoveValue = LayoutSpaceJson;
3972
+
3973
+ declare interface SpaceSelect extends BaseSelect {
3974
+ category?: boolean;
3975
+ subCategory?: boolean;
3976
+ isExternal?: boolean;
3977
+ area?: boolean;
3978
+ seatCapacity?: boolean;
3979
+ elements?: ElementQuery | boolean;
3980
+ boundaries?: boolean;
3981
+ }
3982
+
3983
+ declare class SpaceUpdate extends OperationBase {
3984
+ type: typeof SpaceUpdateTypeValue;
3985
+ value: SpaceUpdateValue;
3986
+ constructor(node: LayoutSpace | string, value: SpaceUpdateValue, previousValue?: SpaceUpdateValue);
3987
+ private setPreviousValue;
3988
+ private update;
3989
+ do(layout: SpaceGraphLayout): void;
3990
+ undo(layout: SpaceGraphLayout): void;
3991
+ }
3992
+
3993
+ declare type SpaceUpdateOperationJson = Pick<SpaceUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<SpaceUpdate, 'previousValue'>>;
3994
+
3995
+ declare const SpaceUpdateTypeValue: "operation:spaceUpdate";
3996
+
3997
+ declare type SpaceUpdateValue = Partial<LayoutSpaceJson>;
3998
+
3999
+ declare class SpatialGraphEdge extends SpatialGraphNodeBase {
4000
+ type: SpatialGraphEdgeType;
4001
+ vertices: [SpatialGraphVertex, SpatialGraphVertex];
4002
+ spaces: [LayoutSpace | null | undefined, LayoutSpace | null | undefined];
4003
+ boundaryWalls: [LayoutBoundaryWall | null, LayoutBoundaryWall | null];
4004
+ element: LayoutEdgeElement | null;
4005
+ constructor(id: string, vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex);
4006
+ getPoints(): [Vector2_2, Vector2_2];
4007
+ getLength(): number;
4008
+ get isExternal(): boolean;
4009
+ setVertices(vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex): void;
4010
+ resetSpatialIndexing(): void;
4011
+ calculateBoundingBox(): BoundingBox3d;
4012
+ setVerticesByIds(vertexId1: string, vertexId2: string): void;
4013
+ canSplit(u: number, options?: EdgeCanSplitOptions): boolean;
4014
+ split(u: number, options?: EdgeSplitOptions, updateSpaceBoundaries?: boolean): EdgeSplitReturnValue;
4015
+ canMerge(edge: SpatialGraphEdge): boolean;
4016
+ merge(edge: SpatialGraphEdge, updateSpaceBoundaries?: boolean): void;
4017
+ toJSON(): SpatialGraphEdgeJson;
4018
+ }
4019
+
4020
+ declare interface SpatialGraphEdgeJson extends SpatialGraphNodeBaseJson {
4021
+ id: string;
4022
+ type: SpatialGraphEdgeType;
4023
+ vertices: [string, string];
4024
+ }
4025
+
4026
+ declare type SpatialGraphEdgeType = typeof SpatialGraphEdgeTypeValue;
4027
+
4028
+ declare const SpatialGraphEdgeTypeValue = "spatialGraph:edge";
4029
+
4030
+ declare type SpatialGraphNode_2 = SpatialGraphVertex | SpatialGraphEdge;
4031
+
4032
+ declare class SpatialGraphNodeBase extends LayoutBoundingBoxNode {
4033
+ }
4034
+
4035
+ declare interface SpatialGraphNodeBaseJson extends LayoutNodeBaseJson {
4036
+ }
4037
+
4038
+ declare type SpatialGraphNodeType = SpatialGraphVertexType | SpatialGraphEdgeType;
4039
+
4040
+ declare class SpatialGraphVertex extends SpatialGraphNodeBase {
4041
+ type: SpatialGraphVertexType;
4042
+ position: Vector2;
4043
+ edges: SpatialGraphEdge[];
4044
+ constructor(id: string, x: number, y: number);
4045
+ sortVertexEdges(): void;
4046
+ calculateTransform(): Transform3d;
4047
+ addEdge(edge: SpatialGraphEdge): void;
4048
+ removeEdge(edge: SpatialGraphEdge): void;
4049
+ setPosition(x: number, y: number): void;
4050
+ resetSpatialIndexing(): void;
4051
+ toJSON(): SpatialGraphVertexJson;
4052
+ }
4053
+
4054
+ declare interface SpatialGraphVertexJson extends SpatialGraphNodeBaseJson {
4055
+ id: string;
4056
+ type: SpatialGraphVertexType;
4057
+ position: Vector2;
4058
+ }
4059
+
4060
+ declare type SpatialGraphVertexType = typeof SpatialGraphVertexTypeValue;
4061
+
4062
+ declare const SpatialGraphVertexTypeValue = "spatialGraph:vertex";
4063
+
4064
+ /**
4065
+ * A spatial index for efficiently querying nodes within a 2D bounding box.
4066
+ *
4067
+ * @example
4068
+ * ```typescript
4069
+ * const spatialIndex = new SpatialIndex(layout);
4070
+ * spatialIndex.addNode(node);
4071
+ * const foundNodes = spatialIndex.find({
4072
+ * min: [-10, -10],
4073
+ * max: [10, 10],
4074
+ * margin: 0.1,
4075
+ * types: ['element:wall', 'element:door']
4076
+ * });
4077
+ * ```
4078
+ */
4079
+ declare class SpatialIndex extends default_2<IndexedNodeReference> {
4080
+ /**
4081
+ * Maps a node id to the bounding box reference that was actually inserted into
4082
+ * the tree. We need the exact inserted reference (with its original
4083
+ * coordinates) to remove it again: RBush navigates the tree using the item's
4084
+ * bounding box, so removing with a node's *current* (moved) bounding box can
4085
+ * fail to locate the stale entry, leaving duplicates behind.
4086
+ */
4087
+ indexedNodesById: Map<string, IndexedNodeReference>;
4088
+ layout: SpaceGraphLayout;
4089
+ constructor(layout: SpaceGraphLayout);
4090
+ /**
4091
+ * Find nodes by 2d bounding, margin and types selection
4092
+ *
4093
+ * `max` will fallback to `min` if not provided
4094
+ */
4095
+ find<T = LayoutBoundingBoxNode>({ min, max, margin, types }: SpatialIndexFind): T[];
4096
+ addNode(node: LayoutBoundingBoxNode): void;
4097
+ removeNode(node: LayoutBoundingBoxNode): void;
4098
+ remove(node: IndexedNodeReference): this;
4099
+ }
4100
+
4101
+ declare type SpatialIndexFind = {
4102
+ min: Vector2;
4103
+ max?: Vector2;
4104
+ margin?: number;
4105
+ types?: LayoutNodeType[];
4106
+ };
4107
+
4108
+ declare class SphereGeometry extends ParametricGeometryBase {
4109
+ type: SphereGeometryType;
4110
+ radius: number;
4111
+ constructor(id: string);
4112
+ }
4113
+
4114
+ declare interface SphereGeometryJson extends ParametricGeometryBaseJson {
4115
+ type: SphereGeometryType;
4116
+ radius: number;
4117
+ }
4118
+
4119
+ declare type SphereGeometryType = typeof SphereGeometryTypeValue;
4120
+
4121
+ declare const SphereGeometryTypeValue = "geometry:sphere";
4122
+
4123
+ declare interface SpiralStairFlightParameters {
4124
+ stairFlightType: 'spiral';
4125
+ angle: number;
4126
+ radius: number;
4127
+ /** @minimum 0.01 */
4128
+ width: number;
4129
+ /** @minimum 0.01 */
4130
+ height: number;
4131
+ circulation: 'left' | 'right';
4132
+ materials: LayoutStairFlightMaterials;
4133
+ }
4134
+
4135
+ declare type SpiralStairFlightParametersJson = Partial<SpiralStairFlightParameters>;
4136
+
4137
+ declare type SpiralStairsParameters = {
4138
+ stairsType: SpiralStairsType;
4139
+ radius: number;
4140
+ angle: number;
4141
+ /** @minimum 0.01 */
4142
+ height: number;
4143
+ /** @minimum 0.01 */
4144
+ stepWidth: number;
4145
+ circulation: 'left' | 'right';
4146
+ } & CommonStairsParameters;
4147
+
4148
+ declare type SpiralStairsParametersJson = Partial<SpiralStairsParameters>;
4149
+
4150
+ declare type SpiralStairsType = 'spiral';
4151
+
4152
+ declare type StartActionResult = {
4153
+ status: 'started';
4154
+ runId: string;
4155
+ } | {
4156
+ status: 'unavailable';
4157
+ reason: StartActionUnavailableReason;
4158
+ };
4159
+
4160
+ declare type StartActionRunArgs = {
4161
+ /** User-facing name shown in the host's exit control while the action runs. */
4162
+ name: string;
4163
+ /** Controls declared from the first moment — for tools that resume with restored pending state. */
4164
+ controls?: ExtensionActionControls;
4165
+ /** The user pressed a declared control: unwind a vertex, discard the trace, commit. */
4166
+ onControl?: (control: ExtensionActionControl) => void;
4167
+ /** The host ended the run — roll pending gesture state back. */
4168
+ onEnd?: (reason: ExtensionActionEndReason) => void;
4169
+ };
4170
+
4171
+ declare type StartActionRunResult = {
4172
+ status: 'started';
4173
+ run: ActionRunHandle;
4174
+ } | {
4175
+ status: 'unavailable';
4176
+ reason: StartActionUnavailableReason;
4177
+ };
4178
+
4179
+ declare type StartActionUnavailableReason = 'not-foreground' | 'editing-unavailable' | 'busy';
4180
+
4181
+ declare type StraightStairFlightParameters = {
4182
+ stairFlightType: 'straight';
4183
+ materials: LayoutStairFlightMaterials;
4184
+ } & DimensionParameters;
4185
+
4186
+ declare type StraightStairFlightParametersJson = Partial<StraightStairFlightParameters>;
4187
+
4188
+ declare type StraightStairsParameters = {
4189
+ stairsType: StraightStairsType;
4190
+ } & DimensionParameters & CommonStairsParameters;
4191
+
4192
+ declare type StraightStairsParametersJson = Partial<StraightStairsParameters>;
4193
+
4194
+ declare type StraightStairsType = 'straight' | 'straightLanding';
4195
+
4196
+ declare type StringComparator = string | {
4197
+ eq: string;
4198
+ } | {
4199
+ neq: string;
4200
+ } | {
4201
+ in: string[];
4202
+ } | {
4203
+ nin: string[];
4204
+ } | {
4205
+ contains: string;
4206
+ };
4207
+
4208
+ declare type StyleByKey = Record<string, ShapeStyle>;
4209
+
4210
+ declare type StyledFilter = {
4211
+ where: ElementFilter | SpaceFilter;
4212
+ style: ShapeStyle;
4213
+ };
4214
+
4215
+ declare type StyleFilter = StyledFilter;
4216
+
4217
+ declare interface SurfaceMaterials {
4218
+ [surface: string]: SpaceGraphMaterial;
4219
+ }
4220
+
4221
+ declare interface SurfaceMaterialsJson {
4222
+ [surface: string]: SpaceGraphMaterialJson;
4223
+ }
4224
+
4225
+ declare interface Surfaces {
4226
+ [surface: string]: GeometryFaceIndices;
4227
+ }
4228
+
4229
+ declare interface TextField extends BaseField {
4230
+ type: 'text';
4231
+ default?: string;
4232
+ }
4233
+
4234
+ declare interface TextShape {
4235
+ type: 'text';
4236
+ position: Vector2;
4237
+ text: string;
4238
+ rotation?: number;
4239
+ alignV?: 'center' | 'bottom' | 'top';
4240
+ alignH?: 'center' | 'left' | 'right';
4241
+ fontSize?: number;
4242
+ style?: ShapeStyle;
4243
+ }
4244
+
4245
+ declare type Texture = {
4246
+ type: 'texture:uri';
4247
+ uri: string;
4248
+ preview?: string;
4249
+ source?: string;
4250
+ };
4251
+
4252
+ declare type ThemeStyles = {
4253
+ byId?: StyleByKey;
4254
+ byType?: {
4255
+ 'element:asset'?: ShapeStyle & {
4256
+ label?: NodeLabel;
4257
+ };
4258
+ 'element:beam'?: ShapeStyle;
4259
+ 'element:boundaryWall'?: ShapeStyle;
4260
+ 'element:casework'?: ShapeStyle;
4261
+ 'element:ceiling'?: ShapeStyle;
4262
+ 'element:column'?: ShapeStyle;
4263
+ 'element:curtainWall'?: ShapeStyle;
4264
+ 'element:door'?: ShapeStyle;
4265
+ 'element:floor'?: ShapeStyle;
4266
+ 'element:generic'?: ShapeStyle;
4267
+ 'element:kitchen'?: ShapeStyle;
4268
+ 'element:opening'?: ShapeStyle;
4269
+ 'element:railing'?: ShapeStyle;
4270
+ 'element:ramp'?: ShapeStyle;
4271
+ 'element:roof'?: ShapeStyle;
4272
+ 'element:slab'?: ShapeStyle;
4273
+ 'element:spaceDivider'?: ShapeStyle;
4274
+ 'element:stairFlight'?: ShapeStyle;
4275
+ 'element:stairs'?: ShapeStyle;
4276
+ 'element:wall'?: ShapeStyle;
4277
+ 'element:window'?: ShapeStyle;
4278
+ 'layout:space'?: ShapeStyle;
4279
+ 'spatialGraph:edge'?: ShapeStyle;
4280
+ 'annotation:floorPlanImage'?: ShapeStyle & {
4281
+ grayscale?: boolean;
4282
+ };
4283
+ };
4284
+ byFilter?: StyleFilter[];
4285
+ };
4286
+
4287
+ declare type Transform3d = {
4288
+ position: Vector3;
4289
+ rotation: number;
4290
+ rotationAxis: Vector3;
4291
+ };
4292
+
4293
+ declare type TransformBoundingBox3d = {
4294
+ min: Vector3;
4295
+ max: Vector3;
4296
+ transform: Transform3d;
4297
+ };
4298
+
4299
+ declare type TransformElementMap = {
4300
+ -readonly [Key in LayoutTransformElementType]: LayoutElementTypeMap[Key];
4301
+ };
4302
+
4303
+ declare class UriGeometry extends GeometryBase {
4304
+ type: UriGeometryType;
4305
+ format: UriGeometryFormat;
4306
+ uri: string;
4307
+ normals: ParametricNormals;
4308
+ constructor(id: string);
4309
+ }
4310
+
4311
+ declare type UriGeometryFormat = 'data3d';
4312
+
4313
+ declare interface UriGeometryJson extends GeometryBaseJson {
4314
+ type: UriGeometryType;
4315
+ format: UriGeometryFormat;
4316
+ uri: string;
4317
+ normals?: ParametricNormals;
4318
+ }
4319
+
4320
+ declare type UriGeometryType = typeof UriGeometryTypeValue;
4321
+
4322
+ declare const UriGeometryTypeValue = "geometry:uri";
4323
+
4324
+ declare type Vector2 = [number, number];
4325
+
4326
+ declare type Vector2_2 = [number, number];
4327
+
4328
+ declare type Vector3 = [number, number, number];
4329
+
4330
+ declare interface Vector3List extends SpaceGraphTypedValueJson {
4331
+ type: 'vector3:list';
4332
+ list: Vector3[];
4333
+ }
4334
+
4335
+ declare interface Vector3Range extends SpaceGraphTypedValueJson {
4336
+ type: 'vector3:range';
4337
+ range: {
4338
+ start: Vector3;
4339
+ step: Vector3;
4340
+ count: number;
4341
+ };
4342
+ }
4343
+
4344
+ declare class VertexCreate extends OperationBase {
4345
+ type: typeof VertexCreateTypeValue;
4346
+ value: VertexValueType;
4347
+ previousValue: null;
4348
+ constructor(value: VertexValueType);
4349
+ do(layout: SpaceGraphLayout): void;
4350
+ undo(layout: SpaceGraphLayout): void;
4351
+ }
4352
+
4353
+ declare type VertexCreateOperationJson = Pick<VertexCreate, 'type' | 'value'>;
4354
+
4355
+ declare const VertexCreateTypeValue: "operation:vertexCreate";
4356
+
4357
+ declare class VertexRemove extends OperationBase {
4358
+ type: typeof VertexRemoveTypeValue;
4359
+ previousValue: PositionValue;
4360
+ constructor(vertex: SpatialGraphVertex | string, previousValue?: PositionValue);
4361
+ setPreviousValue(layout: SpaceGraphLayout): void;
4362
+ do(layout: SpaceGraphLayout): void;
4363
+ undo(layout: SpaceGraphLayout): void;
4364
+ }
4365
+
4366
+ declare type VertexRemoveOperationJson = Pick<VertexRemove, 'nodeId' | 'type'> & Partial<Pick<VertexRemove, 'previousValue'>>;
4367
+
4368
+ declare const VertexRemoveTypeValue: "operation:vertexRemove";
4369
+
4370
+ declare class VertexReplace extends OperationBase {
4371
+ type: typeof VertexReplaceTypeValue;
4372
+ value: VertexReplaceValue;
4373
+ previousValue: SpatialGraphVertexJson;
4374
+ constructor(vertex: SpatialGraphVertex | string, value: VertexReplaceValue, previousValue?: VertexReplaceValue);
4375
+ setPreviousValue(layout: SpaceGraphLayout): void;
4376
+ do(layout: SpaceGraphLayout): void;
4377
+ undo(layout: SpaceGraphLayout): void;
4378
+ }
4379
+
4380
+ declare type VertexReplaceOperationJson = Pick<VertexReplace, 'nodeId' | 'type' | 'value'> & Partial<Pick<VertexReplace, 'previousValue'>>;
4381
+
4382
+ declare const VertexReplaceTypeValue: "operation:vertexReplace";
4383
+
4384
+ declare type VertexReplaceValue = Pick<VertexValueType, 'id'> & Partial<VertexValueType>;
4385
+
4386
+ declare class VertexUpdate extends OperationBase {
4387
+ type: typeof VertexUpdateTypeValue;
4388
+ value: PositionValue;
4389
+ previousValue: PositionValue;
4390
+ constructor(vertex: SpatialGraphVertex | string, value: PositionValue, previousValue?: PositionValue);
4391
+ private setPreviousValue;
4392
+ private update;
4393
+ do(layout: SpaceGraphLayout): void;
4394
+ undo(layout: SpaceGraphLayout): void;
4395
+ }
4396
+
4397
+ declare type VertexUpdateOperationJson = Pick<VertexUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<VertexUpdate, 'previousValue'>>;
4398
+
4399
+ declare const VertexUpdateTypeValue: "operation:vertexUpdate";
4400
+
4401
+ declare type VertexValueType = Omit<SpatialGraphVertexJson, 'type'>;
4402
+
4403
+ declare class ViewCreate extends OperationBase {
4404
+ type: typeof ViewCreateTypeValue;
4405
+ value: LayoutViewJson;
4406
+ constructor(value: LayoutViewJson);
4407
+ do(layout: SpaceGraphLayout): void;
4408
+ undo(layout: SpaceGraphLayout): void;
4409
+ }
4410
+
4411
+ declare type ViewCreateOperationJson = Pick<ViewCreate, 'type' | 'value'>;
4412
+
4413
+ declare const ViewCreateTypeValue: "operation:viewCreate";
4414
+
4415
+ declare class ViewRemove extends OperationBase {
4416
+ type: typeof ViewRemoveTypeValue;
4417
+ previousValue: LayoutViewJson;
4418
+ constructor(node: LayoutView | string, previousValue?: LayoutViewJson);
4419
+ do(layout: SpaceGraphLayout): void;
4420
+ undo(layout: SpaceGraphLayout): void;
4421
+ }
4422
+
4423
+ declare type ViewRemoveOperationJson = Pick<ViewRemove, 'nodeId' | 'type'> & Partial<Pick<ViewRemove, 'previousValue'>>;
4424
+
4425
+ declare const ViewRemoveTypeValue: "operation:viewRemove";
4426
+
4427
+ declare class ViewUpdate extends OperationBase {
4428
+ type: typeof ViewUpdateTypeValue;
4429
+ value: ViewUpdateValue;
4430
+ constructor(node: LayoutView | string, value: ViewUpdateValue, previousValue?: ViewUpdateValue);
4431
+ private setPreviousValue;
4432
+ private update;
4433
+ do(layout: SpaceGraphLayout): void;
4434
+ undo(layout: SpaceGraphLayout): void;
4435
+ }
4436
+
4437
+ declare type ViewUpdateOperationJson = Pick<ViewUpdate, 'nodeId' | 'type' | 'value'> & Partial<Pick<ViewUpdate, 'previousValue'>>;
4438
+
4439
+ declare const ViewUpdateTypeValue: "operation:viewUpdate";
4440
+
4441
+ declare type ViewUpdateValue = Partial<LayoutViewJson> & {
4442
+ parameters?: Partial<LayoutViewJson['parameters']>;
4443
+ };
4444
+
4445
+ /** A `[min, max]` zoom range (inclusive bounds) used for zoom-dependent rendering. */
4446
+ declare type ZoomRange = [min: number, max: number];
4447
+
4448
+ export { }