@archilogic/floor-plan-sdk 5.0.1 → 5.1.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.
package/dist/fpe.d.ts CHANGED
@@ -36,16 +36,16 @@ declare interface ApiUrls {
36
36
  apiProductDataPath?: string;
37
37
  }
38
38
 
39
- declare interface ArcCurve extends CurveBase {
40
- type: ArcCurveType;
39
+ export declare interface ArcCurve extends BaseShape {
40
+ type: 'curve:arc';
41
+ position: Vector2;
41
42
  radius: number;
42
43
  startAngle: number;
43
44
  endAngle: number;
44
45
  }
45
46
 
46
- declare interface ArcCurve_2 extends BaseShape {
47
- type: 'curve:arc';
48
- position: Vector2_2;
47
+ declare interface ArcCurve_2 extends CurveBase {
48
+ type: ArcCurveType;
49
49
  radius: number;
50
50
  startAngle: number;
51
51
  endAngle: number;
@@ -72,14 +72,14 @@ declare interface BaseShape {
72
72
  style?: ShapeStyle;
73
73
  }
74
74
 
75
- declare interface BezierCurve extends BaseShape {
75
+ export declare interface BezierCurve extends BaseShape {
76
76
  type: 'curve:quadraticBezier';
77
77
  points: Polygon;
78
78
  }
79
79
 
80
80
  declare type BoundingBox2d = {
81
- min: Vector2_2;
82
- max: Vector2_2;
81
+ min: Vector2;
82
+ max: Vector2;
83
83
  };
84
84
 
85
85
  declare type BoundingBox3d = {
@@ -87,14 +87,14 @@ declare type BoundingBox3d = {
87
87
  max: Vector3;
88
88
  };
89
89
 
90
- declare interface CircleCurve extends CurveBase {
91
- type: CircleCurveType;
90
+ export declare interface CircleCurve extends BaseShape {
91
+ type: 'curve:circle';
92
+ position: Vector2;
92
93
  radius: number;
93
94
  }
94
95
 
95
- declare interface CircleCurve_2 extends BaseShape {
96
- type: 'curve:circle';
97
- position: Vector2_2;
96
+ declare interface CircleCurve_2 extends CurveBase {
97
+ type: CircleCurveType;
98
98
  radius: number;
99
99
  }
100
100
 
@@ -102,9 +102,9 @@ declare type CircleCurveType = typeof CircleCurveTypeValue;
102
102
 
103
103
  declare const CircleCurveTypeValue = "curve:circle";
104
104
 
105
- declare type ClosedCurve = RectangleCurve | PolygonCurve | CircleCurve | CompositeCurve;
105
+ declare type ClosedCurve = RectangleCurve_2 | PolygonCurve_2 | PolygonWithHolesCurve_2 | CircleCurve_2 | CompositeCurve_2;
106
106
 
107
- declare type ClosedCurveType = RectangleCurveType | PolygonCurveType | CircleCurveType | CompositeCurveType;
107
+ declare type ClosedCurveType = RectangleCurveType | PolygonCurveType | PolygonWithHolesCurveType | CircleCurveType | CompositeCurveType;
108
108
 
109
109
  declare interface CommonParameters$1 {
110
110
  materials: LayoutRampMaterials;
@@ -154,16 +154,16 @@ declare interface CommonParameters {
154
154
  materials: LayoutWindowMaterials;
155
155
  }
156
156
 
157
- declare interface CompositeCurve extends CurveBase {
158
- type: CompositeCurveType;
159
- segments: OpenCurve[];
160
- }
161
-
162
- declare interface CompositeCurve_2 extends BaseShape {
157
+ export declare interface CompositeCurve extends BaseShape {
163
158
  type: 'curve:composite';
164
159
  segments: OpenCurves[];
165
160
  }
166
161
 
162
+ declare interface CompositeCurve_2 extends CurveBase {
163
+ type: CompositeCurveType;
164
+ segments: OpenCurve[];
165
+ }
166
+
167
167
  declare type CompositeCurveType = typeof CompositeCurveTypeValue;
168
168
 
169
169
  declare const CompositeCurveTypeValue = "curve:composite";
@@ -198,6 +198,10 @@ declare interface CurveBase {
198
198
 
199
199
  declare type CurveType = ClosedCurveType | OpenCurveType;
200
200
 
201
+ declare type CustomAttributeResourceType = 'building' | 'element' | 'floor' | 'layout' | 'product' | 'space';
202
+
203
+ declare type CustomAttributeValueType = 'Text' | 'Number' | 'Boolean';
204
+
201
205
  declare interface CustomStairsParameters {
202
206
  stairsType: CustomStairsType;
203
207
  height: number;
@@ -337,7 +341,7 @@ declare class FloorPlanCore {
337
341
  * @param {*} position - plan position
338
342
  * @returns {Object} - list of spaces and assets
339
343
  */
340
- getResourcesFromPosition(position: Vector2_2): {
344
+ getResourcesFromPosition(position: Vector2): {
341
345
  spaces: LayoutSpace[];
342
346
  assets: LayoutAsset[];
343
347
  };
@@ -453,11 +457,11 @@ export declare class FloorPlanEngine extends FloorPlanCore {
453
457
  /**
454
458
  * Convert screen coordinates to plan coordinates
455
459
  */
456
- getPlanPosition(point: Vector2_2): Vector2_2;
460
+ getPlanPosition(point: Vector2): Vector2;
457
461
  /**
458
462
  * Convert plan coordinates to screen coordinates
459
463
  */
460
- getScreenPosition(point: Vector2_2): Vector2_2;
464
+ getScreenPosition(point: Vector2): Vector2;
461
465
  /**
462
466
  * create plan layer or return existing by id
463
467
  */
@@ -507,12 +511,8 @@ declare type FloorPlanTheme = {
507
511
  grayscale: boolean;
508
512
  };
509
513
  roomStamp?: {
510
- /** @deprecated show the usage information in room stamps */
511
- showUsage?: boolean;
512
- /** @deprecated show the area information in room stamps */
513
- showArea?: boolean;
514
514
  /** show the area information in room stamps */
515
- roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id')[];
515
+ roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id' | ['customAttribute', string])[];
516
516
  /** text color for room stamps */
517
517
  text?: Rgb;
518
518
  /** whether the room stamp text should have an outline to assist with contrast issues */
@@ -546,11 +546,11 @@ declare type FloorPlanTheme = {
546
546
 
547
547
  declare type FpeComputed = {
548
548
  wallContours: PolygonWithHoles[];
549
- snapPoints: Vector2_2[];
549
+ snapPoints: Vector2[];
550
550
  snapMargin: number;
551
551
  };
552
552
 
553
- declare interface FpeConfig extends StartupOptions {
553
+ export declare interface FpeConfig extends StartupOptions {
554
554
  api?: {
555
555
  productDataCacheAge?: number;
556
556
  productContourCacheAge?: number;
@@ -575,14 +575,14 @@ declare type FpeCoreEventMap = {
575
575
  };
576
576
 
577
577
  export declare type FpeDragEvent = {
578
- position: Vector2_2;
579
- screenPos: Vector2_2;
578
+ position: Vector2;
579
+ screenPos: Vector2;
580
580
  sourceEvent: FpeInteractionEvent;
581
581
  };
582
582
 
583
583
  export declare type FpeDropEvent = {
584
- position: Vector2_2;
585
- screenPos: Vector2_2;
584
+ position: Vector2;
585
+ screenPos: Vector2;
586
586
  verticalPos: number;
587
587
  sourceEvent: DragEvent;
588
588
  };
@@ -617,8 +617,8 @@ export declare type FpeEventMap = FpeCoreEventMap & {
617
617
  };
618
618
 
619
619
  declare interface FpeInteraction {
620
- lastSceneClick: Vector2_2;
621
- cursor: Vector2_2;
620
+ lastSceneClick: Vector2;
621
+ cursor: Vector2;
622
622
  cursorTarget: LayoutElement | LayoutSpace;
623
623
  isDragging: boolean;
624
624
  isPanning: boolean;
@@ -630,7 +630,7 @@ declare interface FpeInteraction {
630
630
  ctrlKey: boolean;
631
631
  altKey: boolean;
632
632
  shiftKey: boolean;
633
- dragOffset: Vector2_2;
633
+ dragOffset: Vector2;
634
634
  cursorAction: 'split-wall' | 'duplicate' | 'move' | 'select' | 'none';
635
635
  _dragStart: ScreenPosition;
636
636
  preventFocusoutOnAltKeyup: boolean;
@@ -682,7 +682,7 @@ declare class FpeLoader extends TinyEmitter {
682
682
 
683
683
  export declare type FpePointerEvent = {
684
684
  nodeId?: string;
685
- position: Vector2_2;
685
+ position: Vector2;
686
686
  isDoubleClick?: boolean;
687
687
  sourceEvent: FpeInteractionEvent;
688
688
  };
@@ -853,7 +853,7 @@ declare class Graph {
853
853
 
854
854
  export declare interface GraphicArgs {
855
855
  shapes: Shape[];
856
- position?: Vector2_2;
856
+ position?: Vector2;
857
857
  alpha?: number;
858
858
  clearLayer?: boolean;
859
859
  scale?: number;
@@ -865,7 +865,7 @@ export declare interface GraphicArgs {
865
865
  }
866
866
 
867
867
  declare type GraphicUpdate = {
868
- position?: Vector2_2;
868
+ position?: Vector2;
869
869
  style?: ShapeStyle;
870
870
  shapes?: Shape[];
871
871
  };
@@ -877,6 +877,7 @@ declare class GroupRelation extends SpaceGraphNodeBase {
877
877
  insertElements(elements: LayoutElement[]): void;
878
878
  removeElements(elements: LayoutElement[]): void;
879
879
  copyForClone(product: GroupRelation): void;
880
+ toJSON(): GroupRelationJson;
880
881
  }
881
882
 
882
883
  declare interface GroupRelationJson extends SpaceGraphNodeBaseJson {
@@ -888,9 +889,9 @@ declare type GroupRelationType = typeof GroupRelationTypeValue;
888
889
 
889
890
  declare const GroupRelationTypeValue = "relation:group";
890
891
 
891
- declare interface GroupShape extends BaseShape {
892
+ export declare interface GroupShape extends BaseShape {
892
893
  type: 'group';
893
- position?: Vector2_2;
894
+ position?: Vector2;
894
895
  rotation?: number;
895
896
  children: Shape[];
896
897
  }
@@ -913,9 +914,9 @@ declare type HideableElement = LayoutElement['type'] | LayoutSpace['type'] | Spa
913
914
  declare type HingeSide = 'left' | 'right';
914
915
 
915
916
  declare class HtmlMarker {
916
- position: Vector2_2;
917
- size: Vector2_2;
918
- offset: Vector2_2;
917
+ position: Vector2;
918
+ size: Vector2;
919
+ offset: Vector2;
919
920
  isHidden: boolean;
920
921
  id: string;
921
922
  el: HTMLElement;
@@ -930,12 +931,10 @@ declare class HtmlMarker {
930
931
 
931
932
  declare interface HtmlMarkerArgs {
932
933
  /** coordinates of the window in meters */
933
- position?: Vector2_2;
934
- offset?: Vector2_2;
934
+ position?: Vector2;
935
+ offset?: Vector2;
935
936
  /** html string as content of the info window */
936
937
  el?: HTMLElement;
937
- /** If true , a close button will appear in the top right corner of the info window. */
938
- closeButton?: boolean;
939
938
  }
940
939
 
941
940
  declare interface HtmlMarkerState extends HtmlMarkerArgs {
@@ -950,7 +949,7 @@ declare type IndexRange = {
950
949
 
951
950
  declare class InfoWindow {
952
951
  private _floorPlan;
953
- position: Vector2_2;
952
+ position: Vector2;
954
953
  height: number;
955
954
  width: number;
956
955
  closeButton: any;
@@ -978,7 +977,7 @@ declare interface InfoWindowArgs {
978
977
  /** pixel height of the window - default 80 */
979
978
  height?: number;
980
979
  /** coordinates of the window in meters */
981
- position?: Vector2_2;
980
+ position?: Vector2;
982
981
  /** html string as content of the info window */
983
982
  html?: string;
984
983
  /** If true , a close button will appear in the top right corner of the info window. */
@@ -1085,6 +1084,7 @@ declare class LayoutAnnotationBase extends LayoutNodeBase {
1085
1084
  copyForClone(annotation: LayoutAnnotation): void;
1086
1085
  setTransform(position: Vector3, rotation: number): void;
1087
1086
  setParameters(parameters: RecursivePartial<LayoutAnnotationParameters>): void;
1087
+ toJSON(): LayoutAnnotationJson;
1088
1088
  }
1089
1089
 
1090
1090
  declare interface LayoutAnnotationBaseJson extends LayoutNodeBaseJson {
@@ -1161,7 +1161,8 @@ declare const LayoutBeamTypeValue = "element:beam";
1161
1161
  declare class LayoutBoundary {
1162
1162
  vertices: SpatialGraphVertex[];
1163
1163
  edges: SpatialGraphEdge[];
1164
- geometryProfile: Vector2[];
1164
+ geometryProfile: Vector2_2[];
1165
+ toJSON(): LayoutBoundaryJson;
1165
1166
  }
1166
1167
 
1167
1168
  declare type LayoutBoundaryElement = LayoutBoundarySlab | LayoutBoundaryWall;
@@ -1317,7 +1318,7 @@ declare interface LayoutColumnParameters {
1317
1318
 
1318
1319
  declare type LayoutColumnParametersJson = Partial<LayoutColumnParameters>;
1319
1320
 
1320
- declare type LayoutColumnProfile = RectangleCurve | CircleCurve | PolygonCurve;
1321
+ declare type LayoutColumnProfile = RectangleCurve_2 | CircleCurve_2 | PolygonCurve_2 | PolygonWithHolesCurve_2;
1321
1322
 
1322
1323
  declare type LayoutColumnType = typeof LayoutColumnTypeValue;
1323
1324
 
@@ -1389,7 +1390,7 @@ declare class LayoutEdgeElementBase extends LayoutElementBase {
1389
1390
  getVertices(): SpatialGraphVertex[];
1390
1391
  getStartVertex(): SpatialGraphVertex;
1391
1392
  getEndVertex(): SpatialGraphVertex;
1392
- getAxisPoints(): [Vector2, Vector2];
1393
+ getAxisPoints(): [Vector2_2, Vector2_2];
1393
1394
  getAxisLength(): number;
1394
1395
  getEdgeAtLinearPosition(u: number): SpatialGraphEdge | undefined;
1395
1396
  getEdgesAtLinearSegment(u: number, v: number): SpatialGraphEdge[];
@@ -1433,6 +1434,7 @@ declare class LayoutElementBase extends LayoutNodeBase {
1433
1434
  copyForClone(element: LayoutElement): void;
1434
1435
  setParameters(parameters: RecursivePartial<LayoutElementParameters>): void;
1435
1436
  getSpaces(): LayoutSpace[];
1437
+ toJSON(): LayoutElementJson;
1436
1438
  }
1437
1439
 
1438
1440
  declare interface LayoutElementBaseJson extends LayoutNodeBaseJson {
@@ -1464,7 +1466,7 @@ declare interface LayoutFloorPlanDxfAnnotationJson extends LayoutAnnotationBaseJ
1464
1466
 
1465
1467
  declare interface LayoutFloorPlanDxfParameters {
1466
1468
  uri: string;
1467
- drawingOrigin: Vector2;
1469
+ drawingOrigin: Vector2_2;
1468
1470
  hiddenLayers: string[];
1469
1471
  }
1470
1472
 
@@ -1528,7 +1530,7 @@ declare interface LayoutGenericParameters {
1528
1530
 
1529
1531
  declare type LayoutGenericParametersJson = Partial<LayoutGenericParameters>;
1530
1532
 
1531
- declare type LayoutGenericProfile = 'none' | RectangleCurve | CircleCurve | PolygonCurve;
1533
+ declare type LayoutGenericProfile = 'none' | RectangleCurve_2 | CircleCurve_2 | PolygonCurve_2 | PolygonWithHolesCurve_2;
1532
1534
 
1533
1535
  declare type LayoutGenericType = typeof LayoutGenericTypeValue;
1534
1536
 
@@ -1562,13 +1564,13 @@ declare const LayoutKitchenTypeValue = "element:kitchen";
1562
1564
 
1563
1565
  declare type LayoutNode = SpatialGraphNode | LayoutSpace | LayoutElement | LayoutAnnotation | LayoutView;
1564
1566
 
1565
- declare class LayoutNodeBase extends SpaceGraphNodeBase {
1567
+ declare class LayoutNodeBase extends SpaceGraphNodeWithCustomAttributesBase {
1566
1568
  type: LayoutNodeType;
1567
1569
  layout: SpaceGraphLayout;
1568
1570
  constructor(id: string, type: LayoutNodeType);
1569
1571
  }
1570
1572
 
1571
- declare interface LayoutNodeBaseJson extends SpaceGraphNodeBaseJson {
1573
+ declare interface LayoutNodeBaseJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
1572
1574
  type: LayoutNodeType;
1573
1575
  }
1574
1576
 
@@ -1623,8 +1625,8 @@ declare interface LayoutOpeningMaterials {
1623
1625
  }
1624
1626
 
1625
1627
  declare interface LayoutOpeningParameters {
1626
- position: Vector2;
1627
- dimensions: Vector2;
1628
+ position: Vector2_2;
1629
+ dimensions: Vector2_2;
1628
1630
  materials: LayoutOpeningMaterials;
1629
1631
  }
1630
1632
 
@@ -1733,7 +1735,7 @@ declare interface LayoutSlabParameters {
1733
1735
 
1734
1736
  declare type LayoutSlabParametersJson = Partial<LayoutSlabParameters>;
1735
1737
 
1736
- declare type LayoutSlabProfile = RectangleCurve | CircleCurve | PolygonCurve;
1738
+ declare type LayoutSlabProfile = RectangleCurve_2 | CircleCurve_2 | PolygonCurve_2 | PolygonWithHolesCurve_2;
1737
1739
 
1738
1740
  declare type LayoutSlabType = typeof LayoutSlabTypeValue;
1739
1741
 
@@ -1765,6 +1767,7 @@ declare class LayoutSpace extends LayoutNodeBase {
1765
1767
  getBoundingBox(): TransformBoundingBox3d;
1766
1768
  attachSlab(slab: LayoutBoundarySlab): void;
1767
1769
  detachSlab(slab: LayoutBoundarySlab): void;
1770
+ toJSON(): LayoutSpaceJson;
1768
1771
  }
1769
1772
 
1770
1773
  declare interface LayoutSpaceAttributes {
@@ -1804,7 +1807,7 @@ declare type LayoutSpaceDividerType = typeof LayoutSpaceDividerTypeValue;
1804
1807
  declare const LayoutSpaceDividerTypeValue = "element:spaceDivider";
1805
1808
 
1806
1809
  declare interface LayoutSpaceGeometry {
1807
- polygons: Vector2[][];
1810
+ polygons: Vector2_2[][];
1808
1811
  }
1809
1812
 
1810
1813
  declare interface LayoutSpaceJson extends LayoutNodeBaseJson {
@@ -1845,6 +1848,7 @@ declare class LayoutSpatialGraph {
1845
1848
  createVertex(id: string, x: number, y: number): SpatialGraphVertex;
1846
1849
  createEdge(id: string, vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex, splitSpace?: boolean): SpatialGraphEdge;
1847
1850
  createEdgeByVertexIds(id: string, vertexId1: string, vertexId2: string, splitSpace?: boolean): SpatialGraphEdge;
1851
+ toJSON(): LayoutSpatialGraphJson;
1848
1852
  }
1849
1853
 
1850
1854
  declare interface LayoutSpatialGraphJson {
@@ -1959,6 +1963,7 @@ declare class LayoutViewBase extends LayoutNodeBase {
1959
1963
  parameters: LayoutViewParameters;
1960
1964
  copyForClone(view: LayoutView): void;
1961
1965
  setParameters(parameters: RecursivePartial<LayoutViewParameters>): void;
1966
+ toJSON(): LayoutViewJson;
1962
1967
  }
1963
1968
 
1964
1969
  declare interface LayoutViewBaseJson extends LayoutNodeBaseJson {
@@ -1992,11 +1997,11 @@ declare interface LayoutWallGeometryProfile {
1992
1997
  valid: boolean;
1993
1998
  skipped: boolean;
1994
1999
  selfIntersecting: boolean;
1995
- sidePoints1: Vector2[];
1996
- sidePoints2: Vector2[];
1997
- joinPoints1: Vector2[];
1998
- joinPoints2: Vector2[];
1999
- points: Vector2[];
2000
+ sidePoints1: Vector2_2[];
2001
+ sidePoints2: Vector2_2[];
2002
+ joinPoints1: Vector2_2[];
2003
+ joinPoints2: Vector2_2[];
2004
+ points: Vector2_2[];
2000
2005
  }
2001
2006
 
2002
2007
  declare interface LayoutWallJson extends LayoutEdgeElementBaseJson {
@@ -2052,14 +2057,14 @@ declare type LayoutWindowType = typeof LayoutWindowTypeValue;
2052
2057
 
2053
2058
  declare const LayoutWindowTypeValue = "element:window";
2054
2059
 
2055
- declare interface LineCurve extends CurveBase {
2056
- type: LineCurveType;
2060
+ export declare interface LineCurve extends BaseShape {
2061
+ type: 'curve:line';
2057
2062
  start: Vector2;
2058
2063
  end: Vector2;
2059
2064
  }
2060
2065
 
2061
- declare interface LineCurve_2 extends BaseShape {
2062
- type: 'curve:line';
2066
+ declare interface LineCurve_2 extends CurveBase {
2067
+ type: LineCurveType;
2063
2068
  start: Vector2_2;
2064
2069
  end: Vector2_2;
2065
2070
  }
@@ -2072,7 +2077,7 @@ declare type LoadingEvent = 'loading-done' | 'loading-status' | 'resource-loaded
2072
2077
 
2073
2078
  declare interface MarkerArgs {
2074
2079
  /** coordinates of the marker in meters */
2075
- position?: Vector2_2;
2080
+ position?: Vector2;
2076
2081
  /** color of the marker, hex code */
2077
2082
  color?: string;
2078
2083
  /** size in pixels */
@@ -2081,7 +2086,7 @@ declare interface MarkerArgs {
2081
2086
  }
2082
2087
 
2083
2088
  declare class MarkerPin {
2084
- position: Vector2_2;
2089
+ position: Vector2;
2085
2090
  color: string;
2086
2091
  size: number;
2087
2092
  id: string;
@@ -2146,9 +2151,9 @@ declare interface NumberRange extends SpaceGraphTypedValueJson {
2146
2151
  };
2147
2152
  }
2148
2153
 
2149
- declare type OpenCurve = LineCurve | PolylineCurve | ArcCurve;
2154
+ declare type OpenCurve = LineCurve_2 | PolylineCurve_2 | ArcCurve_2;
2150
2155
 
2151
- declare type OpenCurves = LineCurve_2 | ArcCurve_2 | PolylineCurve_2 | BezierCurve;
2156
+ declare type OpenCurves = LineCurve | ArcCurve | PolylineCurve | BezierCurve;
2152
2157
 
2153
2158
  declare type OpenCurveType = LineCurveType | PolylineCurveType | ArcCurveType;
2154
2159
 
@@ -2257,40 +2262,49 @@ declare class PlanLayer {
2257
2262
  destroy(): void;
2258
2263
  }
2259
2264
 
2260
- declare type Polygon = Vector2_2[];
2265
+ export declare type Polygon = Vector2[];
2261
2266
 
2262
- declare interface PolygonCurve extends CurveBase {
2263
- type: PolygonCurveType;
2264
- points: Vector2[];
2265
- }
2266
-
2267
- declare interface PolygonCurve_2 extends BaseShape {
2267
+ export declare interface PolygonCurve extends BaseShape {
2268
2268
  type: 'curve:polygon';
2269
2269
  points: Polygon;
2270
2270
  }
2271
2271
 
2272
+ declare interface PolygonCurve_2 extends CurveBase {
2273
+ type: PolygonCurveType;
2274
+ points: Vector2_2[];
2275
+ }
2276
+
2272
2277
  declare type PolygonCurveType = typeof PolygonCurveTypeValue;
2273
2278
 
2274
2279
  declare const PolygonCurveTypeValue = "curve:polygon";
2275
2280
 
2276
2281
  /** outer ring counter clockwise, inner rings ( holes ) clockwise */
2277
- declare type PolygonWithHoles = Polygon[];
2282
+ export declare type PolygonWithHoles = Polygon[];
2278
2283
 
2279
- declare interface PolygonWithHolesCurve extends BaseShape {
2284
+ export declare interface PolygonWithHolesCurve extends BaseShape {
2280
2285
  type: 'curve:polygonWithHoles';
2281
2286
  polygons: PolygonWithHoles;
2282
2287
  }
2283
2288
 
2284
- declare interface PolylineCurve extends CurveBase {
2285
- type: PolylineCurveType;
2286
- points: Vector2[];
2289
+ declare interface PolygonWithHolesCurve_2 extends CurveBase {
2290
+ type: PolygonWithHolesCurveType;
2291
+ polygons: Vector2_2[][];
2287
2292
  }
2288
2293
 
2289
- declare interface PolylineCurve_2 extends BaseShape {
2294
+ declare type PolygonWithHolesCurveType = typeof PolygonWithHolesCurveTypeValue;
2295
+
2296
+ declare const PolygonWithHolesCurveTypeValue = "curve:polygonWithHoles";
2297
+
2298
+ export declare interface PolylineCurve extends BaseShape {
2290
2299
  type: 'curve:polyline';
2291
2300
  points: Polygon;
2292
2301
  }
2293
2302
 
2303
+ declare interface PolylineCurve_2 extends CurveBase {
2304
+ type: PolylineCurveType;
2305
+ points: Vector2_2[];
2306
+ }
2307
+
2294
2308
  declare type PolylineCurveType = typeof PolylineCurveTypeValue;
2295
2309
 
2296
2310
  declare const PolylineCurveTypeValue = "curve:polyline";
@@ -2299,17 +2313,17 @@ declare type PositionEntry = Vector3 | Vector3List | Vector3Range;
2299
2313
 
2300
2314
  declare type ProductAttributes = SpaceGraphProduct['attributes'];
2301
2315
 
2302
- declare interface RectangleCurve extends CurveBase {
2303
- type: RectangleCurveType;
2304
- dimensions: Vector2;
2305
- }
2306
-
2307
- declare interface RectangleCurve_2 extends BaseShape {
2316
+ export declare interface RectangleCurve extends BaseShape {
2308
2317
  type: 'curve:rectangle';
2309
- position: Vector2_2;
2318
+ position: Vector2;
2310
2319
  dimensions: [number, number];
2311
2320
  }
2312
2321
 
2322
+ declare interface RectangleCurve_2 extends CurveBase {
2323
+ type: RectangleCurveType;
2324
+ dimensions: Vector2_2;
2325
+ }
2326
+
2313
2327
  declare type RectangleCurveType = typeof RectangleCurveTypeValue;
2314
2328
 
2315
2329
  declare const RectangleCurveTypeValue = "curve:rectangle";
@@ -2372,7 +2386,7 @@ declare type ScreenPosition = {
2372
2386
 
2373
2387
  export declare const setApiUrls: ({ apiStorageUrl: newApiStorageUrl, spaceApiUrl, apiProductDataPath: newApiProductDataPath }?: ApiUrls) => void;
2374
2388
 
2375
- export declare type Shape = PolygonCurve_2 | PolygonWithHolesCurve | PolylineCurve_2 | RectangleCurve_2 | CircleCurve_2 | LineCurve_2 | GroupShape | TextShape | ArcCurve_2 | BezierCurve | CompositeCurve_2;
2389
+ export declare type Shape = PolygonCurve | PolygonWithHolesCurve | PolylineCurve | RectangleCurve | CircleCurve | LineCurve | GroupShape | TextShape | ArcCurve | BezierCurve | CompositeCurve;
2376
2390
 
2377
2391
  declare type ShapeLayers = Record<string, Shape[]>;
2378
2392
 
@@ -2383,6 +2397,7 @@ declare interface ShapeStyle {
2383
2397
  fill?: string | number | number[] | false;
2384
2398
  fillOpacity?: number;
2385
2399
  dash?: boolean;
2400
+ alignment?: 0 | 0.5 | 1;
2386
2401
  }
2387
2402
 
2388
2403
  declare class SpaceGraph {
@@ -2392,6 +2407,11 @@ declare class SpaceGraph {
2392
2407
  productsByType: NodesByType<{
2393
2408
  readonly 'product:static': typeof SpaceGraphProduct;
2394
2409
  }>;
2410
+ customAttributes: SpaceGraphCustomAttribute[];
2411
+ customAttributesById: Record<string, SpaceGraphCustomAttribute>;
2412
+ customAttributesByType: NodesByType<{
2413
+ readonly 'customAttribute:definition': typeof SpaceGraphCustomAttribute;
2414
+ }>;
2395
2415
  geometries: SpaceGraphGeometryJson[];
2396
2416
  geometriesById: Record<string, SpaceGraphGeometryJson>;
2397
2417
  geometriesByType: NodesByType<{
@@ -2491,11 +2511,14 @@ declare class SpaceGraph {
2491
2511
  insertRelation(relation: SpaceGraphRelation): void;
2492
2512
  removeRelation(relation: SpaceGraphRelation): void;
2493
2513
  createRelation(type: SpaceGraphRelationType, id: string): SpaceGraphRelation;
2514
+ insertCustomAttribute(customAttribute: SpaceGraphCustomAttribute): void;
2515
+ removeCustomAttribute(customAttribute: SpaceGraphCustomAttribute): void;
2494
2516
  getId(): string;
2495
2517
  emit<EventType extends keyof SpaceGraphEventMap>(event: EventType, ...args: SpaceGraphEventMap[EventType]): void;
2496
2518
  on<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler: (...args: SpaceGraphEventMap[EventType]) => void, context?: any): void;
2497
2519
  once<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler: (...args: SpaceGraphEventMap[EventType]) => void, context?: any): void;
2498
2520
  off<EventType extends keyof SpaceGraphEventMap>(event: EventType, handler?: (...args: SpaceGraphEventMap[EventType]) => void): void;
2521
+ toJSON(): SpaceGraphJson;
2499
2522
  }
2500
2523
 
2501
2524
  declare class SpaceGraphBasicMaterial extends SpaceGraphNodeBase {
@@ -2506,6 +2529,7 @@ declare class SpaceGraphBasicMaterial extends SpaceGraphNodeBase {
2506
2529
  opacity: number;
2507
2530
  constructor(id: string);
2508
2531
  copyForClone(material: SpaceGraphBasicMaterial): void;
2532
+ toJSON(): SpaceGraphMaterialResourceJson;
2509
2533
  }
2510
2534
 
2511
2535
  declare interface SpaceGraphBasicMaterialJson extends SpaceGraphMaterialBaseJson {
@@ -2529,6 +2553,7 @@ declare class SpaceGraphBuilding extends SpaceGraphSpatialStructureBase {
2529
2553
  insertFloor(floor: SpaceGraphFloor): void;
2530
2554
  removeFloor(floor: SpaceGraphFloor): void;
2531
2555
  createFloor(id: string): SpaceGraphFloor;
2556
+ toJSON(): SpaceGraphBuildingJson;
2532
2557
  }
2533
2558
 
2534
2559
  declare interface SpaceGraphBuildingJson extends SpaceGraphSpatialStructureBaseJson {
@@ -2546,6 +2571,7 @@ declare class SpaceGraphColorMaterial extends SpaceGraphNodeBase {
2546
2571
  color: Rgb;
2547
2572
  opacity: number;
2548
2573
  constructor(id: string, color?: Rgb, opacity?: number);
2574
+ toJSON(): SpaceGraphMaterialResourceJson;
2549
2575
  }
2550
2576
 
2551
2577
  declare interface SpaceGraphColorMaterialJson extends SpaceGraphMaterialBaseJson {
@@ -2557,11 +2583,53 @@ declare type SpaceGraphColorMaterialType = typeof SpaceGraphColorMaterialTypeVal
2557
2583
 
2558
2584
  declare const SpaceGraphColorMaterialTypeValue = "material:color";
2559
2585
 
2586
+ declare class SpaceGraphCustomAttribute extends SpaceGraphNodeBase {
2587
+ type: SpaceGraphCustomAttributeType;
2588
+ attributes: SpaceGraphCustomAttributeAttributes;
2589
+ constructor(id: string, attributesJson?: SpaceGraphCustomAttributeAttributesJson);
2590
+ setAttributes(attributesJson: SpaceGraphCustomAttributeAttributesJson): void;
2591
+ copyForClone(customAttribute: SpaceGraphCustomAttribute): void;
2592
+ toJSON(): SpaceGraphCustomAttributeJson;
2593
+ }
2594
+
2595
+ declare type SpaceGraphCustomAttributeAttributes = {
2596
+ resourceType: CustomAttributeResourceType;
2597
+ valueType: CustomAttributeValueType;
2598
+ updatedAt?: string;
2599
+ description?: string;
2600
+ };
2601
+
2602
+ declare type SpaceGraphCustomAttributeAttributesJson = {
2603
+ resourceType: CustomAttributeResourceType;
2604
+ valueType: CustomAttributeValueType;
2605
+ updatedAt?: string;
2606
+ /** @minLength 3 @maxLength 200 @type string */
2607
+ description?: string;
2608
+ };
2609
+
2610
+ declare interface SpaceGraphCustomAttributeJson extends SpaceGraphNodeBaseJson {
2611
+ /** @type string @minLength 3 @maxLength 50 @pattern ^(?![_-])[A-Za-z0-9_-]*$ */
2612
+ id: string;
2613
+ /** @minLength 3 @maxLength 30 @type string */
2614
+ name: string;
2615
+ type: SpaceGraphCustomAttributeType;
2616
+ attributes: SpaceGraphCustomAttributeAttributesJson;
2617
+ }
2618
+
2619
+ declare type SpaceGraphCustomAttributeType = typeof SpaceGraphCustomAttributeTypeValue;
2620
+
2621
+ declare const SpaceGraphCustomAttributeTypeValue = "customAttribute:definition";
2622
+
2623
+ declare type SpaceGraphCustomAttributeValue = Record<string, string>;
2624
+
2625
+ declare type SpaceGraphCustomAttributeValueJson = Record<string, string | null>;
2626
+
2560
2627
  declare class SpaceGraphEmbeddedMaterial extends SpaceGraphNodeBase {
2561
2628
  type: SpaceGraphEmbeddedMaterialType;
2562
2629
  reference: string;
2563
2630
  format: SpaceGraphEmbeddedMaterialFormat;
2564
2631
  constructor(id: string, reference: string, format: SpaceGraphEmbeddedMaterialFormat);
2632
+ toJSON(): SpaceGraphMaterialResourceJson;
2565
2633
  }
2566
2634
 
2567
2635
  declare type SpaceGraphEmbeddedMaterialFormat = 'data3d';
@@ -2579,8 +2647,11 @@ declare interface SpaceGraphEventMap {
2579
2647
  'material-delete': [SpaceGraphMaterial];
2580
2648
  'relation-create': [SpaceGraphRelation];
2581
2649
  'relation-delete': [SpaceGraphRelation];
2650
+ 'custom-attribute-create': [SpaceGraphCustomAttribute];
2651
+ 'custom-attribute-delete': [SpaceGraphCustomAttribute];
2582
2652
  'node-id-change': [SpaceGraphNodeBase, string];
2583
2653
  'node-property-change': [SpaceGraphNodeBase, string];
2654
+ 'node-custom-attributes-change': [SpaceGraphNodeBase];
2584
2655
  'vertex-create': [SpatialGraphVertex];
2585
2656
  'vertex-delete': [SpatialGraphVertex];
2586
2657
  'vertex-add-edge': [SpatialGraphVertex, SpatialGraphEdge];
@@ -2599,6 +2670,7 @@ declare interface SpaceGraphEventMap {
2599
2670
  'element-delete': [LayoutElement];
2600
2671
  'element-parameters-change': [LayoutElementBase];
2601
2672
  'element-transform-change': [LayoutTransformElementBase];
2673
+ 'element-edges-change': [LayoutEdgeElementBase];
2602
2674
  'annotation-create': [LayoutAnnotation];
2603
2675
  'annotation-delete': [LayoutAnnotation];
2604
2676
  'annotation-transform-change': [LayoutAnnotationBase];
@@ -2621,6 +2693,7 @@ declare class SpaceGraphFloor extends SpaceGraphSpatialStructureBase {
2621
2693
  insertLayout(layout: SpaceGraphLayout): void;
2622
2694
  removeLayout(layout: SpaceGraphLayout): void;
2623
2695
  createLayout(id: string): SpaceGraphLayout;
2696
+ toJSON(): SpaceGraphFloorJson;
2624
2697
  }
2625
2698
 
2626
2699
  declare interface SpaceGraphFloorJson extends SpaceGraphSpatialStructureBaseJson {
@@ -2724,6 +2797,7 @@ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
2724
2797
  getSpaceId(prefix?: string): string;
2725
2798
  getElementId(element: LayoutElement, prefix?: string): string;
2726
2799
  getBoundingBox(): TransformBoundingBox3d;
2800
+ toJSON(): SpaceGraphLayoutJson;
2727
2801
  }
2728
2802
 
2729
2803
  declare interface SpaceGraphLayoutJson extends SpaceGraphSpatialStructureBaseJson {
@@ -2736,7 +2810,7 @@ declare interface SpaceGraphLayoutJson extends SpaceGraphSpatialStructureBaseJso
2736
2810
  }
2737
2811
 
2738
2812
  declare type SpaceGraphLocation = {
2739
- latLong: Vector2;
2813
+ latLong: Vector2_2;
2740
2814
  rotation: number;
2741
2815
  };
2742
2816
 
@@ -2750,7 +2824,7 @@ declare type SpaceGraphMaterialJson = Rgb | RgbA | string | SpaceGraphMaterialRe
2750
2824
 
2751
2825
  declare type SpaceGraphMaterialResourceJson = SpaceGraphColorMaterialJson | SpaceGraphStandardMaterialJson | SpaceGraphBasicMaterialJson;
2752
2826
 
2753
- declare type SpaceGraphNode = SpaceGraphProduct | SpaceGraphGeometry | SpaceGraphMaterial | SpaceGraphRelation | SpaceGraphBuilding | SpaceGraphFloor | LayoutNode | SpaceGraphLayout | LayoutAnnotation;
2827
+ declare type SpaceGraphNode = SpaceGraphProduct | SpaceGraphGeometry | SpaceGraphMaterial | SpaceGraphRelation | SpaceGraphCustomAttribute | SpaceGraphBuilding | SpaceGraphFloor | LayoutNode | SpaceGraphLayout | LayoutAnnotation;
2754
2828
 
2755
2829
  declare class SpaceGraphNodeBase extends SpaceGraphTypedValue {
2756
2830
  id: string;
@@ -2761,6 +2835,7 @@ declare class SpaceGraphNodeBase extends SpaceGraphTypedValue {
2761
2835
  setName(name: string): void;
2762
2836
  setCustomId(customId: string): void;
2763
2837
  emit<EventType extends keyof SpaceGraphEventMap>(event: EventType, ...args: SpaceGraphEventMap[EventType]): void;
2838
+ toJSON(): SpaceGraphNodeBaseJson;
2764
2839
  }
2765
2840
 
2766
2841
  declare interface SpaceGraphNodeBaseJson extends SpaceGraphTypedValueJson {
@@ -2770,13 +2845,28 @@ declare interface SpaceGraphNodeBaseJson extends SpaceGraphTypedValueJson {
2770
2845
  customId?: string;
2771
2846
  }
2772
2847
 
2773
- declare class SpaceGraphProduct extends SpaceGraphNodeBase {
2848
+ declare type SpaceGraphNodeWithCustomAttributes = LayoutNode | SpaceGraphSpatialStructure | SpaceGraphProduct;
2849
+
2850
+ declare class SpaceGraphNodeWithCustomAttributesBase extends SpaceGraphNodeBase {
2851
+ customAttributes: SpaceGraphCustomAttributeValue;
2852
+ constructor(id: string, type: string);
2853
+ setCustomAttributes(customAttributes?: SpaceGraphCustomAttributeValueJson | null, customAttributesById?: Record<string, SpaceGraphCustomAttribute>): void;
2854
+ toJSON(): SpaceGraphNodeWithCustomAttributesBaseJson;
2855
+ copyForClone(node: SpaceGraphNodeWithCustomAttributes): void;
2856
+ }
2857
+
2858
+ declare interface SpaceGraphNodeWithCustomAttributesBaseJson extends SpaceGraphNodeBaseJson {
2859
+ customAttributes?: SpaceGraphCustomAttributeValueJson | null;
2860
+ }
2861
+
2862
+ declare class SpaceGraphProduct extends SpaceGraphNodeWithCustomAttributesBase {
2774
2863
  type: SpaceGraphProductType;
2775
2864
  attributes: SpaceGraphProductAttributes;
2776
2865
  geometries: GeometryOperationJson[];
2777
2866
  constructor(id: string);
2778
2867
  copyForClone(product: SpaceGraphProduct): void;
2779
2868
  setAttributes(attributesJson: SpaceGraphProductAttributesJson): void;
2869
+ toJSON(): SpaceGraphProductJson;
2780
2870
  }
2781
2871
 
2782
2872
  declare type SpaceGraphProductAttributes = {
@@ -2799,7 +2889,7 @@ declare type SpaceGraphProductAttributesJson = {
2799
2889
  updatedAt?: string;
2800
2890
  };
2801
2891
 
2802
- declare interface SpaceGraphProductJson extends SpaceGraphNodeBaseJson {
2892
+ declare interface SpaceGraphProductJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
2803
2893
  type: SpaceGraphProductType;
2804
2894
  attributes?: SpaceGraphProductAttributesJson;
2805
2895
  geometries: GeometryOperationJson[];
@@ -2820,16 +2910,17 @@ declare interface SpaceGraphSharedResourcesJson {
2820
2910
  geometries: SpaceGraphGeometryJson[];
2821
2911
  materials: SpaceGraphMaterialResourceJson[];
2822
2912
  relations: SpaceGraphRelationJson[];
2913
+ customAttributes?: SpaceGraphCustomAttributeJson[];
2823
2914
  }
2824
2915
 
2825
2916
  declare type SpaceGraphSpatialStructure = SpaceGraphBuilding | SpaceGraphFloor | SpaceGraphLayout;
2826
2917
 
2827
- declare class SpaceGraphSpatialStructureBase extends SpaceGraphNodeBase {
2918
+ declare class SpaceGraphSpatialStructureBase extends SpaceGraphNodeWithCustomAttributesBase {
2828
2919
  type: SpaceGraphSpatialStructureType;
2829
2920
  constructor(id: string, type: SpaceGraphSpatialStructureType);
2830
2921
  }
2831
2922
 
2832
- declare interface SpaceGraphSpatialStructureBaseJson extends SpaceGraphNodeBaseJson {
2923
+ declare interface SpaceGraphSpatialStructureBaseJson extends SpaceGraphNodeWithCustomAttributesBaseJson {
2833
2924
  type: SpaceGraphSpatialStructureType;
2834
2925
  }
2835
2926
 
@@ -2841,6 +2932,7 @@ declare class SpaceGraphStandardMaterial extends SpaceGraphNodeBase {
2841
2932
  type: SpaceGraphStandardMaterialType;
2842
2933
  reference: string;
2843
2934
  constructor(id: string, reference: string);
2935
+ toJSON(): SpaceGraphMaterialResourceJson;
2844
2936
  }
2845
2937
 
2846
2938
  declare interface SpaceGraphStandardMaterialJson extends SpaceGraphMaterialBaseJson {
@@ -2886,13 +2978,14 @@ declare class SpatialGraphEdge extends SpatialGraphNodeBase {
2886
2978
  boundaryWalls: [LayoutBoundaryWall | null, LayoutBoundaryWall | null];
2887
2979
  element: LayoutEdgeElement | null;
2888
2980
  constructor(id: string, vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex);
2889
- getPoints(): [Vector2_2, Vector2_2];
2981
+ getPoints(): [Vector2, Vector2];
2890
2982
  setVertices(vertex1: SpatialGraphVertex, vertex2: SpatialGraphVertex): void;
2891
2983
  setVerticesByIds(vertexId1: string, vertexId2: string): void;
2892
2984
  canSplit(u: number, options?: EdgeCanSplitOptions): boolean;
2893
2985
  split(u: number, options?: EdgeSplitOptions, updateSpaceBoundaries?: boolean): EdgeSplitReturnValue;
2894
2986
  canMerge(edge: SpatialGraphEdge): boolean;
2895
2987
  merge(edge: SpatialGraphEdge, updateSpaceBoundaries?: boolean): void;
2988
+ toJSON(): SpatialGraphEdgeJson;
2896
2989
  }
2897
2990
 
2898
2991
  declare interface SpatialGraphEdgeJson extends SpatialGraphNodeBaseJson {
@@ -2916,18 +3009,19 @@ declare type SpatialGraphNodeType = SpatialGraphVertexType | SpatialGraphEdgeTyp
2916
3009
 
2917
3010
  declare class SpatialGraphVertex extends SpatialGraphNodeBase {
2918
3011
  type: SpatialGraphVertexType;
2919
- position: Vector2;
3012
+ position: Vector2_2;
2920
3013
  edges: SpatialGraphEdge[];
2921
3014
  constructor(id: string, x: number, y: number);
2922
3015
  sortVertexEdges(): void;
2923
3016
  addEdge(edge: SpatialGraphEdge): void;
2924
3017
  removeEdge(edge: SpatialGraphEdge): void;
2925
3018
  setPosition(x: number, y: number): void;
3019
+ toJSON(): SpatialGraphVertexJson;
2926
3020
  }
2927
3021
 
2928
3022
  declare interface SpatialGraphVertexJson extends SpatialGraphNodeBaseJson {
2929
3023
  type: SpatialGraphVertexType;
2930
- position: Vector2;
3024
+ position: Vector2_2;
2931
3025
  }
2932
3026
 
2933
3027
  declare type SpatialGraphVertexType = typeof SpatialGraphVertexTypeValue;
@@ -3046,9 +3140,9 @@ declare interface TemporaryAccessToken {
3046
3140
 
3047
3141
  declare type TemporaryAccessTokenFunction = (args: CreateTemporaryAccessToken) => Promise<TemporaryAccessToken>;
3048
3142
 
3049
- declare interface TextShape extends BaseShape {
3143
+ export declare interface TextShape extends BaseShape {
3050
3144
  type: 'text';
3051
- position: Vector2_2;
3145
+ position: Vector2;
3052
3146
  text: string;
3053
3147
  rotation?: number;
3054
3148
  alignV?: 'center' | 'bottom' | 'top';
@@ -3183,7 +3277,7 @@ declare type UriGeometryType = typeof UriGeometryTypeValue;
3183
3277
 
3184
3278
  declare const UriGeometryTypeValue = "geometry:uri";
3185
3279
 
3186
- declare type Vector2 = [number, number];
3280
+ export declare type Vector2 = [number, number];
3187
3281
 
3188
3282
  declare type Vector2_2 = [number, number];
3189
3283
 
@@ -3206,9 +3300,9 @@ declare interface Vector3Range extends SpaceGraphTypedValueJson {
3206
3300
  declare type ViewEvent = 'pan' | 'zoom' | 'viewbox' | 'resize-canvas' | 'scene-rendered' | 'focus';
3207
3301
 
3208
3302
  declare class WebGlView extends TinyEmitter {
3209
- windowPos: Vector2_2;
3303
+ windowPos: Vector2;
3210
3304
  zoom: number;
3211
- client: Vector2_2;
3305
+ client: Vector2;
3212
3306
  layers: Map<string, PlanLayer>;
3213
3307
  viewbox: BoundingBox2d;
3214
3308
  styleCache: Record<string, ShapeStyle | 'selected'>;