@snaptrude/plugin-core 0.2.4 → 0.2.6

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 (57) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/core/geom/arc.d.ts +81 -0
  3. package/dist/api/core/geom/arc.d.ts.map +1 -0
  4. package/dist/api/core/geom/curve.d.ts +70 -0
  5. package/dist/api/core/geom/curve.d.ts.map +1 -0
  6. package/dist/api/core/geom/index.d.ts +32 -0
  7. package/dist/api/core/geom/index.d.ts.map +1 -0
  8. package/dist/api/core/geom/line.d.ts +56 -0
  9. package/dist/api/core/geom/line.d.ts.map +1 -0
  10. package/dist/api/core/geom/profile.d.ts +121 -0
  11. package/dist/api/core/geom/profile.d.ts.map +1 -0
  12. package/dist/api/core/index.d.ts +18 -0
  13. package/dist/api/core/index.d.ts.map +1 -0
  14. package/dist/api/core/math/index.d.ts +18 -0
  15. package/dist/api/core/math/index.d.ts.map +1 -0
  16. package/dist/api/core/math/quat.d.ts +187 -0
  17. package/dist/api/core/math/quat.d.ts.map +1 -0
  18. package/dist/api/core/math/vec3.d.ts +156 -0
  19. package/dist/api/core/math/vec3.d.ts.map +1 -0
  20. package/dist/api/entity/buildableEnvelope.d.ts +233 -0
  21. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  22. package/dist/api/entity/department.d.ts +99 -0
  23. package/dist/api/entity/department.d.ts.map +1 -0
  24. package/dist/api/entity/index.d.ts +33 -0
  25. package/dist/api/entity/index.d.ts.map +1 -0
  26. package/dist/api/entity/referenceLine.d.ts +259 -0
  27. package/dist/api/entity/referenceLine.d.ts.map +1 -0
  28. package/dist/api/entity/space.d.ts +1490 -0
  29. package/dist/api/entity/space.d.ts.map +1 -0
  30. package/dist/api/entity/story.d.ts +239 -0
  31. package/dist/api/entity/story.d.ts.map +1 -0
  32. package/dist/api/index.d.ts +30 -0
  33. package/dist/api/index.d.ts.map +1 -0
  34. package/dist/api/tools/copy.d.ts +59 -0
  35. package/dist/api/tools/copy.d.ts.map +1 -0
  36. package/dist/api/tools/index.d.ts +29 -0
  37. package/dist/api/tools/index.d.ts.map +1 -0
  38. package/dist/api/tools/offset.d.ts +43 -0
  39. package/dist/api/tools/offset.d.ts.map +1 -0
  40. package/dist/api/tools/selection.d.ts +48 -0
  41. package/dist/api/tools/selection.d.ts.map +1 -0
  42. package/dist/api/tools/transform.d.ts +114 -0
  43. package/dist/api/tools/transform.d.ts.map +1 -0
  44. package/dist/api/units/index.d.ts +163 -0
  45. package/dist/api/units/index.d.ts.map +1 -0
  46. package/dist/host-utils.d.ts +41 -0
  47. package/dist/host-utils.d.ts.map +1 -0
  48. package/dist/index.cjs +71 -0
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.ts +4 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +63 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/types.d.ts +16 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/package.json +1 -1
  57. package/src/api/entity/space.ts +270 -0
