@archilogic/extension-sdk 0.12.0 → 0.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @archilogic/extension-sdk
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b13c0d8: feat: add support for exportSvg
8
+
3
9
  ## 0.12.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -711,8 +711,21 @@ declare type EntityResult = {
711
711
  declare interface ExportPdfOptions {
712
712
  orientation: 'landscape' | 'portrait';
713
713
  format: 'a4' | 'a3' | 'letter';
714
+ skipDownload?: boolean;
714
715
  }
715
716
 
717
+ declare type ExportPdfResult = {
718
+ data: ArrayBuffer;
719
+ };
720
+
721
+ declare interface ExportSvgOptions {
722
+ skipDownload?: boolean;
723
+ }
724
+
725
+ declare type ExportSvgResult = {
726
+ data: string;
727
+ };
728
+
716
729
  export declare type ExtensionApi = {
717
730
  onConnect(parameters?: Record<string, unknown>): Promise<unknown> | void;
718
731
  onDestroy(): void;
@@ -1168,7 +1181,8 @@ export declare type HostApi = {
1168
1181
  nodeIds: string[];
1169
1182
  }) => Promise<NodeResult[]>;
1170
1183
  getSpaceGraphJson: () => Promise<SpaceGraphJson>;
1171
- exportPdf: (args?: ExportPdfOptions) => Promise<void>;
1184
+ exportPdf: (args?: ExportPdfOptions) => Promise<void | ExportPdfResult>;
1185
+ exportSvg: (args?: ExportSvgOptions) => Promise<void | ExportSvgResult>;
1172
1186
  getPath: (args: {
1173
1187
  start: Vector2;
1174
1188
  end: Vector2;
@@ -2030,6 +2044,7 @@ declare class LayoutSpace extends LayoutBoundingBoxNode {
2030
2044
  get isExternal(): boolean;
2031
2045
  calculateArea(): number;
2032
2046
  getArea(): number;
2047
+ setPolygons(polygons: Vector2[][]): void;
2033
2048
  getAdjacentSpaces(graph: Graph, { connectivity }?: {
2034
2049
  connectivity?: number;
2035
2050
  }): LayoutSpace[];
@@ -3282,7 +3297,7 @@ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
3282
3297
  spacesById: Record<string, LayoutSpace>;
3283
3298
  elements: LayoutElement[];
3284
3299
  elementsById: Record<string, LayoutElement>;
3285
- elementsByType: NodesByType< {
3300
+ elementsByType: NodesByType<{
3286
3301
  readonly 'element:ceiling': typeof LayoutBoundarySlab;
3287
3302
  readonly 'element:floor': typeof LayoutBoundarySlab;
3288
3303
  readonly 'element:boundaryWall': typeof LayoutBoundaryWall;
@@ -3307,13 +3322,13 @@ declare class SpaceGraphLayout extends SpaceGraphSpatialStructureBase {
3307
3322
  }>;
3308
3323
  annotations: LayoutAnnotation[];
3309
3324
  annotationsById: Record<string, LayoutAnnotation>;
3310
- annotationsByType: NodesByType< {
3325
+ annotationsByType: NodesByType<{
3311
3326
  readonly 'annotation:floorPlanDxf': LayoutFloorPlanDxfAnnotation;
3312
3327
  readonly 'annotation:floorPlanImage': LayoutFloorPlanImageAnnotation;
3313
3328
  }>;
3314
3329
  views: LayoutView[];
3315
3330
  viewsById: Record<string, LayoutView>;
3316
- viewsByType: NodesByType< {
3331
+ viewsByType: NodesByType<{
3317
3332
  readonly 'view:2d': Layout2dView;
3318
3333
  readonly 'view:3d': Layout3dView;
3319
3334
  }>;
@@ -3690,7 +3705,14 @@ declare const SpatialGraphVertexTypeValue = "spatialGraph:vertex";
3690
3705
  * ```
3691
3706
  */
3692
3707
  declare class SpatialIndex extends default_2<IndexedNodeReference> {
3693
- nodeIds: Set<string>;
3708
+ /**
3709
+ * Maps a node id to the bounding box reference that was actually inserted into
3710
+ * the tree. We need the exact inserted reference (with its original
3711
+ * coordinates) to remove it again: RBush navigates the tree using the item's
3712
+ * bounding box, so removing with a node's *current* (moved) bounding box can
3713
+ * fail to locate the stale entry, leaving duplicates behind.
3714
+ */
3715
+ indexedNodesById: Map<string, IndexedNodeReference>;
3694
3716
  layout: SpaceGraphLayout;
3695
3717
  constructor(layout: SpaceGraphLayout);
3696
3718
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@archilogic/extension-sdk",
3
3
  "description": "",
4
- "version": "0.12.0",
4
+ "version": "0.13.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,4 +33,4 @@
33
33
  "vite-plugin-static-copy": "^3.1.4"
34
34
  },
35
35
  "nx": {}
36
- }
36
+ }