@snaptrude/plugin-core 0.2.7 → 0.2.9

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,15 @@
1
+ import { PluginDocumentationAIInspirationApi } from "./aiInspiration"
2
+
3
+ /**
4
+ * Present documentation APIs for Snaptrude plugins.
5
+ *
6
+ * Accessed via `snaptrude.documentation`.
7
+ */
8
+ export abstract class PluginDocumentationApi {
9
+ /** AI Inspiration image, video, workflow, and recipe APIs. */
10
+ public abstract aiInspiration: PluginDocumentationAIInspirationApi
11
+
12
+ constructor() {}
13
+ }
14
+
15
+ export * from "./aiInspiration"
@@ -320,7 +320,8 @@ export abstract class PluginSpaceApi {
320
320
  *
321
321
  * Each item targets an existing space by `spaceId` and may change its
322
322
  * geometry (`profile` + `extrudeHeight`, which must be supplied together) and/or
323
- * its `properties` (`room_type`, `massType`, `spaceType`, `departmentId` —
323
+ * its `properties` (`room_type`, `massType`, `spaceType`, `areaClass`,
324
+ * `departmentId` —
324
325
  * nested under `properties`, mirroring {@linkcode PluginSpaceApi.update}). All
325
326
  * changes are batched into **one** command, so the entire batch is
326
327
  * undone/redone in a single step.
@@ -500,6 +501,7 @@ export type PluginSpaceUpdateGeometryFromProfileResult = z.infer<
500
501
  * | `"height"` | `number` | Height dimension |
501
502
  * | `"massType"` | `string \| null` | Mass type classification |
502
503
  * | `"spaceType"` | `string \| null` | Space type classification (Room, Balcony, etc.) |
504
+ * | `"areaClass"` | {@linkcode PluginAreaClass} | Effective area classification (`"NET"`, `"GROSS"`, or `"EXCLUDED"`), resolving any per-space override then the space-type default. Never null. |
503
505
  * | `"storey"` | `number \| null` | Story the space belongs to |
504
506
  * | `"departmentId"` | `string \| null` | Assigned department ID |
505
507
  * | `"departmentName"` | `string` | Assigned department name |
@@ -518,6 +520,8 @@ export type PluginSpaceUpdateGeometryFromProfileResult = z.infer<
518
520
  * |---|---|---|
519
521
  * | `"planPoints"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |
520
522
  * | `"profile"` | {@linkcode PProfile} | Bottom outer profile in world space, preserving line/arc curve data. |
523
+ * | `"innerProfiles"` | {@linkcode PProfile}`[]` | Bottom inner profiles (holes) in world space, preserving line/arc curve data. Empty array when the space has no holes. |
524
+ * | `"innerPlanPoints"` | {@linkcode PVec3}`[][]` | One point loop per inner profile (hole) in world space with `y = 0` (2D plan). No closing duplicate point. Empty array when the space has no holes. |
521
525
  */
522
526
  export const PluginSpaceGetProperty = z.enum([
523
527
  // Basic
@@ -532,6 +536,7 @@ export const PluginSpaceGetProperty = z.enum([
532
536
  "height",
533
537
  "massType",
534
538
  "spaceType",
539
+ "areaClass",
535
540
  "storey",
536
541
  "departmentId",
537
542
  "departmentName",
@@ -544,6 +549,8 @@ export const PluginSpaceGetProperty = z.enum([
544
549
  // Derived from brep
545
550
  "planPoints",
546
551
  "profile",
552
+ "innerProfiles",
553
+ "innerPlanPoints",
547
554
  // Derived from adjacency manager
548
555
  "adjacency",
549
556
  ])
@@ -594,6 +601,21 @@ export const PluginSpaceType = z.enum([
594
601
  "Parking",
595
602
  ])
596
603
 
604
+ /**
605
+ * Area classification for a space — controls which area total the space's
606
+ * footprint contributes to.
607
+ *
608
+ * | Value | Description |
609
+ * |---|---|
610
+ * | `"NET"` | Counted toward the net (carpet) area total |
611
+ * | `"GROSS"` | Counted toward the gross (built-up) area total |
612
+ * | `"EXCLUDED"` | Counted toward neither total |
613
+ *
614
+ * The classification does **not** change a space's own footprint area — it
615
+ * only decides which project-level total that footprint is summed into.
616
+ */
617
+ export const PluginAreaClass = z.enum(["NET", "GROSS", "EXCLUDED"])
618
+
597
619
  /**
598
620
  * Result of {@linkcode PluginSpaceApi.get}.
599
621
  *
@@ -614,6 +636,7 @@ export const PluginSpaceGetResult = z
614
636
  height: z.number(),
615
637
  massType: z.string().nullable(),
616
638
  spaceType: PluginSpaceType.nullable(),
639
+ areaClass: PluginAreaClass,
617
640
  storey: z.number().nullable(),
618
641
  departmentId: z.string().nullable(),
619
642
  departmentName: z.string(),
@@ -626,6 +649,8 @@ export const PluginSpaceGetResult = z
626
649
  // Derived from brep
627
650
  planPoints: z.array(PVec3),
628
651
  profile: PProfile,
652
+ innerProfiles: z.array(PProfile),
653
+ innerPlanPoints: z.array(z.array(PVec3)),
629
654
  // Derived from adjacency manager
630
655
  adjacency: z.array(z.object({
631
656
  spaceId: z.string(),
@@ -735,6 +760,7 @@ export const PluginDepartmentId = z.union([
735
760
  * | `properties` | `object` | Key/value pairs of properties to update (all optional) |
736
761
  * | `properties.room_type` | `string?` | New room type label |
737
762
  * | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |
763
+ * | `properties.areaClass` | {@linkcode PluginAreaClass}`?` | New area classification. Sets an explicit per-space override (`"NET"`, `"GROSS"`, or `"EXCLUDED"`) that wins over the space-type default. |
738
764
  * | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |
739
765
  */
740
766
  export const PluginSpaceUpdateArgs = z.object({
@@ -743,6 +769,7 @@ export const PluginSpaceUpdateArgs = z.object({
743
769
  room_type: z.string().optional(),
744
770
  massType: PluginMassType.optional(),
745
771
  spaceType: PluginSpaceType.optional(),
772
+ areaClass: PluginAreaClass.optional(),
746
773
  departmentId: PluginDepartmentId.optional(),
747
774
  }),
748
775
  })
@@ -761,6 +788,7 @@ export type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>
761
788
  * | `room_type` | `string?` | Updated room type (if changed) |
762
789
  * | `massType` | `string?` | Updated mass type (if changed) |
763
790
  * | `spaceType` | `string?` | Updated space type (if changed) |
791
+ * | `areaClass` | {@linkcode PluginAreaClass}`?` | Updated area classification (if changed) |
764
792
  * | `departmentId` | `string \| null?` | Updated department ID (if changed) |
765
793
  */
766
794
  export const PluginSpaceUpdateResult = z.object({
@@ -768,6 +796,7 @@ export const PluginSpaceUpdateResult = z.object({
768
796
  room_type: z.string().optional(),
769
797
  massType: z.string().optional(),
770
798
  spaceType: z.string().optional(),
799
+ areaClass: PluginAreaClass.optional(),
771
800
  departmentId: z.string().nullable().optional(),
772
801
  })
773
802
 
@@ -871,6 +900,7 @@ export const PluginSpaceBulkUpdateItem = z.object({
871
900
  room_type: z.string().optional(),
872
901
  massType: PluginMassType.optional(),
873
902
  spaceType: PluginSpaceType.optional(),
903
+ areaClass: PluginAreaClass.optional(),
874
904
  departmentId: PluginDepartmentId.optional(),
875
905
  })
876
906
  .optional(),
package/src/api/index.ts CHANGED
@@ -2,6 +2,7 @@ import { PluginCoreApi } from "./core"
2
2
  import { PluginEntityApi } from "./entity"
3
3
  import { PluginToolsApi } from "./tools"
4
4
  import { PluginUnitsApi } from "./units"
5
+ import { PluginDocumentationApi } from "./documentation"
5
6
 
6
7
  /**
7
8
  * Root API surface for Snaptrude plugins.
@@ -12,6 +13,7 @@ import { PluginUnitsApi } from "./units"
12
13
  * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)
13
14
  * - {@linkcode PluginApi.tools} — Copy, offset, selection, and transform tools
14
15
  * - {@linkcode PluginApi.units} — Unit conversion utilities
16
+ * - {@linkcode PluginApi.documentation} — Present documentation APIs
15
17
  */
16
18
  export abstract class PluginApi {
17
19
  /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */
@@ -22,11 +24,14 @@ export abstract class PluginApi {
22
24
  public abstract entity: PluginEntityApi
23
25
  /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */
24
26
  public abstract units: PluginUnitsApi
27
+ /** Present documentation APIs. See {@linkcode PluginDocumentationApi}. */
28
+ public abstract documentation: PluginDocumentationApi
25
29
 
26
30
  constructor() {}
27
31
  }
28
32
 
29
33
  export * from "./core"
34
+ export * from "./documentation"
30
35
  export * from "./entity"
31
36
  export * from "./tools"
32
37
  export * from "./units"