@snaptrude/plugin-core 0.9.17 → 0.9.18-voids-20261016.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/api-manifest.full.json +10406 -0
  2. package/api-manifest.json +737 -54
  3. package/dist/api/analysis/daylight.d.ts +5 -5
  4. package/dist/api/analysis/solar.d.ts +2 -2
  5. package/dist/api/core/camera/index.d.ts +29 -0
  6. package/dist/api/core/camera/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/create/index.d.ts +7 -1
  8. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  9. package/dist/api/core/geom/update/contour.d.ts +8 -2
  10. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  11. package/dist/api/core/zoom/index.d.ts +13 -0
  12. package/dist/api/core/zoom/index.d.ts.map +1 -1
  13. package/dist/api/design/bim.d.ts +209 -0
  14. package/dist/api/design/bim.d.ts.map +1 -0
  15. package/dist/api/design/boolean/index.d.ts +2 -0
  16. package/dist/api/design/boolean/index.d.ts.map +1 -1
  17. package/dist/api/design/catalog.d.ts +320 -0
  18. package/dist/api/design/catalog.d.ts.map +1 -0
  19. package/dist/api/design/create/bulk-items.d.ts +65 -25
  20. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  21. package/dist/api/design/create/index.d.ts +272 -99
  22. package/dist/api/design/create/index.d.ts.map +1 -1
  23. package/dist/api/design/create/opening-fields.d.ts +13 -12
  24. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  25. package/dist/api/design/delete/index.d.ts +1 -0
  26. package/dist/api/design/delete/index.d.ts.map +1 -1
  27. package/dist/api/design/doors/index.d.ts +18 -24
  28. package/dist/api/design/doors/index.d.ts.map +1 -1
  29. package/dist/api/design/family.d.ts +797 -27
  30. package/dist/api/design/family.d.ts.map +1 -1
  31. package/dist/api/design/index.d.ts +16 -0
  32. package/dist/api/design/index.d.ts.map +1 -1
  33. package/dist/api/design/networks.d.ts +1703 -0
  34. package/dist/api/design/networks.d.ts.map +1 -0
  35. package/dist/api/design/query/index.d.ts +42 -32
  36. package/dist/api/design/query/index.d.ts.map +1 -1
  37. package/dist/api/design/selection/index.d.ts +10 -10
  38. package/dist/api/design/types/index.d.ts +40 -24
  39. package/dist/api/design/types/index.d.ts.map +1 -1
  40. package/dist/api/design/update/index.d.ts +43 -3
  41. package/dist/api/design/update/index.d.ts.map +1 -1
  42. package/dist/api/design/windows/index.d.ts +8 -8
  43. package/dist/api/design/windows/index.d.ts.map +1 -1
  44. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  45. package/dist/api/presentation/annotate.d.ts +38 -22
  46. package/dist/api/presentation/annotate.d.ts.map +1 -1
  47. package/dist/api/presentation/drawingContract.d.ts +32 -0
  48. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  49. package/dist/api/presentation/drawings.d.ts +3523 -0
  50. package/dist/api/presentation/drawings.d.ts.map +1 -0
  51. package/dist/api/presentation/export.d.ts +23 -5
  52. package/dist/api/presentation/export.d.ts.map +1 -1
  53. package/dist/api/presentation/index.d.ts +32 -12
  54. package/dist/api/presentation/index.d.ts.map +1 -1
  55. package/dist/api/presentation/placedViews.d.ts +106 -6
  56. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  57. package/dist/api/presentation/shapes.d.ts +2 -2
  58. package/dist/api/presentation/sheets.d.ts +175 -19
  59. package/dist/api/presentation/sheets.d.ts.map +1 -1
  60. package/dist/api/presentation/viewPresets.d.ts +222 -0
  61. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  62. package/dist/api/presentation/views.d.ts +103 -5
  63. package/dist/api/presentation/views.d.ts.map +1 -1
  64. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  65. package/dist/errors/codes.d.ts +3 -1
  66. package/dist/errors/codes.d.ts.map +1 -1
  67. package/dist/index.cjs +3693 -2383
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +3573 -2383
  70. package/dist/index.js.map +1 -1
  71. package/package.json +1 -1
  72. package/scripts/generate-manifest.mjs +5 -0
  73. package/src/api/core/camera/index.ts +29 -0
  74. package/src/api/core/geom/create/index.ts +7 -1
  75. package/src/api/core/geom/update/contour.ts +8 -2
  76. package/src/api/core/zoom/index.ts +13 -0
  77. package/src/api/design/bim.ts +121 -0
  78. package/src/api/design/boolean/index.ts +2 -0
  79. package/src/api/design/catalog.ts +203 -0
  80. package/src/api/design/create/bulk-items.ts +57 -17
  81. package/src/api/design/create/index.ts +288 -120
  82. package/src/api/design/create/opening-fields.ts +15 -12
  83. package/src/api/design/delete/index.ts +1 -0
  84. package/src/api/design/doors/index.ts +58 -42
  85. package/src/api/design/family.ts +662 -32
  86. package/src/api/design/index.ts +34 -4
  87. package/src/api/design/networks.ts +607 -0
  88. package/src/api/design/query/index.ts +12 -2
  89. package/src/api/design/types/index.ts +31 -24
  90. package/src/api/design/update/index.ts +44 -3
  91. package/src/api/design/windows/index.ts +40 -22
  92. package/src/api/presentation/annotate.ts +90 -58
  93. package/src/api/presentation/drawingContract.ts +70 -0
  94. package/src/api/presentation/drawings.ts +1179 -0
  95. package/src/api/presentation/export.ts +32 -6
  96. package/src/api/presentation/index.ts +39 -14
  97. package/src/api/presentation/placedViews.ts +119 -28
  98. package/src/api/presentation/sheets.ts +181 -20
  99. package/src/api/presentation/viewPresets.ts +241 -0
  100. package/src/api/presentation/views.ts +46 -6
  101. package/src/errors/codes.ts +7 -0
  102. package/test/drawingContract.test.mjs +288 -0
  103. package/test/errors.test.mjs +1 -0