@@ -0,0 +1,156 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * 3D vector operations for positions, directions, and displacements.
4
+ *
5
+ * All methods are **pure** — they return new {@linkcode PVec3} values
6
+ * without mutating the inputs.
7
+ *
8
+ * Accessed via `snaptrude.core.math.vec3`.
9
+ */
10
+ export declare abstract class PluginVec3Api {
11
+ constructor();
12
+ /**
13
+ * Create a new 3D vector.
14
+ *
15
+ * @param x - The X component
16
+ * @param y - The Y component
17
+ * @param z - The Z component
18
+ * @returns A new {@linkcode PVec3}
19
+ *
20
+ * # Example
21
+ * ```ts
22
+ * const position = snaptrude.core.math.vec3.new(1, 2, 3)
23
+ * // { x: 1, y: 2, z: 3 }
24
+ * ```
25
+ */
26
+ new(x: number, y: number, z: number): PVec3;
27
+ /**
28
+ * Add two vectors component-wise.
29
+ *
30
+ * @param a - First vector
31
+ * @param b - Second vector
32
+ * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`
33
+ */
34
+ add(a: PVec3, b: PVec3): PVec3;
35
+ /**
36
+ * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.
37
+ *
38
+ * @param a - Vector to subtract from
39
+ * @param b - Vector to subtract
40
+ * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`
41
+ */
42
+ subtract(a: PVec3, b: PVec3): PVec3;
43
+ /**
44
+ * Scale a vector by a scalar value.
45
+ *
46
+ * @param v - The vector to scale
47
+ * @param scalar - The scalar multiplier
48
+ * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`
49
+ */
50
+ scale(v: PVec3, scalar: number): PVec3;
51
+ /**
52
+ * Compute the dot product of two vectors.
53
+ *
54
+ * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle
55
+ * between the vectors. Useful for checking orthogonality (result = 0)
56
+ * or projection.
57
+ *
58
+ * @param a - First vector
59
+ * @param b - Second vector
60
+ * @returns The scalar dot product
61
+ */
62
+ dot(a: PVec3, b: PVec3): number;
63
+ /**
64
+ * Compute the cross product of two vectors.
65
+ *
66
+ * The result is a vector perpendicular to both inputs, with magnitude
67
+ * equal to the area of the parallelogram they span. Useful for computing
68
+ * surface normals.
69
+ *
70
+ * @param a - First vector
71
+ * @param b - Second vector
72
+ * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}
73
+ */
74
+ cross(a: PVec3, b: PVec3): PVec3;
75
+ /**
76
+ * Compute the length (magnitude) of a vector.
77
+ *
78
+ * @param v - The vector
79
+ * @returns The Euclidean length `√(x² + y² + z²)`
80
+ */
81
+ length(v: PVec3): number;
82
+ /**
83
+ * Compute the squared length of a vector.
84
+ *
85
+ * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}
86
+ * when comparing relative magnitudes.
87
+ *
88
+ * @param v - The vector
89
+ * @returns The squared length `x² + y² + z²`
90
+ */
91
+ lengthSquared(v: PVec3): number;
92
+ /**
93
+ * Normalize a vector to unit length.
94
+ *
95
+ * @param v - The vector to normalize
96
+ * @returns A new unit-length {@linkcode PVec3} in the same direction,
97
+ * or a zero vector `(0, 0, 0)` if the input has zero length
98
+ */
99
+ normalize(v: PVec3): PVec3;
100
+ /**
101
+ * Compute the Euclidean distance between two points.
102
+ *
103
+ * @param a - First point
104
+ * @param b - Second point
105
+ * @returns The distance `|a - b|`
106
+ */
107
+ distance(a: PVec3, b: PVec3): number;
108
+ /**
109
+ * Linearly interpolate between two vectors.
110
+ *
111
+ * @param a - Start vector (returned when `t = 0`)
112
+ * @param b - End vector (returned when `t = 1`)
113
+ * @param t - Interpolation factor, typically in `[0, 1]`
114
+ * @returns A new {@linkcode PVec3} at `a + (b - a) * t`
115
+ */
116
+ lerp(a: PVec3, b: PVec3, t: number): PVec3;
117
+ /**
118
+ * Negate a vector (reverse its direction).
119
+ *
120
+ * @param v - The vector to negate
121
+ * @returns A new {@linkcode PVec3} with all components negated
122
+ */
123
+ negate(v: PVec3): PVec3;
124
+ /**
125
+ * Check if two vectors are exactly equal (strict equality per component).
126
+ *
127
+ * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.
128
+ *
129
+ * @param a - First vector
130
+ * @param b - Second vector
131
+ * @returns `true` if all components match exactly
132
+ */
133
+ equals(a: PVec3, b: PVec3): boolean;
134
+ /**
135
+ * Check if two vectors are approximately equal within a tolerance.
136
+ *
137
+ * @param a - First vector
138
+ * @param b - Second vector
139
+ * @param epsilon - Maximum allowed difference per component (default `1e-6`)
140
+ * @returns `true` if `|a[i] - b[i]| < epsilon` for all components
141
+ */
142
+ equalsApprox(a: PVec3, b: PVec3, epsilon?: number): boolean;
143
+ }
144
+ /**
145
+ * A 3D vector with `x`, `y`, and `z` components.
146
+ *
147
+ * Used throughout the plugin API for positions, directions, displacements,
148
+ * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.
149
+ */
150
+ export declare const PVec3: z.ZodObject<{
151
+ x: z.ZodNumber;
152
+ y: z.ZodNumber;
153
+ z: z.ZodNumber;
154
+ }, z.core.$strip>;
155
+ export type PVec3 = z.infer<typeof PVec3>;
156
+ //# sourceMappingURL=vec3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/vec3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB;;;;;;;GAOG;AACH,8BAAsB,aAAa;;IAGjC;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IAI3C;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAI9B;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAInC;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK;IAItC;;;;;;;;;;OAUG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM;IAI/B;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAQhC;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAIxB;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAI/B;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAM1B;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM;IAIpC;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ1C;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAIvB;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO;IAInC;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO;CAOlE;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;iBAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAA"}
@@ -0,0 +1,233 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Buildable Envelope management — create and update parametric zoning envelopes.
5
+ *
6
+ * A **buildable envelope** is the regulated volume inside which a building may
7
+ * be massed. The host owns envelope identity: {@linkcode PluginBuildableEnvelopeApi.create create}
8
+ * mints a `buildableEnvelopeId` and returns it; {@linkcode PluginBuildableEnvelopeApi.update update}
9
+ * requires that id to target the existing envelope.
10
+ *
11
+ * Accessed via `snaptrude.entity.buildableEnvelope`.
12
+ */
13
+ export declare abstract class PluginBuildableEnvelopeApi {
14
+ constructor();
15
+ /**
16
+ * Create a new parametric buildable envelope.
17
+ *
18
+ * @param args - A {@linkcode PluginBuildableEnvelopeCreateArgs} object.
19
+ * @returns A {@linkcode PluginBuildableEnvelopeCreateResult} with the
20
+ * `buildableEnvelopeId` of the created envelope.
21
+ * @throws If validation fails or generation produces no renderable geometry.
22
+ *
23
+ * # Example
24
+ * ```ts
25
+ * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.create({
26
+ * sitePolygon: [
27
+ * { x: 0, z: 0 },
28
+ * { x: 100, z: 0 },
29
+ * { x: 100, z: 80 },
30
+ * { x: 0, z: 80 },
31
+ * ],
32
+ * lengthUnit: "ft",
33
+ * setbacks: [
34
+ * { aboveHeight: 0, front: 10, side: 5, rear: 10 },
35
+ * { aboveHeight: 100, front: 20, side: 10, rear: 20 },
36
+ * ],
37
+ * verticalCap: { kind: "max_height", maxHeight: 150 },
38
+ * floorToFloor: 12,
39
+ * })
40
+ * ```
41
+ */
42
+ abstract create(args: PluginBuildableEnvelopeCreateArgs): PluginApiReturn<PluginBuildableEnvelopeCreateResult>;
43
+ /**
44
+ * Update an existing parametric buildable envelope.
45
+ *
46
+ * @param args - A {@linkcode PluginBuildableEnvelopeUpdateArgs} object.
47
+ * `buildableEnvelopeId` is required and must match an existing envelope on
48
+ * the canvas.
49
+ * @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the
50
+ * `buildableEnvelopeId` of the updated envelope.
51
+ * @throws If validation fails, the envelope does not exist, or generation
52
+ * produces no renderable geometry.
53
+ *
54
+ * # Example
55
+ * ```ts
56
+ * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.update({
57
+ * buildableEnvelopeId: existingId,
58
+ * sitePolygon: [
59
+ * { x: 0, z: 0 },
60
+ * { x: 100, z: 0 },
61
+ * { x: 100, z: 80 },
62
+ * { x: 0, z: 80 },
63
+ * ],
64
+ * lengthUnit: "ft",
65
+ * setbacks: [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],
66
+ * verticalCap: { kind: "max_height", maxHeight: 175 },
67
+ * floorToFloor: 12,
68
+ * })
69
+ * ```
70
+ */
71
+ abstract update(args: PluginBuildableEnvelopeUpdateArgs): PluginApiReturn<PluginBuildableEnvelopeUpdateResult>;
72
+ }
73
+ /**
74
+ * Site polygon vertex in the request `lengthUnit`.
75
+ *
76
+ * Vertices may be passed as `{x, z}` objects or `[x, z]` tuples. Numeric
77
+ * values must be finite (no `NaN` or `±Infinity`).
78
+ */
79
+ export declare const PluginBuildableEnvelopePolygonVertex: z.ZodUnion<readonly [z.ZodObject<{
80
+ x: z.ZodNumber;
81
+ z: z.ZodNumber;
82
+ }, z.core.$strict>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
83
+ export type PluginBuildableEnvelopePolygonVertex = z.infer<typeof PluginBuildableEnvelopePolygonVertex>;
84
+ /**
85
+ * Vertical cap for a buildable envelope.
86
+ *
87
+ * Use exactly one shape:
88
+ * - `{ kind: "max_height", maxHeight }`
89
+ * - `{ kind: "max_floors", maxFloors }`
90
+ *
91
+ * Floor-to-floor height is not nested here; it is always supplied as the
92
+ * top-level `floorToFloor` argument.
93
+ */
94
+ export declare const PluginBuildableEnvelopeVerticalCap: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
+ kind: z.ZodLiteral<"max_height">;
96
+ maxHeight: z.ZodNumber;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ kind: z.ZodLiteral<"max_floors">;
99
+ maxFloors: z.ZodNumber;
100
+ }, z.core.$strict>], "kind">;
101
+ export type PluginBuildableEnvelopeVerticalCap = z.infer<typeof PluginBuildableEnvelopeVerticalCap>;
102
+ /**
103
+ * One tier of a buildable envelope's setback profile.
104
+ *
105
+ * Tiers are ordered by `aboveHeight`. The first tier (index 0) must have
106
+ * `aboveHeight: 0` and describes the ground footprint; each subsequent tier
107
+ * describes the complete setback at a strictly greater height. Each tier
108
+ * carries its own `front`, `side`, and `rear` values — there is no
109
+ * inheritance from earlier tiers.
110
+ *
111
+ * All numeric values must be finite and nonnegative, in the request
112
+ * `lengthUnit`.
113
+ *
114
+ * | Property | Type | Description |
115
+ * |---|---|---|
116
+ * | `aboveHeight` | `number` | Height at or above which this tier applies; the ground tier uses `0` |
117
+ * | `front` | `number` | Front setback for this tier |
118
+ * | `side` | `number` | Side setback for this tier |
119
+ * | `rear` | `number` | Rear setback for this tier |
120
+ */
121
+ export declare const PluginBuildableEnvelopeSetbackTier: z.ZodObject<{
122
+ aboveHeight: z.ZodNumber;
123
+ front: z.ZodNumber;
124
+ side: z.ZodNumber;
125
+ rear: z.ZodNumber;
126
+ }, z.core.$strict>;
127
+ export type PluginBuildableEnvelopeSetbackTier = z.infer<typeof PluginBuildableEnvelopeSetbackTier>;
128
+ /**
129
+ * Arguments for {@linkcode PluginBuildableEnvelopeApi.create}.
130
+ *
131
+ * Strict schema. The host owns identity — no `buildableEnvelopeId` is accepted
132
+ * on create; the id is minted by the host and returned in
133
+ * {@linkcode PluginBuildableEnvelopeCreateResult}.
134
+ *
135
+ * | Property | Type | Description |
136
+ * |---|---|---|
137
+ * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |
138
+ * | `lengthUnit` | `"ft" \| "m"` | Unit used by all length fields |
139
+ * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |
140
+ * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |
141
+ * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |
142
+ * | `farRatio` | `number?` | Optional FAR value, positive when provided |
143
+ * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |
144
+ */
145
+ export declare const PluginBuildableEnvelopeCreateArgs: z.ZodObject<{
146
+ sitePolygon: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
147
+ x: z.ZodNumber;
148
+ z: z.ZodNumber;
149
+ }, z.core.$strict>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
150
+ lengthUnit: z.ZodUnion<readonly [z.ZodLiteral<"ft">, z.ZodLiteral<"m">]>;
151
+ setbacks: z.ZodArray<z.ZodObject<{
152
+ aboveHeight: z.ZodNumber;
153
+ front: z.ZodNumber;
154
+ side: z.ZodNumber;
155
+ rear: z.ZodNumber;
156
+ }, z.core.$strict>>;
157
+ verticalCap: z.ZodDiscriminatedUnion<[z.ZodObject<{
158
+ kind: z.ZodLiteral<"max_height">;
159
+ maxHeight: z.ZodNumber;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"max_floors">;
162
+ maxFloors: z.ZodNumber;
163
+ }, z.core.$strict>], "kind">;
164
+ floorToFloor: z.ZodNumber;
165
+ farRatio: z.ZodOptional<z.ZodNumber>;
166
+ lotCoverageMaxPct: z.ZodOptional<z.ZodNumber>;
167
+ }, z.core.$strict>;
168
+ export type PluginBuildableEnvelopeCreateArgs = z.infer<typeof PluginBuildableEnvelopeCreateArgs>;
169
+ /**
170
+ * Result of {@linkcode PluginBuildableEnvelopeApi.create}.
171
+ *
172
+ * | Property | Type | Description |
173
+ * |---|---|---|
174
+ * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the created buildable envelope |
175
+ */
176
+ export declare const PluginBuildableEnvelopeCreateResult: z.ZodObject<{
177
+ buildableEnvelopeId: z.ZodString;
178
+ }, z.core.$strict>;
179
+ export type PluginBuildableEnvelopeCreateResult = z.infer<typeof PluginBuildableEnvelopeCreateResult>;
180
+ /**
181
+ * Arguments for {@linkcode PluginBuildableEnvelopeApi.update}.
182
+ *
183
+ * Strict schema. `buildableEnvelopeId` is required and identifies the prior
184
+ * envelope on the canvas to update.
185
+ *
186
+ * | Property | Type | Description |
187
+ * |---|---|---|
188
+ * | `buildableEnvelopeId` | `string` | Existing envelope ID to update; non-empty |
189
+ * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |
190
+ * | `lengthUnit` | `"ft" \| "m"` | Unit used by all length fields |
191
+ * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |
192
+ * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |
193
+ * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |
194
+ * | `farRatio` | `number?` | Optional FAR value, positive when provided |
195
+ * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |
196
+ */
197
+ export declare const PluginBuildableEnvelopeUpdateArgs: z.ZodObject<{
198
+ buildableEnvelopeId: z.ZodString;
199
+ sitePolygon: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
200
+ x: z.ZodNumber;
201
+ z: z.ZodNumber;
202
+ }, z.core.$strict>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
203
+ lengthUnit: z.ZodUnion<readonly [z.ZodLiteral<"ft">, z.ZodLiteral<"m">]>;
204
+ setbacks: z.ZodArray<z.ZodObject<{
205
+ aboveHeight: z.ZodNumber;
206
+ front: z.ZodNumber;
207
+ side: z.ZodNumber;
208
+ rear: z.ZodNumber;
209
+ }, z.core.$strict>>;
210
+ verticalCap: z.ZodDiscriminatedUnion<[z.ZodObject<{
211
+ kind: z.ZodLiteral<"max_height">;
212
+ maxHeight: z.ZodNumber;
213
+ }, z.core.$strict>, z.ZodObject<{
214
+ kind: z.ZodLiteral<"max_floors">;
215
+ maxFloors: z.ZodNumber;
216
+ }, z.core.$strict>], "kind">;
217
+ floorToFloor: z.ZodNumber;
218
+ farRatio: z.ZodOptional<z.ZodNumber>;
219
+ lotCoverageMaxPct: z.ZodOptional<z.ZodNumber>;
220
+ }, z.core.$strict>;
221
+ export type PluginBuildableEnvelopeUpdateArgs = z.infer<typeof PluginBuildableEnvelopeUpdateArgs>;
222
+ /**
223
+ * Result of {@linkcode PluginBuildableEnvelopeApi.update}.
224
+ *
225
+ * | Property | Type | Description |
226
+ * |---|---|---|
227
+ * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the updated buildable envelope |
228
+ */
229
+ export declare const PluginBuildableEnvelopeUpdateResult: z.ZodObject<{
230
+ buildableEnvelopeId: z.ZodString;
231
+ }, z.core.$strict>;
232
+ export type PluginBuildableEnvelopeUpdateResult = z.infer<typeof PluginBuildableEnvelopeUpdateResult>;
233
+ //# sourceMappingURL=buildableEnvelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildableEnvelope.d.ts","sourceRoot":"","sources":["../../../src/api/entity/buildableEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;GASG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;aACa,MAAM,CACpB,IAAI,EAAE,iCAAiC,GACtC,eAAe,CAAC,mCAAmC,CAAC;IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;aACa,MAAM,CACpB,IAAI,EAAE,iCAAiC,GACtC,eAAe,CAAC,mCAAmC,CAAC;CACxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC;;;kEAG/C,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,oCAAoC,CAC5C,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC;;;;;;4BAS7C,CAAA;AAEF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kCAAkC;;;;;kBAKpC,CAAA;AAEX,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AA+BD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;kBAWZ,CAAA;AAElC,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,iCAAiC,CACzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;kBAErC,CAAA;AAEX,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;kBAYZ,CAAA;AAElC,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,iCAAiC,CACzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;kBAErC,CAAA;AAEX,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
@@ -0,0 +1,99 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ /**
4
+ * Department management — create and query departments.
5
+ *
6
+ * A **department** is a named, colored grouping applied to spaces.
7
+ * Departments are used to categorize spaces by function (e.g. "FOH",
8
+ * "Emergency", "Residential") and control their visual appearance.
9
+ *
10
+ * Accessed via `snaptrude.entity.department`.
11
+ */
12
+ export declare abstract class PluginDepartmentApi {
13
+ constructor();
14
+ /**
15
+ * Create a new department.
16
+ *
17
+ * @param args - An object containing:
18
+ * - {@linkcode PluginDepartmentCreateArgs.name args.name} — Display name
19
+ * - {@linkcode PluginDepartmentCreateArgs.color args.color} — CSS hex color string (e.g. `"#b5e1dc"`)
20
+ * @returns A {@linkcode PluginDepartmentCreateResult} with the `departmentId`
21
+ * of the created department
22
+ * @throws If department creation fails
23
+ *
24
+ * # Example
25
+ * ```ts
26
+ * const { departmentId } = await snaptrude.entity.department.create({
27
+ * name: "Emergency",
28
+ * color: "#f5e68b",
29
+ * })
30
+ * ```
31
+ */
32
+ abstract create(args: PluginDepartmentCreateArgs): PluginApiReturn<PluginDepartmentCreateResult>;
33
+ /**
34
+ * Get all departments in the current project.
35
+ *
36
+ * Returns every department including well-known ones (Default, Site, etc.)
37
+ * and user-created departments.
38
+ *
39
+ * @returns A {@linkcode PluginDepartmentGetAllResult} with a `departments` array
40
+ *
41
+ * # Example
42
+ * ```ts
43
+ * const { departments } = await snaptrude.entity.department.getAll()
44
+ * for (const dept of departments) {
45
+ * console.log(dept.id, dept.name, dept.color)
46
+ * }
47
+ * ```
48
+ */
49
+ abstract getAll(): PluginApiReturn<PluginDepartmentGetAllResult>;
50
+ }
51
+ /**
52
+ * Arguments for {@linkcode PluginDepartmentApi.create}.
53
+ *
54
+ * | Property | Type | Description |
55
+ * |---|---|---|
56
+ * | `name` | `string` | Display name of the department |
57
+ * | `color` | `string` | CSS hex color string (e.g. `"#b5e1dc"`) |
58
+ */
59
+ export declare const PluginDepartmentCreateArgs: z.ZodObject<{
60
+ name: z.ZodString;
61
+ color: z.ZodString;
62
+ }, z.core.$strip>;
63
+ export type PluginDepartmentCreateArgs = z.infer<typeof PluginDepartmentCreateArgs>;
64
+ /**
65
+ * Result of {@linkcode PluginDepartmentApi.create}.
66
+ *
67
+ * | Property | Type | Description |
68
+ * |---|---|---|
69
+ * | `departmentId` | `string` | Unique ID of the created department |
70
+ */
71
+ export declare const PluginDepartmentCreateResult: z.ZodObject<{
72
+ departmentId: z.ZodString;
73
+ }, z.core.$strip>;
74
+ export type PluginDepartmentCreateResult = z.infer<typeof PluginDepartmentCreateResult>;
75
+ /**
76
+ * A single department entry returned by {@linkcode PluginDepartmentApi.getAll}.
77
+ */
78
+ export declare const PluginDepartmentEntry: z.ZodObject<{
79
+ id: z.ZodString;
80
+ name: z.ZodString;
81
+ color: z.ZodString;
82
+ }, z.core.$strip>;
83
+ export type PluginDepartmentEntry = z.infer<typeof PluginDepartmentEntry>;
84
+ /**
85
+ * Result of {@linkcode PluginDepartmentApi.getAll}.
86
+ *
87
+ * | Property | Type | Description |
88
+ * |---|---|---|
89
+ * | `departments` | {@linkcode PluginDepartmentEntry}`[]` | All departments in the project |
90
+ */
91
+ export declare const PluginDepartmentGetAllResult: z.ZodObject<{
92
+ departments: z.ZodArray<z.ZodObject<{
93
+ id: z.ZodString;
94
+ name: z.ZodString;
95
+ color: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$strip>;
98
+ export type PluginDepartmentGetAllResult = z.infer<typeof PluginDepartmentGetAllResult>;
99
+ //# sourceMappingURL=department.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"department.d.ts","sourceRoot":"","sources":["../../../src/api/entity/department.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;GAQG;AACH,8BAAsB,mBAAmB;;IAGvC;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,4BAA4B,CAAC;IAEhD;;;;;;;;;;;;;;;OAeG;aACa,MAAM,IAAI,eAAe,CAAC,4BAA4B,CAAC;CACxE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;;;;;iBAEvC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { PluginBuildableEnvelopeApi } from "./buildableEnvelope";
2
+ import { PluginDepartmentApi } from "./department";
3
+ import { PluginReferenceLineApi } from "./referenceLine";
4
+ import { PluginSpaceApi } from "./space";
5
+ import { PluginStoryApi } from "./story";
6
+ /**
7
+ * CRUD operations on Snaptrude building entities.
8
+ *
9
+ * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)
10
+ * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)
11
+ * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines
12
+ * - {@linkcode PluginEntityApi.department} — Create and query departments
13
+ * - {@linkcode PluginEntityApi.buildableEnvelope} — Create or update parametric buildable envelopes
14
+ */
15
+ export declare abstract class PluginEntityApi {
16
+ /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */
17
+ abstract space: PluginSpaceApi;
18
+ /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */
19
+ abstract story: PluginStoryApi;
20
+ /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */
21
+ abstract referenceLine: PluginReferenceLineApi;
22
+ /** Department operations. See {@linkcode PluginDepartmentApi}. */
23
+ abstract department: PluginDepartmentApi;
24
+ /** Buildable Envelope operations. See {@linkcode PluginBuildableEnvelopeApi}. */
25
+ abstract buildableEnvelope: PluginBuildableEnvelopeApi;
26
+ constructor();
27
+ }
28
+ export * from "./buildableEnvelope";
29
+ export * from "./department";
30
+ export * from "./referenceLine";
31
+ export * from "./space";
32
+ export * from "./story";
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;;;;GAQG;AACH,8BAAsB,eAAe;IACnC,oEAAoE;IACpE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,uEAAuE;IACvE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,yEAAyE;IACzE,SAAgB,aAAa,EAAE,sBAAsB,CAAA;IACrD,kEAAkE;IAClE,SAAgB,UAAU,EAAE,mBAAmB,CAAA;IAC/C,iFAAiF;IACjF,SAAgB,iBAAiB,EAAE,0BAA0B,CAAA;;CAG9D;AAED,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}