@@ -354,6 +354,9 @@ export abstract class PluginDesignQueryApi {
354
354
  * List all entities of one BIM object type — wall, door, slab, panel, and so
355
355
  * on — optionally narrowed by the shared filter.
356
356
  *
357
+ * `"mass"` includes voids; a mass whose `design.query.getHost` is a slab,
358
+ * floor, roof or ceiling is a void (made by `design.create.void`).
359
+ *
357
360
  * @param type - the {@linkcode PluginEntityType} to list
358
361
  * @param filter - an optional {@linkcode PluginEntityFilter}
359
362
  * @returns matching entities as {@linkcode ComponentHandle}`[]`
@@ -445,6 +448,9 @@ export abstract class PluginDesignQueryApi {
445
448
  * List all the generic masses (non-room massing volumes) in the project,
446
449
  * optionally filtered by storey, building, label, mass type, or region.
447
450
  *
451
+ * Includes voids; a mass whose `design.query.getHost` is a slab, floor, roof
452
+ * or ceiling is a void (made by `design.create.void`).
453
+ *
448
454
  * @param filter - an optional {@linkcode PluginEntityFilter}
449
455
  * @returns mass {@linkcode ComponentHandle}`[]`
450
456
  *
@@ -881,7 +887,8 @@ export abstract class PluginDesignQueryApi {
881
887
 
882
888
  /**
883
889
  * List an entity's direct child entities — for example the doors and windows
884
- * hosted in a wall.
890
+ * hosted in a wall, or the voids (holes, shafts, openings) cut in a slab,
891
+ * floor, roof or ceiling by `design.create.void`.
885
892
  * @param component - the entity's {@linkcode ComponentHandle}
886
893
  * @returns child {@linkcode ComponentHandle}`[]` (`[]` if none)
887
894
  *
@@ -889,6 +896,7 @@ export abstract class PluginDesignQueryApi {
889
896
  * @examplePrompt Show the child elements of the selected object
890
897
  * @examplePrompt Which openings belong to this wall?
891
898
  * @examplePrompt List everything nested under this mass
899
+ * @examplePrompt List all holes in this slab
892
900
  *
893
901
  * # Example
894
902
  * ```ts
@@ -908,7 +916,8 @@ export abstract class PluginDesignQueryApi {
908
916
  ): PluginApiReturn<ComponentHandle[]>
909
917
 
910
918
  /**
911
- * Get an entity's host/parent entity (e.g. the wall a door is cut into).
919
+ * Get an entity's host/parent entity (e.g. the wall a door is cut into, or
920
+ * the slab, floor, roof or ceiling a void is cut through).
912
921
  * @param component - the entity's {@linkcode ComponentHandle}
913
922
  * @returns the host {@linkcode ComponentHandle}, or `null` if top-level
914
923
  *
@@ -916,6 +925,7 @@ export abstract class PluginDesignQueryApi {
916
925
  * @examplePrompt Find the parent of the selected window
917
926
  * @examplePrompt What is this element attached to?
918
927
  * @examplePrompt Which wall hosts this window?
928
+ * @examplePrompt Which slab is this shaft in?
919
929
  *
920
930
  * # Example
921
931
  * ```ts
@@ -1,23 +1,25 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../../types"
3
3
 
4
+ /** An exact saved native wall family. Access is checked on every use; Draw selection is not registration. */
5
+ export const PluginNativeWallType = z.object({
6
+ id: z.string().min(1),
7
+ version: z.number().int().positive(),
8
+ })
9
+ export type PluginNativeWallType = z.infer<typeof PluginNativeWallType>
10
+
11
+ /** Legacy project type name/id, or an exact authorized native wall family pin. */
12
+ export const PluginWallType = z.union([z.string().trim().min(1), PluginNativeWallType])
13
+ export type PluginWallType = z.infer<typeof PluginWallType>
14
+
4
15
  /**
5
- * `snaptrude.design.types` — READ-ONLY reference over the project's building
6
- * **type / assembly** system (the Project Properties layer stacks: External /
7
- * Internal walls, slabs, floors, ceilings, roofs). A type bundles a labelled
8
- * layer stack — each layer's role, thickness (engine units) and material — plus a
9
- * summed total thickness. Both the built-in defaults and any team/user-added types
10
- * are surfaced.
11
- *
12
- * Types are plain value records ({@linkcode PluginBuildingType}) — NOT scene
13
- * entities/handles. A type's `id` is a stable `"<kind>:<name>"` token
14
- * (e.g. `"wall:brickWithPlasterAndPaint"`) returned by
15
- * {@linkcode PluginDesignTypesApi.list} and consumed by
16
- * {@linkcode PluginDesignTypesApi.get}. Reads never throw — an unknown id yields
17
- * `null`; a kind with no types yields `[]`.
18
- *
19
- * These are reads only: there is no engine seam to author a type from a plugin
20
- * (types are created through the construction/project-properties UI).
16
+ * Read-only project assemblies and authorized saved native wall families.
17
+ * Legacy ids use `"<kind>:<name>"`. Native wall records carry `nativeFamily`:
18
+ * pass that exact `{ id, version }` pin to get, create.walls, create.wallRuns,
19
+ * or update.wall. Labels and bare definition ids do not select native families.
20
+ * Native lengths use Snaptrude units (1 SU = 254 mm).
21
+ * Missing ids return null; catalog/network failures reject rather than return
22
+ * an incomplete catalog. Author native families with design.family.
21
23
  */
22
24
  export abstract class PluginDesignTypesApi {
23
25
  constructor() {}
@@ -46,10 +48,10 @@ export abstract class PluginDesignTypesApi {
46
48
  ): PluginApiReturn<PluginBuildingTypeSummary[]>
47
49
 
48
50
  /**
49
- * Get one building type by its `"<kind>:<name>"` id — its labelled layer stack
51
+ * Get one building type by its legacy id or exact native wall pin — its labelled layer stack
50
52
  * (each layer's role, thickness and material) plus the summed total thickness.
51
53
  *
52
- * @param typeId The type id from {@linkcode PluginDesignTypesApi.list} (e.g. `"wall:exposedConcrete"`)
54
+ * @param typeId The legacy id or nativeFamily pin from {@linkcode PluginDesignTypesApi.list}
53
55
  * @returns The full type, or `null` if no type matches
54
56
  *
55
57
  * @examplePrompt What layers make up this wall type?
@@ -60,11 +62,11 @@ export abstract class PluginDesignTypesApi {
60
62
  * # Example
61
63
  * ```ts
62
64
  * const [first] = await snaptrude.design.types.list("wall")
63
- * const type = await snaptrude.design.types.get(first.id)
65
+ * const type = await snaptrude.design.types.get(first.nativeFamily ?? first.id)
64
66
  * if (type) for (const layer of type.layers) console.log(layer.name, layer.thickness)
65
67
  * ```
66
68
  */
67
- public abstract get(typeId: string): PluginApiReturn<PluginBuildingType | null>
69
+ public abstract get(typeId: PluginWallType): PluginApiReturn<PluginBuildingType | null>
68
70
  }
69
71
 
70
72
  /** The building-type families exposed by {@linkcode PluginDesignTypesApi}. */
@@ -85,6 +87,8 @@ export const PluginTypeLayer = z.object({
85
87
  name: z.string(),
86
88
  role: z.string(),
87
89
  thickness: z.number(),
90
+ /** Native authored core membership. Never inferred from material or layer name. */
91
+ isCore: z.boolean().optional(),
88
92
  material: z
89
93
  .object({
90
94
  name: z.string(),
@@ -99,7 +103,7 @@ export type PluginTypeLayer = z.infer<typeof PluginTypeLayer>
99
103
  *
100
104
  * | Property | Type | Description |
101
105
  * |---|---|---|
102
- * | `id` | `string` | Stable `"<kind>:<name>"` token — pass to `design.types.get` |
106
+ * | `id` | `string` | Legacy `"<kind>:<name>"` token or native definition id; native lookups use `nativeFamily` |
103
107
  * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
104
108
  * | `label` | `string` | Human-readable label |
105
109
  * | `isDefault` | `boolean` | `true` for a built-in type, `false` for a team/user type |
@@ -111,6 +115,8 @@ export const PluginBuildingTypeSummary = z.object({
111
115
  label: z.string(),
112
116
  isDefault: z.boolean(),
113
117
  thickness: z.number(),
118
+ /** Present for native walls. Pass the whole pin to get/create/update, not its label or bare id. */
119
+ nativeFamily: PluginNativeWallType.optional(),
114
120
  })
115
121
  export type PluginBuildingTypeSummary = z.infer<typeof PluginBuildingTypeSummary>
116
122
 
@@ -119,7 +125,7 @@ export type PluginBuildingTypeSummary = z.infer<typeof PluginBuildingTypeSummary
119
125
  *
120
126
  * | Property | Type | Description |
121
127
  * |---|---|---|
122
- * | `id` | `string` | Stable `"<kind>:<name>"` token |
128
+ * | `id` | `string` | Legacy type token or native definition id |
123
129
  * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
124
130
  * | `label` | `string` | Human-readable label |
125
131
  * | `isDefault` | `boolean` | `true` for a built-in type |
@@ -148,9 +154,10 @@ export type PluginDesignTypesListArgs = z.infer<typeof PluginDesignTypesListArgs
148
154
  *
149
155
  * | Property | Type | Description |
150
156
  * |---|---|---|
151
- * | `typeId` | `string` | The `"<kind>:<name>"` id from `design.types.list` |
157
+ * | `typeId` | {@linkcode PluginWallType} | A legacy `"<kind>:<name>"` id or exact `nativeFamily` pin from `design.types.list` |
152
158
  */
153
159
  export const PluginDesignTypesGetArgs = z.object({
154
- typeId: z.string(),
160
+ // Preserve legacy lookup behavior: malformed string ids return null in the host.
161
+ typeId: z.union([z.string(), PluginNativeWallType]),
155
162
  })
156
163
  export type PluginDesignTypesGetArgs = z.infer<typeof PluginDesignTypesGetArgs>
@@ -9,7 +9,10 @@ import {
9
9
  PluginSpaceUpdateResult,
10
10
  } from "../../entity/space"
11
11
  import { PluginDesignChangeResult } from "../lock"
12
- import { MassParametersPatch, type MassParametersRecord } from "../../../massParameters"
12
+ import {
13
+ MassParametersPatch,
14
+ type MassParametersRecord,
15
+ } from "../../../massParameters"
13
16
  import {
14
17
  PluginBuildableEnvelopePolygonVertex,
15
18
  PluginBuildableEnvelopeSetbackTier,
@@ -18,6 +21,12 @@ import {
18
21
  } from "../../entity/buildableEnvelope"
19
22
  import { PluginGridStyleOptions } from "../create/grids"
20
23
  import { PluginEntityType } from "../query"
24
+ import { PluginWallType } from "../types"
25
+ import {
26
+ PluginConstructionType,
27
+ PluginFamilyValues,
28
+ type PluginFamilyUpdates,
29
+ } from "../catalog"
21
30
 
22
31
  /**
23
32
  * Sparse property updates for a space. Only provided fields change.
@@ -165,13 +174,14 @@ export type PluginDesignUpdateParametersArgs = z.infer<
165
174
  * |---|---|---|
166
175
  * | `thickness` | `number`? | Wall thickness, engine units (> 0) |
167
176
  * | `height` | `number`? | Wall height, engine units (> 0) |
168
- * | `type` | `string`? | Convert the wall to another wall type — a name (or `wall:`-prefixed id) from `design.types.list("wall")` |
177
+ * | `type` | {@linkcode PluginWallType}? | Legacy name/id or exact authorized native `{ id, version }` pin from `design.types.list("wall")` |
169
178
  */
170
179
  export const PluginWallUpdates = z
171
180
  .object({
172
181
  thickness: z.number().positive().optional(),
173
182
  height: z.number().positive().optional(),
174
- type: z.string().trim().min(1).optional(),
183
+ type: PluginWallType.optional(),
184
+ values: PluginFamilyValues.optional(),
175
185
  })
176
186
  .refine((p) => Object.keys(p).length > 0, {
177
187
  message: "PluginWallUpdates requires at least one field to change",
@@ -196,6 +206,8 @@ export const PluginSlabUpdates = z
196
206
  .object({
197
207
  thickness: z.number().positive().optional(),
198
208
  overhang: z.number().optional(),
209
+ type: PluginConstructionType.optional(),
210
+ values: PluginFamilyValues.optional(),
199
211
  })
200
212
  .refine((p) => Object.keys(p).length > 0, {
201
213
  message: "PluginSlabUpdates requires at least one field to change",
@@ -313,6 +325,11 @@ export type PluginDesignUpdateGridArgs = z.infer<
313
325
  *
314
326
  * Migrated from the removed `entity.space.{update, updateGeometryFromProfile, bulkUpdate}`.
315
327
  * Only provided fields change; each call is undoable. Failures throw (RPC rejects).
328
+ *
329
+ * Native family edits accept `type` and/or sparse `values` from `design.catalog`.
330
+ * Length overrides use mm; dimensional arguments use SU. Contours and axes stay unchanged.
331
+ * Shared/type overrides are refused. A thickness argument must agree with the layer values.
332
+ * Family roof overhang is unsupported; use the native slab path for family overhang edits.
316
333
  */
317
334
  export abstract class PluginDesignUpdateApi {
318
335
  constructor() {}
@@ -400,6 +417,8 @@ export abstract class PluginDesignUpdateApi {
400
417
  * @param space - The space to update
401
418
  * @param options - `properties` (sparse) and/or `geometry` ({ profile, extrudeHeight })
402
419
  * @returns the updated space's echoed {@linkcode PluginSpaceUpdateResult}
420
+ * @throws PRECONDITION_FAILED for a void (a hole cut with `design.create.void`): delete it and
421
+ * cut a new one
403
422
  *
404
423
  * @examplePrompt Rename this room to Office
405
424
  * @examplePrompt Change this space's room type to Meeting Room
@@ -433,6 +452,7 @@ export abstract class PluginDesignUpdateApi {
433
452
  *
434
453
  * @param items - One {@linkcode PluginUpdateSpaceItem} per space
435
454
  * @returns one {@linkcode PluginSpaceUpdateResult} per item, in input order
455
+ * @throws PRECONDITION_FAILED for a void, like {@linkcode space}
436
456
  *
437
457
  * @examplePrompt Label all the selected rooms as Bedrooms
438
458
  * @examplePrompt Change the room type of these five spaces at once
@@ -566,6 +586,9 @@ export abstract class PluginDesignUpdateApi {
566
586
  * chamfer (the kernel numbers its faces differently): send the twist/taper
567
587
  * keys with `operations: []` first (the message names them), re-select on
568
588
  * the new shape, then send `{ operations }` back.
589
+ * Graph-bound spaces accept amount-only extrusion edits. Footprint, twist,
590
+ * taper and operation edits require the owning boundary tools, so generated
591
+ * walls, junctions and hosted openings remain synchronized.
569
592
  * @throws VALIDATION for a key the kind does not have (the message lists the
570
593
  * kind's keys), `kind` or `version` in a partial patch, or a value outside
571
594
  * the constructor's own rules (torus tube ≥ ring, revolution angle ∉
@@ -773,6 +796,24 @@ export abstract class PluginDesignUpdateApi {
773
796
  updates: PluginSlabUpdates,
774
797
  ): PluginApiReturn<PluginDesignChangeResult>
775
798
 
799
+ /** Replace a native beam family while preserving its authored axis. Values use mm/degrees.
800
+ * @param component Native beam. @param updates Saved family reference and optional instance values.
801
+ * @returns Affected component IDs. One undoable operation; unsupported geometry fails before mutation.
802
+ */
803
+ public abstract beam(
804
+ component: ComponentHandle,
805
+ updates: PluginFamilyUpdates,
806
+ ): PluginApiReturn<PluginDesignChangeResult>
807
+
808
+ /** Replace a native column family while preserving its authored axis. Values use mm/degrees.
809
+ * @param component Native column. @param updates Saved family reference and optional instance values.
810
+ * @returns Affected component IDs. One undoable operation; unsupported geometry fails before mutation.
811
+ */
812
+ public abstract column(
813
+ component: ComponentHandle,
814
+ updates: PluginFamilyUpdates,
815
+ ): PluginApiReturn<PluginDesignChangeResult>
816
+
776
817
  /**
777
818
  * Set a component's **absolute world elevation** — moves it vertically so its
778
819
  * base (the bounding-box bottom, world Y) lands at `elevation`. Composed over
@@ -10,13 +10,14 @@ import { PluginObjectCatalogGroup, PluginObjectCatalogItem } from "../doors"
10
10
  * at `design.query.*`. Window targets are {@linkcode ComponentHandle}s.
11
11
  *
12
12
  * The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
13
- * browse the placeable window library — plain value records keyed by a library id
14
- * (team `_id` or general `fullName`), NOT handles — and feed `design.create.window`.
15
- * They are network-backed but carry no `Async` suffix (§6.6) and never throw
16
- * (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
13
+ * browse saved hosted window families, keyed by definition ID, and feed design.create.window.
14
+ * They reject if saved definitions cannot be loaded completely. A missing item returns null.
15
+ * The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
17
16
  * DTOs are shared with `design.doors` (defined there, re-exported here).
18
17
  *
19
- * `getSillHeight` (bounds-derived) and the command-wired `mirror` land in a later pass.
18
+ * PC-only: dimensions read the evaluated opening and host thickness in SU. Setters
19
+ * write declared width/height parameters, never mesh scale. Missing or derived
20
+ * controls reject. Use design.family.setParameters for sill and other controls.
20
21
  */
21
22
  export abstract class PluginDesignWindowsApi {
22
23
  constructor() {}
@@ -40,7 +41,9 @@ export abstract class PluginDesignWindowsApi {
40
41
  * if (type) console.log("window type:", type)
41
42
  * ```
42
43
  */
43
- public abstract getType(window: ComponentHandle): PluginApiReturn<string | null>
44
+ public abstract getType(
45
+ window: ComponentHandle,
46
+ ): PluginApiReturn<string | null>
44
47
 
45
48
  /**
46
49
  * Get the width of a window — how wide its opening is along the host wall.
@@ -60,7 +63,9 @@ export abstract class PluginDesignWindowsApi {
60
63
  * if (width !== null) console.log("window width:", width)
61
64
  * ```
62
65
  */
63
- public abstract getWidth(window: ComponentHandle): PluginApiReturn<number | null>
66
+ public abstract getWidth(
67
+ window: ComponentHandle,
68
+ ): PluginApiReturn<number | null>
64
69
 
65
70
  /**
66
71
  * Get the height of a window — how tall its opening is on the host wall.
@@ -80,12 +85,13 @@ export abstract class PluginDesignWindowsApi {
80
85
  * if (height !== null) console.log("window height:", height)
81
86
  * ```
82
87
  */
83
- public abstract getHeight(window: ComponentHandle): PluginApiReturn<number | null>
88
+ public abstract getHeight(
89
+ window: ComponentHandle,
90
+ ): PluginApiReturn<number | null>
84
91
 
85
92
  /**
86
- * Get a window's full dimensions in one call — width along the wall, vertical
87
- * height, and thickness through the wall — measured in the window's local
88
- * oriented space.
93
+ * Get evaluated opening width/height and host thickness in Snaptrude units.
94
+ * The opening can differ from the width/height input parameters.
89
95
  *
90
96
  * @param window The window to query
91
97
  * @returns The dimensions, or `null`
@@ -104,7 +110,7 @@ export abstract class PluginDesignWindowsApi {
104
110
  * ```
105
111
  */
106
112
  public abstract getDimensions(
107
- window: ComponentHandle
113
+ window: ComponentHandle,
108
114
  ): PluginApiReturn<PluginWindowDimensions | null>
109
115
 
110
116
  /**
@@ -129,7 +135,7 @@ export abstract class PluginDesignWindowsApi {
129
135
  */
130
136
  public abstract setWidth(
131
137
  window: ComponentHandle,
132
- width: number
138
+ width: number,
133
139
  ): PluginApiReturn<PluginDesignChangeResult>
134
140
 
135
141
  /**
@@ -153,7 +159,7 @@ export abstract class PluginDesignWindowsApi {
153
159
  */
154
160
  public abstract setHeight(
155
161
  window: ComponentHandle,
156
- height: number
162
+ height: number,
157
163
  ): PluginApiReturn<PluginDesignChangeResult>
158
164
 
159
165
  /**
@@ -174,7 +180,9 @@ export abstract class PluginDesignWindowsApi {
174
180
  * for (const g of groups) console.log(g.dbType, g.label, g.source)
175
181
  * ```
176
182
  */
177
- public abstract listCatalogGroups(): PluginApiReturn<PluginObjectCatalogGroup[]>
183
+ public abstract listCatalogGroups(): PluginApiReturn<
184
+ PluginObjectCatalogGroup[]
185
+ >
178
186
 
179
187
  /**
180
188
  * List the placeable window catalog (team + general libraries), optionally
@@ -196,7 +204,7 @@ export abstract class PluginDesignWindowsApi {
196
204
  * ```
197
205
  */
198
206
  public abstract listCatalog(
199
- group?: string
207
+ group?: string,
200
208
  ): PluginApiReturn<PluginObjectCatalogItem[]>
201
209
 
202
210
  /**
@@ -218,7 +226,7 @@ export abstract class PluginDesignWindowsApi {
218
226
  * ```
219
227
  */
220
228
  public abstract getCatalogItem(
221
- id: string
229
+ id: string,
222
230
  ): PluginApiReturn<PluginObjectCatalogItem | null>
223
231
 
224
232
  /**
@@ -282,7 +290,9 @@ export const PluginDesignWindowSetWidthArgs = z.object({
282
290
  window: ComponentHandle,
283
291
  width: z.number(),
284
292
  })
285
- export type PluginDesignWindowSetWidthArgs = z.infer<typeof PluginDesignWindowSetWidthArgs>
293
+ export type PluginDesignWindowSetWidthArgs = z.infer<
294
+ typeof PluginDesignWindowSetWidthArgs
295
+ >
286
296
 
287
297
  /**
288
298
  * Arguments for {@linkcode PluginDesignWindowsApi.setHeight}.
@@ -296,7 +306,9 @@ export const PluginDesignWindowSetHeightArgs = z.object({
296
306
  window: ComponentHandle,
297
307
  height: z.number(),
298
308
  })
299
- export type PluginDesignWindowSetHeightArgs = z.infer<typeof PluginDesignWindowSetHeightArgs>
309
+ export type PluginDesignWindowSetHeightArgs = z.infer<
310
+ typeof PluginDesignWindowSetHeightArgs
311
+ >
300
312
 
301
313
  // ---------------------------------------------------------------------------
302
314
  // catalog (shared DTOs defined in ../doors, re-exported here for symmetry)
@@ -315,7 +327,9 @@ export { PluginObjectCatalogGroup, PluginObjectCatalogItem }
315
327
  export const PluginDesignWindowListCatalogArgs = z.object({
316
328
  group: z.string().optional(),
317
329
  })
318
- export type PluginDesignWindowListCatalogArgs = z.infer<typeof PluginDesignWindowListCatalogArgs>
330
+ export type PluginDesignWindowListCatalogArgs = z.infer<
331
+ typeof PluginDesignWindowListCatalogArgs
332
+ >
319
333
 
320
334
  /**
321
335
  * Arguments for {@linkcode PluginDesignWindowsApi.getCatalogItem} / {@linkcode PluginDesignWindowsApi.exists}.
@@ -327,7 +341,11 @@ export type PluginDesignWindowListCatalogArgs = z.infer<typeof PluginDesignWindo
327
341
  export const PluginDesignWindowGetCatalogItemArgs = z.object({
328
342
  id: z.string(),
329
343
  })
330
- export type PluginDesignWindowGetCatalogItemArgs = z.infer<typeof PluginDesignWindowGetCatalogItemArgs>
344
+ export type PluginDesignWindowGetCatalogItemArgs = z.infer<
345
+ typeof PluginDesignWindowGetCatalogItemArgs
346
+ >
331
347
 
332
348
  export const PluginDesignWindowExistsArgs = PluginDesignWindowGetCatalogItemArgs
333
- export type PluginDesignWindowExistsArgs = z.infer<typeof PluginDesignWindowExistsArgs>
349
+ export type PluginDesignWindowExistsArgs = z.infer<
350
+ typeof PluginDesignWindowExistsArgs
351
+ >