@snaptrude/plugin-core 0.0.8 → 0.0.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.
- package/AGENTS.md +145 -0
- package/CLAUDE.md +11 -0
- package/dist/api/entity/space.d.ts +4 -0
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/entity/space.ts +2 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Plugin Core — Agent Guide
|
|
2
|
+
|
|
3
|
+
This package is the **single source of truth** for all Snaptrude plugin API definitions.
|
|
4
|
+
Every change here has downstream ripple effects. Follow the checklist below **before
|
|
5
|
+
considering your work done**.
|
|
6
|
+
|
|
7
|
+
## What this package contains
|
|
8
|
+
|
|
9
|
+
- Abstract API classes (`src/api/`) — define method signatures, JSDoc, and Zod schemas
|
|
10
|
+
- Shared types (`src/types.ts`) — `ComponentId`, `PluginApiReturn<T>`, etc.
|
|
11
|
+
- Host utilities (`src/host-utils.ts`) — `PluginApiMethodMap`, `PluginApiMethod`, RPC payload types
|
|
12
|
+
|
|
13
|
+
## Quick commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm check-types # typecheck (no emit)
|
|
17
|
+
pnpm build # tsup build (ESM + CJS)
|
|
18
|
+
pnpm dev # tsup watch mode
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Change propagation checklist
|
|
22
|
+
|
|
23
|
+
Any time you add, remove, rename, or change the signature of an API method or type in
|
|
24
|
+
this package, you **must** propagate changes to all downstream consumers. Use this
|
|
25
|
+
checklist:
|
|
26
|
+
|
|
27
|
+
### 1. Client implementation — `packages/plugin-client/`
|
|
28
|
+
|
|
29
|
+
> See [`packages/plugin-client/AGENTS.md`](../../packages/plugin-client/AGENTS.md) for client-specific guidance.
|
|
30
|
+
|
|
31
|
+
Every abstract method in `plugin-core` has a concrete implementation in `plugin-client`.
|
|
32
|
+
The file structure mirrors this package 1:1:
|
|
33
|
+
|
|
34
|
+
| plugin-core source | plugin-client counterpart |
|
|
35
|
+
| ------------------------------------- | ------------------------------------------ |
|
|
36
|
+
| `src/api/core/math/vec3.ts` | `src/api/core/math/vec3.ts` |
|
|
37
|
+
| `src/api/core/math/quat.ts` | `src/api/core/math/quat.ts` |
|
|
38
|
+
| `src/api/core/geom/line.ts` | `src/api/core/geom/line.ts` |
|
|
39
|
+
| `src/api/core/geom/arc.ts` | `src/api/core/geom/arc.ts` |
|
|
40
|
+
| `src/api/core/geom/curve.ts` | `src/api/core/geom/curve.ts` |
|
|
41
|
+
| `src/api/core/geom/profile.ts` | `src/api/core/geom/profile.ts` |
|
|
42
|
+
| `src/api/entity/space.ts` | `src/api/entity/space.ts` |
|
|
43
|
+
| `src/api/entity/story.ts` | `src/api/entity/story.ts` |
|
|
44
|
+
| `src/api/entity/referenceLine.ts` | `src/api/entity/referenceLine.ts` |
|
|
45
|
+
| `src/api/entity/department.ts` | `src/api/entity/department.ts` |
|
|
46
|
+
| `src/api/tools/selection.ts` | `src/api/tools/selection.ts` |
|
|
47
|
+
| `src/api/tools/transform.ts` | `src/api/tools/transform.ts` |
|
|
48
|
+
| `src/api/units/index.ts` | `src/api/units/index.ts` |
|
|
49
|
+
|
|
50
|
+
- **New method**: Add the concrete implementation (pure math = direct impl; host API = `getHostApi().call(...)`)
|
|
51
|
+
- **Removed method**: Delete from client
|
|
52
|
+
- **Renamed/signature change**: Update the client method to match
|
|
53
|
+
- **New API module** (new file): Create the corresponding client file and wire it into the parent barrel (`index.ts`)
|
|
54
|
+
|
|
55
|
+
### 2. Host implementation — `apps/snaptrudereact/src/app/plugins/api/`
|
|
56
|
+
|
|
57
|
+
> See [`apps/snaptrudereact/src/app/plugins/AGENTS.md`](../../apps/snaptrudereact/src/app/plugins/AGENTS.md) for host-specific guidance.
|
|
58
|
+
|
|
59
|
+
Same 1:1 mirror. Host classes extend the abstract classes from plugin-core and provide
|
|
60
|
+
the actual Snaptrude-internal implementation.
|
|
61
|
+
|
|
62
|
+
- **New method**: Implement using Snaptrude internals. Use Zod `.parse()` for input validation.
|
|
63
|
+
- **Removed method**: Delete from host
|
|
64
|
+
- **Renamed/signature change**: Update the host method to match
|
|
65
|
+
- **New API module**: Create the host file, wire into barrel, and add to `SnaptrudePluginApi` in `api/index.ts`
|
|
66
|
+
- **New types/converters**: If the new API introduces types that bridge plugin <-> internal representations, add converters in `apps/snaptrudereact/src/app/plugins/converters/`
|
|
67
|
+
|
|
68
|
+
### 3. JSDoc — keep it complete
|
|
69
|
+
|
|
70
|
+
All public methods and types **must** have JSDoc with:
|
|
71
|
+
- A brief description
|
|
72
|
+
- `@param` for each parameter (with type and description)
|
|
73
|
+
- `@returns` description
|
|
74
|
+
- `@example` where helpful (especially for entity/tools APIs)
|
|
75
|
+
|
|
76
|
+
JSDoc in this package is the source of truth for the API docs site.
|
|
77
|
+
|
|
78
|
+
### 4. API documentation — `apps/snaptrudereact/api-docs/`
|
|
79
|
+
|
|
80
|
+
> See [`apps/snaptrudereact/api-docs/AGENTS.md`](../../apps/snaptrudereact/api-docs/AGENTS.md) for the full source-to-doc mapping and sync procedure.
|
|
81
|
+
|
|
82
|
+
In summary:
|
|
83
|
+
|
|
84
|
+
- **Changed method**: Update the corresponding `.md` doc page to match the new JSDoc
|
|
85
|
+
- **New API module**: Create a new doc page following the template in `AGENTS.md`, and add it to `.vitepress/sidebar.mts`
|
|
86
|
+
- **Removed API module**: Delete the doc page and remove from sidebar
|
|
87
|
+
|
|
88
|
+
### 5. Console tests — `apps/snaptrudereact/src/app/plugins/apiConsoleTesting/`
|
|
89
|
+
|
|
90
|
+
> See [`apps/snaptrudereact/src/app/plugins/AGENTS.md`](../../apps/snaptrudereact/src/app/plugins/AGENTS.md) for test harness details.
|
|
91
|
+
|
|
92
|
+
These are in-browser integration tests that exercise the plugin API end-to-end.
|
|
93
|
+
|
|
94
|
+
| plugin-core API module | Test file |
|
|
95
|
+
| ----------------------------- | -------------------------- |
|
|
96
|
+
| `core/math/*` | `tests/math.ts` |
|
|
97
|
+
| `core/geom/*` | `tests/geom.ts` |
|
|
98
|
+
| `entity/space.ts` | `tests/spaces.ts` |
|
|
99
|
+
| `entity/story.ts` | `tests/story.ts` |
|
|
100
|
+
| `entity/referenceLine.ts` | `tests/referenceLines.ts` |
|
|
101
|
+
| `entity/department.ts` | `tests/departments.ts` |
|
|
102
|
+
| `tools/selection.ts` | `tests/selection.ts` |
|
|
103
|
+
| `tools/transform.ts` | `tests/transform.ts` |
|
|
104
|
+
| `units/index.ts` | `tests/units.ts` |
|
|
105
|
+
|
|
106
|
+
- **New method**: Add test cases covering the new method
|
|
107
|
+
- **Removed method**: Remove corresponding tests
|
|
108
|
+
- **Signature change**: Update test calls to match new signature
|
|
109
|
+
- **New API module**: Create a new test file under `tests/` and import it in `tests/index.ts`
|
|
110
|
+
|
|
111
|
+
### 6. Host-side Jest unit tests
|
|
112
|
+
|
|
113
|
+
Some host implementations have co-located `.test.ts` files:
|
|
114
|
+
- `api/core/math/vec3.test.ts`, `quat.test.ts`
|
|
115
|
+
- `api/core/geom/line.test.ts`, `arc.test.ts`, `curve.test.ts`
|
|
116
|
+
- `api/units/index.test.ts`
|
|
117
|
+
|
|
118
|
+
If your change affects pure math/geom/units logic, update the corresponding Jest tests.
|
|
119
|
+
|
|
120
|
+
### 7. Downstream consumers (breaking changes only)
|
|
121
|
+
|
|
122
|
+
If your change is **breaking** (removed method, renamed method, changed required args),
|
|
123
|
+
check **all** consumers of `@snaptrude/plugin-client` or `@snaptrude/plugin-core`:
|
|
124
|
+
|
|
125
|
+
- Internal plugins under `plugins/`
|
|
126
|
+
- Example plugins under `examples/` — these are consumer-facing templates used by
|
|
127
|
+
`create-snaptrude-plugin`, so they must compile and demonstrate correct API usage
|
|
128
|
+
|
|
129
|
+
Search these directories for usage of the changed API and update accordingly.
|
|
130
|
+
|
|
131
|
+
## Adding a new API namespace (end-to-end)
|
|
132
|
+
|
|
133
|
+
When adding an entirely new namespace (e.g. `snaptrude.materials`):
|
|
134
|
+
|
|
135
|
+
1. **plugin-core**: Create abstract class + Zod schemas + types in `src/api/<namespace>/`
|
|
136
|
+
2. **plugin-core**: Export from `src/api/index.ts` and add as property on `PluginApi`
|
|
137
|
+
3. **plugin-core**: Verify `host-utils.ts` types auto-infer the new methods (they should via `ExtractMethodPaths`)
|
|
138
|
+
4. **plugin-client**: Create client implementation in `src/api/<namespace>/`
|
|
139
|
+
5. **plugin-client**: Wire into `ClientPluginApi` and export from `src/api/index.ts`
|
|
140
|
+
6. **host**: Create host implementation in `apps/snaptrudereact/src/app/plugins/api/<namespace>/`
|
|
141
|
+
7. **host**: Add to `SnaptrudePluginApi` class in `api/index.ts`
|
|
142
|
+
8. **docs**: Create doc pages, update sidebar, follow [`apps/snaptrudereact/api-docs/AGENTS.md`](../../apps/snaptrudereact/api-docs/AGENTS.md) template
|
|
143
|
+
9. **tests**: Add console test file + Jest tests for pure logic
|
|
144
|
+
10. **examples**: Update example plugins if they should showcase the new namespace
|
|
145
|
+
11. **build**: Run `pnpm check-types` in plugin-core, plugin-client, and snaptrudereact
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
> **All coding standards, checks, and guidance live in [`AGENTS.md`](AGENTS.md).**
|
|
4
|
+
> `CLAUDE.md` is a pointer only — add all new rules, patterns, and instructions to `AGENTS.md`.
|
|
5
|
+
|
|
6
|
+
See [AGENTS.md](AGENTS.md) for:
|
|
7
|
+
|
|
8
|
+
- What this package contains and quick commands
|
|
9
|
+
- **Change propagation checklist** — the mandatory downstream sync steps for any API change
|
|
10
|
+
- File mappings to plugin-client, host implementation, docs, and tests
|
|
11
|
+
- End-to-end guide for adding a new API namespace
|
|
@@ -379,6 +379,7 @@ export type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>;
|
|
|
379
379
|
* | `"Deck"` | Deck |
|
|
380
380
|
* | `"Pool"` | Pool |
|
|
381
381
|
* | `"Walkway"` | Walkway |
|
|
382
|
+
* | `"Parking"` | Parking area |
|
|
382
383
|
*/
|
|
383
384
|
export declare const PluginSpaceType: z.ZodEnum<{
|
|
384
385
|
Room: "Room";
|
|
@@ -389,6 +390,7 @@ export declare const PluginSpaceType: z.ZodEnum<{
|
|
|
389
390
|
Deck: "Deck";
|
|
390
391
|
Pool: "Pool";
|
|
391
392
|
Walkway: "Walkway";
|
|
393
|
+
Parking: "Parking";
|
|
392
394
|
}>;
|
|
393
395
|
/**
|
|
394
396
|
* Result of {@linkcode PluginSpaceApi.get}.
|
|
@@ -415,6 +417,7 @@ export declare const PluginSpaceGetResult: z.ZodObject<{
|
|
|
415
417
|
Deck: "Deck";
|
|
416
418
|
Pool: "Pool";
|
|
417
419
|
Walkway: "Walkway";
|
|
420
|
+
Parking: "Parking";
|
|
418
421
|
}>>>;
|
|
419
422
|
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
420
423
|
departmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -570,6 +573,7 @@ export declare const PluginSpaceUpdateArgs: z.ZodObject<{
|
|
|
570
573
|
Deck: "Deck";
|
|
571
574
|
Pool: "Pool";
|
|
572
575
|
Walkway: "Walkway";
|
|
576
|
+
Parking: "Parking";
|
|
573
577
|
}>>;
|
|
574
578
|
departmentId: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
575
579
|
DEFAULT: "DEFAULT";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAK7C;;;;;;;;;;;GAWG;AACH,8BAAsB,cAAc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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BrB,CAAA;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;iBAElC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE,sFAAsF;AACtF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;EAazB,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B;;;;;EAKtC,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;eAG7B,CAAA;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQhC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
package/dist/index.cjs
CHANGED
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["export * from \"./api\"\nexport * from \"./types\"\nexport * from \"./host-utils\"\n","import * as z from \"zod\"\n\n/**\n * 3D vector operations for positions, directions, and displacements.\n *\n * All methods are **pure** — they return new {@linkcode PVec3} values\n * without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.vec3`.\n */\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /**\n * Create a new 3D vector.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @returns A new {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const position = snaptrude.core.math.vec3.new(1, 2, 3)\n * // { x: 1, y: 2, z: 3 }\n * ```\n */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /**\n * Add two vectors component-wise.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`\n */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /**\n * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.\n *\n * @param a - Vector to subtract from\n * @param b - Vector to subtract\n * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`\n */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /**\n * Scale a vector by a scalar value.\n *\n * @param v - The vector to scale\n * @param scalar - The scalar multiplier\n * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`\n */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /**\n * Compute the dot product of two vectors.\n *\n * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle\n * between the vectors. Useful for checking orthogonality (result = 0)\n * or projection.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns The scalar dot product\n */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /**\n * Compute the cross product of two vectors.\n *\n * The result is a vector perpendicular to both inputs, with magnitude\n * equal to the area of the parallelogram they span. Useful for computing\n * surface normals.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}\n */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /**\n * Compute the length (magnitude) of a vector.\n *\n * @param v - The vector\n * @returns The Euclidean length `√(x² + y² + z²)`\n */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /**\n * Compute the squared length of a vector.\n *\n * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}\n * when comparing relative magnitudes.\n *\n * @param v - The vector\n * @returns The squared length `x² + y² + z²`\n */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /**\n * Normalize a vector to unit length.\n *\n * @param v - The vector to normalize\n * @returns A new unit-length {@linkcode PVec3} in the same direction,\n * or a zero vector `(0, 0, 0)` if the input has zero length\n */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /**\n * Compute the Euclidean distance between two points.\n *\n * @param a - First point\n * @param b - Second point\n * @returns The distance `|a - b|`\n */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /**\n * Linearly interpolate between two vectors.\n *\n * @param a - Start vector (returned when `t = 0`)\n * @param b - End vector (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new {@linkcode PVec3} at `a + (b - a) * t`\n */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /**\n * Negate a vector (reverse its direction).\n *\n * @param v - The vector to negate\n * @returns A new {@linkcode PVec3} with all components negated\n */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /**\n * Check if two vectors are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns `true` if all components match exactly\n */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /**\n * Check if two vectors are approximately equal within a tolerance.\n *\n * @param a - First vector\n * @param b - Second vector\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\n/**\n * A 3D vector with `x`, `y`, and `z` components.\n *\n * Used throughout the plugin API for positions, directions, displacements,\n * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.\n */\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\n/**\n * Quaternion operations for 3D rotations.\n *\n * Quaternions avoid gimbal lock and provide smooth interpolation\n * compared to Euler angles. All methods are **pure** — they return\n * new {@linkcode PQuat} values without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.quat`.\n */\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /**\n * Create a new quaternion from raw components.\n *\n * For most use cases prefer {@linkcode PluginQuatApi.fromAxisAngle}\n * or {@linkcode PluginQuatApi.fromEuler} instead.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @param w - The W (scalar) component\n * @returns A new {@linkcode PQuat}\n */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /**\n * Create an identity quaternion representing no rotation.\n *\n * @returns `{ x: 0, y: 0, z: 0, w: 1 }`\n */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /**\n * Create a quaternion from an axis and an angle.\n *\n * @param axis - The rotation axis as a {@linkcode PVec3} (will be normalized internally)\n * @param angle - The rotation angle in **radians**\n * @returns A new unit {@linkcode PQuat}, or identity if {@linkcode axis} has zero length\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * // 90° rotation around the Y axis\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * ```\n */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /**\n * Create a quaternion from Euler angles in **XYZ** rotation order.\n *\n * @param x - Rotation around X axis in **radians**\n * @param y - Rotation around Y axis in **radians**\n * @param z - Rotation around Z axis in **radians**\n * @returns A new {@linkcode PQuat}\n */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /**\n * Multiply two quaternions, combining their rotations.\n *\n * Quaternion multiplication is **not commutative**: `a * b ≠ b * a`.\n * The result applies rotation {@linkcode b} first, then {@linkcode a}.\n *\n * @param a - First quaternion (applied second)\n * @param b - Second quaternion (applied first)\n * @returns A new {@linkcode PQuat} representing the combined rotation\n */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /**\n * Compute the conjugate of a quaternion.\n *\n * For unit quaternions the conjugate equals the inverse.\n *\n * @param q - The quaternion\n * @returns A new {@linkcode PQuat} with negated vector part `(-x, -y, -z, w)`\n */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /**\n * Compute the length (magnitude) of a quaternion.\n *\n * @param q - The quaternion\n * @returns The magnitude `√(x² + y² + z² + w²)`\n */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /**\n * Normalize a quaternion to unit length.\n *\n * @param q - The quaternion to normalize\n * @returns A new unit-length {@linkcode PQuat}, or identity if the input has zero length\n */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /**\n * Compute the inverse of a quaternion.\n *\n * The inverse satisfies `q * inverse(q) = identity`.\n *\n * @param q - The quaternion to invert\n * @returns A new {@linkcode PQuat} that is the multiplicative inverse,\n * or identity if the input has zero length\n */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /**\n * Rotate a 3D vector by a quaternion.\n *\n * Computes `q * v * conjugate(q)` using the Hamilton product.\n *\n * @param q - The rotation quaternion (should be unit-length)\n * @param v - The vector to rotate as a {@linkcode PVec3}\n * @returns A new rotated {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * const rotated = quat.rotateVec3(rot, vec3.new(1, 0, 0))\n * // ≈ { x: 0, y: 0, z: -1 }\n * ```\n */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /**\n * Convert a quaternion to axis-angle representation.\n *\n * @param q - The quaternion to convert\n * @returns An object with:\n * - `axis` — The rotation axis as a unit {@linkcode PVec3}\n * (defaults to `(1, 0, 0)` when angle is zero)\n * - `angle` — The rotation angle in **radians**\n */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /**\n * Spherical linear interpolation between two quaternions.\n *\n * Produces smooth constant-speed rotation between {@linkcode a} and {@linkcode b}.\n *\n * @param a - Start quaternion (returned when `t = 0`)\n * @param b - End quaternion (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new interpolated {@linkcode PQuat}\n */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /**\n * Compute the dot product of two quaternions.\n *\n * A value close to `1` or `-1` indicates similar orientations;\n * a value close to `0` indicates maximally different orientations.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns The scalar dot product\n */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /**\n * Check if two quaternions are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginQuatApi.equalsApprox}.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns `true` if all components match exactly\n */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /**\n * Check if two quaternions are approximately equal within a tolerance.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\n/**\n * A quaternion with `x`, `y`, `z`, and `w` components.\n *\n * Used for representing 3D rotations without gimbal lock.\n * Equivalent to `BABYLON.Quaternion`.\n */\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\n/**\n * Math primitives for 3D vector and quaternion operations.\n *\n * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic\n * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations\n */\nexport abstract class PluginMathApi {\n /** 3D vector operations. See {@linkcode PluginVec3Api}. */\n public abstract vec3: PluginVec3Api\n /** Quaternion operations. See {@linkcode PluginQuatApi}. */\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Line segment construction.\n *\n * A {@linkcode PLine} is the simplest curve primitive — a straight\n * segment between two 3D points. Lines can be wrapped as a\n * {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.line`.\n */\nexport abstract class PluginLineApi {\n constructor() {}\n\n /**\n * Create a new line segment between two points.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @returns A new {@linkcode PLine}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { line } = snaptrude.core.geom\n *\n * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\n/**\n * A line segment defined by a start and end point.\n *\n * Discriminated by `curveType: \"Line\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Line\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the segment |\n * | `endPoint` | {@linkcode PVec3} | End point of the segment |\n */\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Arc construction.\n *\n * A {@linkcode PArc} represents a circular arc in 3D space, defined by\n * start/end points, a centre, and a rotation axis. Arcs can be wrapped\n * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.arc`.\n */\nexport abstract class PluginArcApi {\n constructor() {}\n\n /**\n * Create a new arc from start, end, centre, and axis.\n *\n * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}\n * along the circle centred at {@linkcode centrePoint}, in the\n * direction determined by the right-hand rule around {@linkcode axis}.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}\n * @param axis - The arc's rotation axis as a {@linkcode PVec3}\n * (perpendicular to the arc's plane)\n * @returns A new {@linkcode PArc}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { arc } = snaptrude.core.geom\n *\n * // Quarter-circle arc on the XZ plane\n * const a = arc.new(\n * vec3.new(1, 0, 0), // start\n * vec3.new(0, 0, 1), // end\n * vec3.new(0, 0, 0), // centre\n * vec3.new(0, 1, 0), // Y-up axis\n * )\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\n/**\n * A circular arc defined by start, end, centre, and axis.\n *\n * Discriminated by `curveType: \"Arc\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Arc\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the arc |\n * | `endPoint` | {@linkcode PVec3} | End point of the arc |\n * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |\n * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |\n */\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\n/**\n * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.\n *\n * Use this to build heterogeneous curve lists (mixing lines and arcs)\n * when constructing a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.curve`.\n */\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /**\n * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.\n *\n * This is an identity operation — it simply returns the input unchanged.\n * It exists for type-level clarity when building mixed curve lists.\n *\n * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap\n * @returns The same value typed as {@linkcode PCurve}\n */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\n/**\n * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.\n *\n * Discriminated on the `curveType` field:\n * - `\"Line\"` → {@linkcode PLine}\n * - `\"Arc\"` → {@linkcode PArc}\n *\n * Use `curve.curveType` to narrow the type in a switch or if-statement.\n */\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\n/**\n * Profile construction — a closed loop of {@linkcode PCurve}s.\n *\n * Profiles are the primary 2D shape primitive used for creating\n * extruded entities like spaces. Build profiles either from an\n * explicit list of curves or from a list of points (auto-connected\n * with line segments).\n *\n * Accessed via `snaptrude.core.geom.profile`.\n */\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /**\n * Create a profile from an ordered list of curves.\n *\n * The curves should form a closed loop — the end point of each curve\n * should coincide with the start point of the next.\n *\n * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop\n * @returns A new {@linkcode PProfile}\n */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /**\n * Create a profile by connecting a list of points with line segments.\n *\n * The points are connected in order, with the last point automatically\n * connected back to the first to close the loop.\n *\n * This is a **host API call** — it returns a `Promise`.\n *\n * @param args - An object containing:\n * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered\n * array of {@linkcode PVec3} forming the profile vertices\n * @returns A {@linkcode PProfile} with line-segment curves connecting the points\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Create an L-shaped profile\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 5),\n * vec3.new(5, 0, 5),\n * vec3.new(5, 0, 10),\n * vec3.new(0, 0, 10),\n * ],\n * })\n * ```\n */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\n/**\n * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |\n */\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\n/**\n * A closed profile composed of an ordered list of curves.\n *\n * Profiles are used as input to entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |\n */\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\n/**\n * Geometry primitives for constructing 2D/3D shapes.\n *\n * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.\n * Profiles can then be used with entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * - {@linkcode PluginGeomApi.line} — Line segment construction\n * - {@linkcode PluginGeomApi.arc} — Arc construction\n * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)\n * - {@linkcode PluginGeomApi.profile} — Closed loop of curves\n */\nexport abstract class PluginGeomApi {\n /** Line segment construction. See {@linkcode PluginLineApi}. */\n public abstract line: PluginLineApi\n /** Arc construction. See {@linkcode PluginArcApi}. */\n public abstract arc: PluginArcApi\n /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */\n public abstract curve: PluginCurveApi\n /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\n/**\n * Core primitives used across the plugin API.\n *\n * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations\n * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)\n */\nexport abstract class PluginCoreApi {\n /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */\n public abstract math: PluginMathApi\n /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Department management — create and query departments.\n *\n * A **department** is a named, colored grouping applied to spaces.\n * Departments are used to categorize spaces by function (e.g. \"FOH\",\n * \"Emergency\", \"Residential\") and control their visual appearance.\n *\n * Accessed via `snaptrude.entity.department`.\n */\nexport abstract class PluginDepartmentApi {\n constructor() {}\n\n /**\n * Create a new department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginDepartmentCreateArgs.name args.name} — Display name\n * - {@linkcode PluginDepartmentCreateArgs.color args.color} — CSS hex color string (e.g. `\"#b5e1dc\"`)\n * @returns A {@linkcode PluginDepartmentCreateResult} with the `departmentId`\n * of the created department\n * @throws If department creation fails\n *\n * # Example\n * ```ts\n * const { departmentId } = await snaptrude.entity.department.create({\n * name: \"Emergency\",\n * color: \"#f5e68b\",\n * })\n * ```\n */\n public abstract create(\n args: PluginDepartmentCreateArgs\n ): PluginApiReturn<PluginDepartmentCreateResult>\n\n /**\n * Get all departments in the current project.\n *\n * Returns every department including well-known ones (Default, Site, etc.)\n * and user-created departments.\n *\n * @returns A {@linkcode PluginDepartmentGetAllResult} with a `departments` array\n *\n * # Example\n * ```ts\n * const { departments } = await snaptrude.entity.department.getAll()\n * for (const dept of departments) {\n * console.log(dept.id, dept.name, dept.color)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginDepartmentGetAllResult>\n}\n\n/**\n * Arguments for {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `name` | `string` | Display name of the department |\n * | `color` | `string` | CSS hex color string (e.g. `\"#b5e1dc\"`) |\n */\nexport const PluginDepartmentCreateArgs = z.object({\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentCreateArgs = z.infer<\n typeof PluginDepartmentCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departmentId` | `string` | Unique ID of the created department |\n */\nexport const PluginDepartmentCreateResult = z.object({\n departmentId: z.string(),\n})\n\nexport type PluginDepartmentCreateResult = z.infer<\n typeof PluginDepartmentCreateResult\n>\n\n/**\n * A single department entry returned by {@linkcode PluginDepartmentApi.getAll}.\n */\nexport const PluginDepartmentEntry = z.object({\n id: z.string(),\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentEntry = z.infer<typeof PluginDepartmentEntry>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departments` | {@linkcode PluginDepartmentEntry}`[]` | All departments in the project |\n */\nexport const PluginDepartmentGetAllResult = z.object({\n departments: z.array(PluginDepartmentEntry),\n})\n\nexport type PluginDepartmentGetAllResult = z.infer<\n typeof PluginDepartmentGetAllResult\n>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PProfile } from \"../core/geom/profile\"\nimport { PCurve } from \"../core/geom/curve\"\n\n/**\n * Reference line management — create, query, and delete reference lines.\n *\n * A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,\n * typically used for grid lines and alignment guides. Reference lines\n * carry properties such as grid tags, labels, and line styles.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.referenceLine`.\n */\nexport abstract class PluginReferenceLineApi {\n constructor() {}\n\n /**\n * Create multiple reference lines from a profile.\n *\n * Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes\n * a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`\n * internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A\n * {@linkcode PProfile} whose curves define the reference lines to create\n * @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the\n * `referenceLineIds` of the created reference lines\n * @throws If reference line creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))\n * const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))\n * const profile = snaptrude.core.geom.profile.new([l1, l2])\n *\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({\n * profile,\n * })\n * ```\n */\n public abstract createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): PluginApiReturn<PluginReferenceLineCreateMultiResult>\n\n /**\n * Get properties of a reference line by its ID.\n *\n * Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID\n * - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of\n * property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.\n * @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the\n * requested properties\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.referenceLine.get({\n * referenceLineId: \"some-ref-line-id\",\n * properties: [\"curve\"],\n * })\n * console.log(result.curve) // PCurve\n * ```\n */\n public abstract get(\n args: PluginReferenceLineGetArgs\n ): PluginApiReturn<PluginReferenceLineGetResult>\n\n /**\n * Get the IDs of all reference lines in the current project.\n *\n * Returns every reference line across all stories.\n * Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query\n * individual reference line properties.\n *\n * @returns A {@linkcode PluginReferenceLineGetAllResult} with a\n * `referenceLineIds` array\n *\n * # Example\n * ```ts\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()\n * console.log(`Project has ${referenceLineIds.length} reference lines`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>\n\n /**\n * Delete a reference line by its ID.\n *\n * Permanently removes the reference line and its associated mesh from\n * the scene. This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID to delete\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * await snaptrude.entity.referenceLine.delete({\n * referenceLineId: \"some-ref-line-id\",\n * })\n * ```\n */\n public abstract delete(\n args: PluginReferenceLineDeleteArgs\n ): PluginApiReturn<PluginReferenceLineDeleteResult>\n}\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |\n */\nexport const PluginReferenceLineCreateMultiArgs = z.object({\n profile: PProfile,\n})\n\nexport type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of the created reference lines |\n */\nexport const PluginReferenceLineCreateMultiResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>\n\n/**\n * Available properties that can be queried on a reference line.\n *\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"curve\"` | {@linkcode PCurve} | The curve geometry of the reference line |\n */\nexport const PluginReferenceLineGetProperty = z.enum([\n \"curve\",\n])\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to query |\n * | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginReferenceLineGetArgs = z.object({\n referenceLineId: z.string(),\n properties: z.array(PluginReferenceLineGetProperty),\n})\n\nexport type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginReferenceLineGetArgs.properties} will be present.\n */\nexport const PluginReferenceLineGetResult = z\n .object({\n curve: PCurve,\n })\n .partial()\n\nexport type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |\n */\nexport const PluginReferenceLineGetAllResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to delete |\n */\nexport const PluginReferenceLineDeleteArgs = z.object({\n referenceLineId: z.string(),\n})\n\nexport type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>\n\n/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */\nexport type PluginReferenceLineDeleteResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\n/**\n * Space (room/mass) management — create, query, and delete spaces.\n *\n * A **space** is a 3D volume representing a room or mass in the\n * Snaptrude scene. Spaces live on a particular story and carry\n * properties such as name, area, department, and room type.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.space`.\n */\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n /**\n * Create a rectangular (box) space.\n *\n * Generates an axis-aligned box with the given dimensions at the\n * specified position. The created space is automatically assigned\n * to the active story and a default department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin\n * position as a {@linkcode PVec3} in Babylon units\n * - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box\n * dimensions `{ width, height, depth }` in Babylon units\n * @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`\n * of the created space\n * @throws If space creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * })\n * ```\n */\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n /**\n * Create a space by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is extruded\n * upward (along the Y axis) by {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight\n * extrudeHeight}, then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. The created space is automatically assigned to the active story\n * and a default department.\n *\n * Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile\n * from a list of points.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed\n * {@linkcode PProfile} defining the floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —\n * Extrusion height in Babylon units\n * - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset\n * position as a {@linkcode PVec3} in Babylon units\n * @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`\n * of the created space\n * @throws If the profile is invalid or mesh creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 8),\n * vec3.new(0, 0, 8),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile,\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Get the IDs of all spaces in the current project.\n *\n * Returns every space (mass that is not a building) across all stories.\n * Use the returned IDs with {@linkcode PluginSpaceApi.get} to query\n * individual space properties.\n *\n * @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array\n *\n * # Example\n * ```ts\n * const { spacesIds } = await snaptrude.entity.space.getAll()\n * console.log(`Project has ${spacesIds.length} spaces`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n /**\n * Get properties of a space by its ID.\n *\n * Only the properties listed in {@linkcode PluginSpaceGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID\n * (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})\n * - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property\n * names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.\n * @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested\n * properties\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-space-id\",\n * properties: [\"name\", \"area\", \"position\"],\n * })\n * console.log(info.name, info.area, info.position)\n * ```\n */\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n /**\n * Delete a space by its ID.\n *\n * Permanently removes the space and its associated mesh from the scene.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID\n * to delete\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.delete({ spaceId: \"some-space-id\" })\n * ```\n */\n public abstract delete({\n spaceId,\n }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>\n\n /**\n * Update properties of a space by its ID.\n *\n * Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties\n * args.properties} will be updated — omitted properties remain unchanged.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID\n * to update\n * - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs\n * of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.\n * @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and\n * the updated property values\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.space.update({\n * spaceId: \"some-space-id\",\n * properties: {\n * room_type: \"Kitchen\",\n * massType: \"Room\",\n * departmentId: \"CORE\",\n * },\n * })\n * ```\n */\n public abstract update(\n args: PluginSpaceUpdateArgs\n ): PluginApiReturn<PluginSpaceUpdateResult>\n}\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `position` | {@linkcode PVec3} | Origin position in Babylon units |\n * | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |\n */\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<\n typeof PluginSpaceCreateRectangularArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<\n typeof PluginSpaceCreateRectangularResult\n>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |\n * | `extrudeHeight` | `number` | Extrusion height in Babylon units |\n * | `position` | {@linkcode PVec3} | Offset position in Babylon units |\n */\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<\n typeof PluginSpaceCreateFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<\n typeof PluginSpaceCreateFromProfileResult\n>\n\n/**\n * Available properties that can be queried on a space.\n *\n * **Basic:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"id\"` | `string` | Unique space identifier |\n * | `\"type\"` | `string` | Component type |\n * | `\"room_type\"` | `string` | Room type classification |\n * | `\"name\"` | `string` | Display name of the space |\n *\n * **Derived from parametric data:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"area\"` | `number` | Bottom face area (from `areas_bottomFace`) |\n * | `\"breadth\"` | `number` | Breadth dimension |\n * | `\"depth\"` | `number` | Depth dimension |\n * | `\"height\"` | `number` | Height dimension |\n * | `\"massType\"` | `string \\| null` | Mass type classification |\n * | `\"spaceType\"` | `string \\| null` | Space type classification (Room, Balcony, etc.) |\n * | `\"storey\"` | `number \\| null` | Story the space belongs to |\n * | `\"departmentId\"` | `string \\| null` | Assigned department ID |\n * | `\"departmentName\"` | `string` | Assigned department name |\n * | `\"departmentColor\"` | `string` | Assigned department color (hex/CSS) |\n *\n * **Derived from mesh:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"position\"` | {@linkcode PVec3} | Local position relative to parent |\n * | `\"absolutePosition\"` | {@linkcode PVec3} | Absolute position in the scene |\n * | `\"rotation\"` | {@linkcode PVec3} | Euler rotation angles (radians) |\n * | `\"rotationQuaternion\"` | {@linkcode PQuat} \\| `null` | Quaternion rotation, or `null` if unset |\n *\n * **Derived from brep:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"planPoints\"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |\n */\nexport const PluginSpaceGetProperty = z.enum([\n // Basic\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n // Derived from parametric data\n \"area\",\n \"breadth\",\n \"depth\",\n \"height\",\n \"massType\",\n \"spaceType\",\n \"storey\",\n \"departmentId\",\n \"departmentName\",\n \"departmentColor\",\n // Derived from mesh\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n // Derived from brep\n \"planPoints\",\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to query |\n * | `properties` | {@linkcode PluginSpaceGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\n/**\n * Supported space type values.\n *\n * Mirrors the internal `SpaceType` enum from `spaceType.types.ts`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Room\"` | Standard room |\n * | `\"Program Block\"` | Program/department block |\n * | `\"Balcony\"` | Balcony space |\n * | `\"Road\"` | Road |\n * | `\"Garden\"` | Garden area |\n * | `\"Deck\"` | Deck |\n * | `\"Pool\"` | Pool |\n * | `\"Walkway\"` | Walkway |\n */\nexport const PluginSpaceType = z.enum([\n \"Room\",\n \"Program Block\",\n \"Balcony\",\n \"Road\",\n \"Garden\",\n \"Deck\",\n \"Pool\",\n \"Walkway\",\n])\n\n/**\n * Result of {@linkcode PluginSpaceApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginSpaceGetArgs.properties} will be present.\n */\nexport const PluginSpaceGetResult = z\n .object({\n // Basic\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n // Derived from parametric data\n area: z.number(),\n breadth: z.number(),\n depth: z.number(),\n height: z.number(),\n massType: z.string().nullable(),\n spaceType: PluginSpaceType.nullable(),\n storey: z.number().nullable(),\n departmentId: z.string().nullable(),\n departmentName: z.string(),\n departmentColor: z.string(),\n // Derived from mesh\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n // Derived from brep\n planPoints: z.array(PVec3),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\n/**\n * Result of {@linkcode PluginSpaceApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spacesIds` | `string[]` | IDs of all spaces in the project |\n */\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to delete |\n */\nexport const PluginSpaceDeleteArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>\n\n/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */\nexport type PluginSpaceDeleteResult = void\n\n/**\n * Supported mass type values for {@linkcode PluginSpaceUpdateArgs.properties.massType}.\n *\n * Mirrors the internal `MASS_TYPES` enum.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Plinth\"` | Plinth mass |\n * | `\"Void\"` | Void/cut-out |\n * | `\"Pergola\"` | Pergola structure |\n * | `\"Furniture\"` | Furniture element |\n * | `\"Facade element\"` | Facade element |\n * | `\"Generic mass\"` | Generic mass |\n * | `\"Room\"` | Room (default for spaces) |\n * | `\"Department\"` | Department block |\n * | `\"Building\"` | Building envelope |\n * | `\"Revit Import\"` | Imported from Revit |\n * | `\"Mass\"` | Generic mass type |\n * | `\"Site\"` | Site object |\n */\nexport const PluginMassType = z.enum([\n \"Plinth\",\n \"Void\",\n \"Pergola\",\n \"Furniture\",\n \"Facade element\",\n \"Generic mass\",\n \"Room\",\n \"Department\",\n \"Building\",\n \"Revit Import\",\n \"Mass\",\n \"Site\",\n])\n\n/**\n * Well-known (built-in) department IDs.\n *\n * | Value | Department |\n * |---|---|\n * | `\"DEFAULT\"` | Default department |\n * | `\"SITE\"` | Site department |\n * | `\"ENVELOPE\"` | Envelope department |\n * | `\"CORE\"` | Core department |\n */\nexport const PluginWellKnownDepartmentId = z.enum([\n \"DEFAULT\",\n \"SITE\",\n \"ENVELOPE\",\n \"CORE\",\n])\n\n/**\n * Accepted department ID values — either a {@linkcode PluginWellKnownDepartmentId}\n * or a UUID string for custom (user-created) departments.\n */\nexport const PluginDepartmentId = z.union([\n PluginWellKnownDepartmentId,\n z.uuid(),\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to update |\n * | `properties` | `object` | Key/value pairs of properties to update (all optional) |\n * | `properties.room_type` | `string?` | New room type label |\n * | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |\n * | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |\n */\nexport const PluginSpaceUpdateArgs = z.object({\n spaceId: z.string(),\n properties: z.object({\n room_type: z.string().optional(),\n massType: PluginMassType.optional(),\n spaceType: PluginSpaceType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n})\n\nexport type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.update}.\n *\n * Echoes back the `spaceId` and the values of properties that were updated.\n * Properties that were not included in the update request will be `undefined`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID that was updated |\n * | `room_type` | `string?` | Updated room type (if changed) |\n * | `massType` | `string?` | Updated mass type (if changed) |\n * | `spaceType` | `string?` | Updated space type (if changed) |\n * | `departmentId` | `string \\| null?` | Updated department ID (if changed) |\n */\nexport const PluginSpaceUpdateResult = z.object({\n spaceId: z.string(),\n room_type: z.string().optional(),\n massType: z.string().optional(),\n spaceType: z.string().optional(),\n departmentId: z.string().nullable().optional(),\n})\n\nexport type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Story (floor/storey) management.\n *\n * A story represents a building floor in the Snaptrude project. Stories\n * are identified by their integer **story value** (e.g. `1` for ground\n * floor, `2` for first floor, `-1` for a basement).\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.story`.\n */\nexport abstract class PluginStoryApi {\n constructor() {}\n\n /**\n * Get properties of a story by its storey number.\n *\n * Only the properties listed in {@linkcode PluginStoryGetArgs.properties args.properties}\n * are returned — unlisted properties will be `undefined` in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryGetArgs.storyValue args.storyValue} — Integer storey number\n * (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)\n * - {@linkcode PluginStoryGetArgs.properties args.properties} — Array of property names\n * to retrieve. See {@linkcode PluginStoryGetProperty} for available values.\n * @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties\n * @throws If the story with the given value does not exist\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.story.get({\n * storyValue: 1,\n * properties: [\"height\", \"name\", \"spacesCount\"],\n * })\n * console.log(info.name, info.height, info.spacesCount)\n * ```\n */\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n /**\n * Get all stories in the current project.\n *\n * Returns basic identification data for every storey. Stories are sorted\n * from **top to bottom** (highest story value first).\n *\n * @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,\n * each entry containing `value`, `id`, and `name`\n *\n * # Example\n * ```ts\n * const { stories } = await snaptrude.entity.story.getAll()\n * for (const s of stories) {\n * console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n /**\n * Create a new story (floor) in the project.\n *\n * The new story is inserted at the position specified by\n * {@linkcode PluginStoryCreateArgs.storyValue args.storyValue}. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryCreateArgs.storyValue args.storyValue} — Integer storey number\n * to create (e.g. `3` to add a third floor)\n * - {@linkcode PluginStoryCreateArgs.height args.height} — Optional height in Babylon\n * units. If omitted, the project's default storey height is used.\n * @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`\n * @throws If a story with the given value already exists or creation fails\n *\n * # Example\n * ```ts\n * // Create a new third floor with custom height\n * const { storyId } = await snaptrude.entity.story.create({\n * storyValue: 3,\n * height: 4.5,\n * })\n * ```\n */\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n /**\n * Update a story's height.\n *\n * Changes the floor-to-floor height of the specified story. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryUpdateArgs.storyValue args.storyValue} — Integer storey number\n * identifying the story to update\n * - {@linkcode PluginStoryUpdateArgs.height args.height} — New height value in Babylon\n * units\n * @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`\n * @throws If the story does not exist or the update fails\n *\n * # Example\n * ```ts\n * // Set ground floor height to 5 Babylon units\n * const result = await snaptrude.entity.story.update({\n * storyValue: 1,\n * height: 5,\n * })\n * ```\n */\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\n/**\n * Available properties that can be queried on a story.\n *\n * | Value | Type | Description |\n * |---|---|---|\n * | `\"value\"` | `number` | The integer storey number |\n * | `\"id\"` | `string` | Unique story identifier |\n * | `\"name\"` | `string` | Display name of the story |\n * | `\"height\"` | `number` | Floor-to-floor height in Babylon units |\n * | `\"base\"` | `number` | Base elevation in Babylon units |\n * | `\"hidden\"` | `boolean` | Whether the story is hidden in the viewport |\n * | `\"spacesCount\"` | `number` | Number of spaces on this story |\n * | `\"totalArea\"` | `number` | Total floor area of this story |\n */\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\n/**\n * Arguments for {@linkcode PluginStoryApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number to query |\n * | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginStoryGetArgs.properties} will be present.\n */\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\n/**\n * Result of {@linkcode PluginStoryApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |\n */\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number for the new story |\n * | `height` | `number?` | Optional height in Babylon units |\n */\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyId` | `string` | Unique ID of the created story |\n * | `storyValue` | `number` | The storey number of the created story |\n */\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | Storey number of the story to update |\n * | `height` | `number` | New height in Babylon units |\n */\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` | The storey number of the updated story |\n * | `height` | `number` | The new height after the update |\n */\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginDepartmentApi } from \"./department\"\nimport { PluginReferenceLineApi } from \"./referenceLine\"\nimport { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\n/**\n * CRUD operations on Snaptrude building entities.\n *\n * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)\n * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)\n * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines\n * - {@linkcode PluginEntityApi.department} — Create and query departments\n */\nexport abstract class PluginEntityApi {\n /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */\n public abstract space: PluginSpaceApi\n /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */\n public abstract story: PluginStoryApi\n /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */\n public abstract referenceLine: PluginReferenceLineApi\n /** Department operations. See {@linkcode PluginDepartmentApi}. */\n public abstract department: PluginDepartmentApi\n\n constructor() {}\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Query the current user selection in the Snaptrude editor.\n *\n * Accessed via `snaptrude.tools.selection`.\n */\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n /**\n * Get the IDs of all currently selected components.\n *\n * Returns the component IDs from the editor's active selection stack.\n * If nothing is selected, returns an empty array.\n *\n * The returned IDs can be used with {@linkcode PluginTransformApi.move},\n * {@linkcode PluginTransformApi.rotate}, or entity query methods like\n * {@linkcode PluginSpaceApi.get}.\n *\n * @returns A {@linkcode PluginSelectionGetResult} with a `selected` array\n * of component ID strings\n *\n * # Example\n * ```ts\n * const { selected } = await snaptrude.tools.selection.get()\n * if (selected.length > 0) {\n * // Move selected components 5 units along X\n * await snaptrude.tools.transform.move({\n * componentIds: selected,\n * displacement: snaptrude.core.math.vec3.new(5, 0, 0),\n * })\n * }\n * ```\n */\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\n/**\n * Result of {@linkcode PluginSelectionApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `selected` | `string[]` | Component IDs of the current selection |\n */\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Transform operations — move and rotate scene components.\n *\n * All transform methods accept an array of component IDs and apply the\n * transformation to each. Operations are recorded in Snaptrude's\n * command system for undo/redo support.\n *\n * Accessed via `snaptrude.tools.transform`.\n */\nexport abstract class PluginTransformApi {\n constructor() {}\n\n /**\n * Translate components by a displacement vector.\n *\n * Each component's position is offset by the given\n * {@linkcode PluginMoveArgs.displacement displacement} vector.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginMoveArgs.componentIds args.componentIds} — Array of component\n * ID strings to move\n * - {@linkcode PluginMoveArgs.displacement args.displacement} — Translation vector\n * as a {@linkcode PVec3} in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Move a space 10 units along the X axis\n * await snaptrude.tools.transform.move({\n * componentIds: [\"some-space-id\"],\n * displacement: vec3.new(10, 0, 0),\n * })\n * ```\n */\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n /**\n * Rotate components around an axis through a pivot point.\n *\n * Each component is rotated by {@linkcode PluginRotateArgs.angle angle}\n * radians around the {@linkcode PluginRotateArgs.axis axis} vector,\n * pivoting about the {@linkcode PluginRotateArgs.pivot pivot} point.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginRotateArgs.componentIds args.componentIds} — Array of component\n * ID strings to rotate\n * - {@linkcode PluginRotateArgs.angle args.angle} — Rotation angle in **radians**\n * - {@linkcode PluginRotateArgs.axis args.axis} — Rotation axis as a {@linkcode PVec3}\n * - {@linkcode PluginRotateArgs.pivot args.pivot} — Pivot point as a {@linkcode PVec3}\n * in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Rotate a space 45° around the Y axis at the origin\n * await snaptrude.tools.transform.rotate({\n * componentIds: [\"some-space-id\"],\n * angle: Math.PI / 4,\n * axis: vec3.new(0, 1, 0),\n * pivot: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\n/**\n * Arguments for {@linkcode PluginTransformApi.move}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to move |\n * | `displacement` | {@linkcode PVec3} | Translation vector in Babylon units |\n */\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\n/**\n * Arguments for {@linkcode PluginTransformApi.rotate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to rotate |\n * | `angle` | `number` | Rotation angle in radians |\n * | `axis` | {@linkcode PVec3} | Rotation axis direction |\n * | `pivot` | {@linkcode PVec3} | Pivot point in Babylon units |\n */\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\n/**\n * Snaptrude editor tools for querying and manipulating scene components.\n *\n * - {@linkcode PluginToolsApi.selection} — Query the current user selection\n * - {@linkcode PluginToolsApi.transform} — Move and rotate components\n */\nexport abstract class PluginToolsApi {\n /** Query the current selection. See {@linkcode PluginSelectionApi}. */\n public abstract selection: PluginSelectionApi\n /** Move and rotate components. See {@linkcode PluginTransformApi}. */\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Unit conversion between real-world units and Snaptrude's internal\n * (Babylon) coordinate system.\n *\n * Snaptrude uses an internal unit system (Babylon units) for all\n * coordinates and dimensions. Use these methods to convert between\n * real-world measurements and Babylon units.\n *\n * Accessed via `snaptrude.units`.\n */\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from a real-world unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertFromArgs.unit args.unit} — The source unit\n * to convert from. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric\n * value in the source unit\n * - {@linkcode PluginUnitsConvertFromArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted\n * `value` in Babylon units\n *\n * # Example\n * ```ts\n * // Convert 5 meters to Babylon units for use in API calls\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: snaptrude.core.math.vec3.new(0, 0, 0),\n * dimensions: { width: result.value, height: result.value, depth: result.value },\n * })\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to a real-world unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertToArgs.unit args.unit} — The target unit\n * to convert to. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric\n * value in Babylon units\n * - {@linkcode PluginUnitsConvertToArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertToResult} containing the converted\n * `value` in the target unit\n *\n * # Example\n * ```ts\n * // Get a space's area in square meters\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-id\",\n * properties: [\"area\"],\n * })\n * const areaInMeters = await snaptrude.units.convertTo({\n * unit: \"meters\",\n * value: info.area!,\n * degree: 2,\n * })\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Source real-world unit |\n * | `value` | `number` | Numeric value in the source unit |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in Babylon units |\n */\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Target real-world unit |\n * | `value` | `number` | Numeric value in Babylon units |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in the target unit |\n */\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\n/**\n * Root API surface for Snaptrude plugins.\n *\n * Access all plugin capabilities through the namespaced properties:\n *\n * - {@linkcode PluginApi.core} — Math and geometry primitives\n * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)\n * - {@linkcode PluginApi.tools} — Selection and transform tools\n * - {@linkcode PluginApi.units} — Unit conversion utilities\n */\nexport abstract class PluginApi {\n /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */\n public abstract core: PluginCoreApi\n /** Selection and transform tools. See {@linkcode PluginToolsApi}. */\n public abstract tools: PluginToolsApi\n /** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */\n public abstract entity: PluginEntityApi\n /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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MAA8B;AAAA,EAMnC,cAAc;AAAA,EAAC;AACjB;;;AChBA,IAAAC,MAAmB;AAaZ,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;AAiEjB;AAaO,IAAM,YAAc,SAAK;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAaM,IAAM,6BAA+B,WAAO;AAAA,EACjD,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,+BAAiC,WAAO;AAAA,EACnD,OAAS,WAAO;AAClB,CAAC;AAaM,IAAM,2BAA6B,WAAO;AAAA,EAC/C,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,6BAA+B,WAAO;AAAA,EACjD,OAAS,WAAO;AAClB,CAAC;;;ACjJM,IAAe,YAAf,MAAyB;AAAA,EAU9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["export * from \"./api\"\nexport * from \"./types\"\nexport * from \"./host-utils\"\n","import * as z from \"zod\"\n\n/**\n * 3D vector operations for positions, directions, and displacements.\n *\n * All methods are **pure** — they return new {@linkcode PVec3} values\n * without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.vec3`.\n */\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /**\n * Create a new 3D vector.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @returns A new {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const position = snaptrude.core.math.vec3.new(1, 2, 3)\n * // { x: 1, y: 2, z: 3 }\n * ```\n */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /**\n * Add two vectors component-wise.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`\n */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /**\n * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.\n *\n * @param a - Vector to subtract from\n * @param b - Vector to subtract\n * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`\n */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /**\n * Scale a vector by a scalar value.\n *\n * @param v - The vector to scale\n * @param scalar - The scalar multiplier\n * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`\n */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /**\n * Compute the dot product of two vectors.\n *\n * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle\n * between the vectors. Useful for checking orthogonality (result = 0)\n * or projection.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns The scalar dot product\n */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /**\n * Compute the cross product of two vectors.\n *\n * The result is a vector perpendicular to both inputs, with magnitude\n * equal to the area of the parallelogram they span. Useful for computing\n * surface normals.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}\n */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /**\n * Compute the length (magnitude) of a vector.\n *\n * @param v - The vector\n * @returns The Euclidean length `√(x² + y² + z²)`\n */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /**\n * Compute the squared length of a vector.\n *\n * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}\n * when comparing relative magnitudes.\n *\n * @param v - The vector\n * @returns The squared length `x² + y² + z²`\n */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /**\n * Normalize a vector to unit length.\n *\n * @param v - The vector to normalize\n * @returns A new unit-length {@linkcode PVec3} in the same direction,\n * or a zero vector `(0, 0, 0)` if the input has zero length\n */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /**\n * Compute the Euclidean distance between two points.\n *\n * @param a - First point\n * @param b - Second point\n * @returns The distance `|a - b|`\n */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /**\n * Linearly interpolate between two vectors.\n *\n * @param a - Start vector (returned when `t = 0`)\n * @param b - End vector (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new {@linkcode PVec3} at `a + (b - a) * t`\n */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /**\n * Negate a vector (reverse its direction).\n *\n * @param v - The vector to negate\n * @returns A new {@linkcode PVec3} with all components negated\n */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /**\n * Check if two vectors are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns `true` if all components match exactly\n */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /**\n * Check if two vectors are approximately equal within a tolerance.\n *\n * @param a - First vector\n * @param b - Second vector\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\n/**\n * A 3D vector with `x`, `y`, and `z` components.\n *\n * Used throughout the plugin API for positions, directions, displacements,\n * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.\n */\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\n/**\n * Quaternion operations for 3D rotations.\n *\n * Quaternions avoid gimbal lock and provide smooth interpolation\n * compared to Euler angles. All methods are **pure** — they return\n * new {@linkcode PQuat} values without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.quat`.\n */\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /**\n * Create a new quaternion from raw components.\n *\n * For most use cases prefer {@linkcode PluginQuatApi.fromAxisAngle}\n * or {@linkcode PluginQuatApi.fromEuler} instead.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @param w - The W (scalar) component\n * @returns A new {@linkcode PQuat}\n */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /**\n * Create an identity quaternion representing no rotation.\n *\n * @returns `{ x: 0, y: 0, z: 0, w: 1 }`\n */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /**\n * Create a quaternion from an axis and an angle.\n *\n * @param axis - The rotation axis as a {@linkcode PVec3} (will be normalized internally)\n * @param angle - The rotation angle in **radians**\n * @returns A new unit {@linkcode PQuat}, or identity if {@linkcode axis} has zero length\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * // 90° rotation around the Y axis\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * ```\n */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /**\n * Create a quaternion from Euler angles in **XYZ** rotation order.\n *\n * @param x - Rotation around X axis in **radians**\n * @param y - Rotation around Y axis in **radians**\n * @param z - Rotation around Z axis in **radians**\n * @returns A new {@linkcode PQuat}\n */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /**\n * Multiply two quaternions, combining their rotations.\n *\n * Quaternion multiplication is **not commutative**: `a * b ≠ b * a`.\n * The result applies rotation {@linkcode b} first, then {@linkcode a}.\n *\n * @param a - First quaternion (applied second)\n * @param b - Second quaternion (applied first)\n * @returns A new {@linkcode PQuat} representing the combined rotation\n */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /**\n * Compute the conjugate of a quaternion.\n *\n * For unit quaternions the conjugate equals the inverse.\n *\n * @param q - The quaternion\n * @returns A new {@linkcode PQuat} with negated vector part `(-x, -y, -z, w)`\n */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /**\n * Compute the length (magnitude) of a quaternion.\n *\n * @param q - The quaternion\n * @returns The magnitude `√(x² + y² + z² + w²)`\n */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /**\n * Normalize a quaternion to unit length.\n *\n * @param q - The quaternion to normalize\n * @returns A new unit-length {@linkcode PQuat}, or identity if the input has zero length\n */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /**\n * Compute the inverse of a quaternion.\n *\n * The inverse satisfies `q * inverse(q) = identity`.\n *\n * @param q - The quaternion to invert\n * @returns A new {@linkcode PQuat} that is the multiplicative inverse,\n * or identity if the input has zero length\n */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /**\n * Rotate a 3D vector by a quaternion.\n *\n * Computes `q * v * conjugate(q)` using the Hamilton product.\n *\n * @param q - The rotation quaternion (should be unit-length)\n * @param v - The vector to rotate as a {@linkcode PVec3}\n * @returns A new rotated {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * const rotated = quat.rotateVec3(rot, vec3.new(1, 0, 0))\n * // ≈ { x: 0, y: 0, z: -1 }\n * ```\n */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /**\n * Convert a quaternion to axis-angle representation.\n *\n * @param q - The quaternion to convert\n * @returns An object with:\n * - `axis` — The rotation axis as a unit {@linkcode PVec3}\n * (defaults to `(1, 0, 0)` when angle is zero)\n * - `angle` — The rotation angle in **radians**\n */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /**\n * Spherical linear interpolation between two quaternions.\n *\n * Produces smooth constant-speed rotation between {@linkcode a} and {@linkcode b}.\n *\n * @param a - Start quaternion (returned when `t = 0`)\n * @param b - End quaternion (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new interpolated {@linkcode PQuat}\n */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /**\n * Compute the dot product of two quaternions.\n *\n * A value close to `1` or `-1` indicates similar orientations;\n * a value close to `0` indicates maximally different orientations.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns The scalar dot product\n */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /**\n * Check if two quaternions are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginQuatApi.equalsApprox}.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns `true` if all components match exactly\n */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /**\n * Check if two quaternions are approximately equal within a tolerance.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\n/**\n * A quaternion with `x`, `y`, `z`, and `w` components.\n *\n * Used for representing 3D rotations without gimbal lock.\n * Equivalent to `BABYLON.Quaternion`.\n */\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\n/**\n * Math primitives for 3D vector and quaternion operations.\n *\n * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic\n * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations\n */\nexport abstract class PluginMathApi {\n /** 3D vector operations. See {@linkcode PluginVec3Api}. */\n public abstract vec3: PluginVec3Api\n /** Quaternion operations. See {@linkcode PluginQuatApi}. */\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Line segment construction.\n *\n * A {@linkcode PLine} is the simplest curve primitive — a straight\n * segment between two 3D points. Lines can be wrapped as a\n * {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.line`.\n */\nexport abstract class PluginLineApi {\n constructor() {}\n\n /**\n * Create a new line segment between two points.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @returns A new {@linkcode PLine}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { line } = snaptrude.core.geom\n *\n * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\n/**\n * A line segment defined by a start and end point.\n *\n * Discriminated by `curveType: \"Line\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Line\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the segment |\n * | `endPoint` | {@linkcode PVec3} | End point of the segment |\n */\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Arc construction.\n *\n * A {@linkcode PArc} represents a circular arc in 3D space, defined by\n * start/end points, a centre, and a rotation axis. Arcs can be wrapped\n * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.arc`.\n */\nexport abstract class PluginArcApi {\n constructor() {}\n\n /**\n * Create a new arc from start, end, centre, and axis.\n *\n * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}\n * along the circle centred at {@linkcode centrePoint}, in the\n * direction determined by the right-hand rule around {@linkcode axis}.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}\n * @param axis - The arc's rotation axis as a {@linkcode PVec3}\n * (perpendicular to the arc's plane)\n * @returns A new {@linkcode PArc}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { arc } = snaptrude.core.geom\n *\n * // Quarter-circle arc on the XZ plane\n * const a = arc.new(\n * vec3.new(1, 0, 0), // start\n * vec3.new(0, 0, 1), // end\n * vec3.new(0, 0, 0), // centre\n * vec3.new(0, 1, 0), // Y-up axis\n * )\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\n/**\n * A circular arc defined by start, end, centre, and axis.\n *\n * Discriminated by `curveType: \"Arc\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Arc\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the arc |\n * | `endPoint` | {@linkcode PVec3} | End point of the arc |\n * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |\n * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |\n */\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\n/**\n * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.\n *\n * Use this to build heterogeneous curve lists (mixing lines and arcs)\n * when constructing a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.curve`.\n */\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /**\n * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.\n *\n * This is an identity operation — it simply returns the input unchanged.\n * It exists for type-level clarity when building mixed curve lists.\n *\n * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap\n * @returns The same value typed as {@linkcode PCurve}\n */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\n/**\n * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.\n *\n * Discriminated on the `curveType` field:\n * - `\"Line\"` → {@linkcode PLine}\n * - `\"Arc\"` → {@linkcode PArc}\n *\n * Use `curve.curveType` to narrow the type in a switch or if-statement.\n */\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\n/**\n * Profile construction — a closed loop of {@linkcode PCurve}s.\n *\n * Profiles are the primary 2D shape primitive used for creating\n * extruded entities like spaces. Build profiles either from an\n * explicit list of curves or from a list of points (auto-connected\n * with line segments).\n *\n * Accessed via `snaptrude.core.geom.profile`.\n */\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /**\n * Create a profile from an ordered list of curves.\n *\n * The curves should form a closed loop — the end point of each curve\n * should coincide with the start point of the next.\n *\n * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop\n * @returns A new {@linkcode PProfile}\n */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /**\n * Create a profile by connecting a list of points with line segments.\n *\n * The points are connected in order, with the last point automatically\n * connected back to the first to close the loop.\n *\n * This is a **host API call** — it returns a `Promise`.\n *\n * @param args - An object containing:\n * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered\n * array of {@linkcode PVec3} forming the profile vertices\n * @returns A {@linkcode PProfile} with line-segment curves connecting the points\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Create an L-shaped profile\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 5),\n * vec3.new(5, 0, 5),\n * vec3.new(5, 0, 10),\n * vec3.new(0, 0, 10),\n * ],\n * })\n * ```\n */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\n/**\n * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |\n */\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\n/**\n * A closed profile composed of an ordered list of curves.\n *\n * Profiles are used as input to entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |\n */\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\n/**\n * Geometry primitives for constructing 2D/3D shapes.\n *\n * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.\n * Profiles can then be used with entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * - {@linkcode PluginGeomApi.line} — Line segment construction\n * - {@linkcode PluginGeomApi.arc} — Arc construction\n * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)\n * - {@linkcode PluginGeomApi.profile} — Closed loop of curves\n */\nexport abstract class PluginGeomApi {\n /** Line segment construction. See {@linkcode PluginLineApi}. */\n public abstract line: PluginLineApi\n /** Arc construction. See {@linkcode PluginArcApi}. */\n public abstract arc: PluginArcApi\n /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */\n public abstract curve: PluginCurveApi\n /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\n/**\n * Core primitives used across the plugin API.\n *\n * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations\n * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)\n */\nexport abstract class PluginCoreApi {\n /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */\n public abstract math: PluginMathApi\n /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Department management — create and query departments.\n *\n * A **department** is a named, colored grouping applied to spaces.\n * Departments are used to categorize spaces by function (e.g. \"FOH\",\n * \"Emergency\", \"Residential\") and control their visual appearance.\n *\n * Accessed via `snaptrude.entity.department`.\n */\nexport abstract class PluginDepartmentApi {\n constructor() {}\n\n /**\n * Create a new department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginDepartmentCreateArgs.name args.name} — Display name\n * - {@linkcode PluginDepartmentCreateArgs.color args.color} — CSS hex color string (e.g. `\"#b5e1dc\"`)\n * @returns A {@linkcode PluginDepartmentCreateResult} with the `departmentId`\n * of the created department\n * @throws If department creation fails\n *\n * # Example\n * ```ts\n * const { departmentId } = await snaptrude.entity.department.create({\n * name: \"Emergency\",\n * color: \"#f5e68b\",\n * })\n * ```\n */\n public abstract create(\n args: PluginDepartmentCreateArgs\n ): PluginApiReturn<PluginDepartmentCreateResult>\n\n /**\n * Get all departments in the current project.\n *\n * Returns every department including well-known ones (Default, Site, etc.)\n * and user-created departments.\n *\n * @returns A {@linkcode PluginDepartmentGetAllResult} with a `departments` array\n *\n * # Example\n * ```ts\n * const { departments } = await snaptrude.entity.department.getAll()\n * for (const dept of departments) {\n * console.log(dept.id, dept.name, dept.color)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginDepartmentGetAllResult>\n}\n\n/**\n * Arguments for {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `name` | `string` | Display name of the department |\n * | `color` | `string` | CSS hex color string (e.g. `\"#b5e1dc\"`) |\n */\nexport const PluginDepartmentCreateArgs = z.object({\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentCreateArgs = z.infer<\n typeof PluginDepartmentCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departmentId` | `string` | Unique ID of the created department |\n */\nexport const PluginDepartmentCreateResult = z.object({\n departmentId: z.string(),\n})\n\nexport type PluginDepartmentCreateResult = z.infer<\n typeof PluginDepartmentCreateResult\n>\n\n/**\n * A single department entry returned by {@linkcode PluginDepartmentApi.getAll}.\n */\nexport const PluginDepartmentEntry = z.object({\n id: z.string(),\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentEntry = z.infer<typeof PluginDepartmentEntry>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departments` | {@linkcode PluginDepartmentEntry}`[]` | All departments in the project |\n */\nexport const PluginDepartmentGetAllResult = z.object({\n departments: z.array(PluginDepartmentEntry),\n})\n\nexport type PluginDepartmentGetAllResult = z.infer<\n typeof PluginDepartmentGetAllResult\n>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PProfile } from \"../core/geom/profile\"\nimport { PCurve } from \"../core/geom/curve\"\n\n/**\n * Reference line management — create, query, and delete reference lines.\n *\n * A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,\n * typically used for grid lines and alignment guides. Reference lines\n * carry properties such as grid tags, labels, and line styles.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.referenceLine`.\n */\nexport abstract class PluginReferenceLineApi {\n constructor() {}\n\n /**\n * Create multiple reference lines from a profile.\n *\n * Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes\n * a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`\n * internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A\n * {@linkcode PProfile} whose curves define the reference lines to create\n * @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the\n * `referenceLineIds` of the created reference lines\n * @throws If reference line creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))\n * const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))\n * const profile = snaptrude.core.geom.profile.new([l1, l2])\n *\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({\n * profile,\n * })\n * ```\n */\n public abstract createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): PluginApiReturn<PluginReferenceLineCreateMultiResult>\n\n /**\n * Get properties of a reference line by its ID.\n *\n * Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID\n * - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of\n * property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.\n * @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the\n * requested properties\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.referenceLine.get({\n * referenceLineId: \"some-ref-line-id\",\n * properties: [\"curve\"],\n * })\n * console.log(result.curve) // PCurve\n * ```\n */\n public abstract get(\n args: PluginReferenceLineGetArgs\n ): PluginApiReturn<PluginReferenceLineGetResult>\n\n /**\n * Get the IDs of all reference lines in the current project.\n *\n * Returns every reference line across all stories.\n * Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query\n * individual reference line properties.\n *\n * @returns A {@linkcode PluginReferenceLineGetAllResult} with a\n * `referenceLineIds` array\n *\n * # Example\n * ```ts\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()\n * console.log(`Project has ${referenceLineIds.length} reference lines`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>\n\n /**\n * Delete a reference line by its ID.\n *\n * Permanently removes the reference line and its associated mesh from\n * the scene. This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID to delete\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * await snaptrude.entity.referenceLine.delete({\n * referenceLineId: \"some-ref-line-id\",\n * })\n * ```\n */\n public abstract delete(\n args: PluginReferenceLineDeleteArgs\n ): PluginApiReturn<PluginReferenceLineDeleteResult>\n}\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |\n */\nexport const PluginReferenceLineCreateMultiArgs = z.object({\n profile: PProfile,\n})\n\nexport type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of the created reference lines |\n */\nexport const PluginReferenceLineCreateMultiResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>\n\n/**\n * Available properties that can be queried on a reference line.\n *\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"curve\"` | {@linkcode PCurve} | The curve geometry of the reference line |\n */\nexport const PluginReferenceLineGetProperty = z.enum([\n \"curve\",\n])\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to query |\n * | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginReferenceLineGetArgs = z.object({\n referenceLineId: z.string(),\n properties: z.array(PluginReferenceLineGetProperty),\n})\n\nexport type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginReferenceLineGetArgs.properties} will be present.\n */\nexport const PluginReferenceLineGetResult = z\n .object({\n curve: PCurve,\n })\n .partial()\n\nexport type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |\n */\nexport const PluginReferenceLineGetAllResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to delete |\n */\nexport const PluginReferenceLineDeleteArgs = z.object({\n referenceLineId: z.string(),\n})\n\nexport type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>\n\n/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */\nexport type PluginReferenceLineDeleteResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\n/**\n * Space (room/mass) management — create, query, and delete spaces.\n *\n * A **space** is a 3D volume representing a room or mass in the\n * Snaptrude scene. Spaces live on a particular story and carry\n * properties such as name, area, department, and room type.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.space`.\n */\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n /**\n * Create a rectangular (box) space.\n *\n * Generates an axis-aligned box with the given dimensions at the\n * specified position. The created space is automatically assigned\n * to the active story and a default department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin\n * position as a {@linkcode PVec3} in Babylon units\n * - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box\n * dimensions `{ width, height, depth }` in Babylon units\n * @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`\n * of the created space\n * @throws If space creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * })\n * ```\n */\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n /**\n * Create a space by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is extruded\n * upward (along the Y axis) by {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight\n * extrudeHeight}, then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. The created space is automatically assigned to the active story\n * and a default department.\n *\n * Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile\n * from a list of points.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed\n * {@linkcode PProfile} defining the floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —\n * Extrusion height in Babylon units\n * - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset\n * position as a {@linkcode PVec3} in Babylon units\n * @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`\n * of the created space\n * @throws If the profile is invalid or mesh creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 8),\n * vec3.new(0, 0, 8),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile,\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Get the IDs of all spaces in the current project.\n *\n * Returns every space (mass that is not a building) across all stories.\n * Use the returned IDs with {@linkcode PluginSpaceApi.get} to query\n * individual space properties.\n *\n * @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array\n *\n * # Example\n * ```ts\n * const { spacesIds } = await snaptrude.entity.space.getAll()\n * console.log(`Project has ${spacesIds.length} spaces`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n /**\n * Get properties of a space by its ID.\n *\n * Only the properties listed in {@linkcode PluginSpaceGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID\n * (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})\n * - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property\n * names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.\n * @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested\n * properties\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-space-id\",\n * properties: [\"name\", \"area\", \"position\"],\n * })\n * console.log(info.name, info.area, info.position)\n * ```\n */\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n /**\n * Delete a space by its ID.\n *\n * Permanently removes the space and its associated mesh from the scene.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID\n * to delete\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.delete({ spaceId: \"some-space-id\" })\n * ```\n */\n public abstract delete({\n spaceId,\n }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>\n\n /**\n * Update properties of a space by its ID.\n *\n * Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties\n * args.properties} will be updated — omitted properties remain unchanged.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID\n * to update\n * - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs\n * of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.\n * @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and\n * the updated property values\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.space.update({\n * spaceId: \"some-space-id\",\n * properties: {\n * room_type: \"Kitchen\",\n * massType: \"Room\",\n * departmentId: \"CORE\",\n * },\n * })\n * ```\n */\n public abstract update(\n args: PluginSpaceUpdateArgs\n ): PluginApiReturn<PluginSpaceUpdateResult>\n}\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `position` | {@linkcode PVec3} | Origin position in Babylon units |\n * | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |\n */\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<\n typeof PluginSpaceCreateRectangularArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<\n typeof PluginSpaceCreateRectangularResult\n>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |\n * | `extrudeHeight` | `number` | Extrusion height in Babylon units |\n * | `position` | {@linkcode PVec3} | Offset position in Babylon units |\n */\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<\n typeof PluginSpaceCreateFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<\n typeof PluginSpaceCreateFromProfileResult\n>\n\n/**\n * Available properties that can be queried on a space.\n *\n * **Basic:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"id\"` | `string` | Unique space identifier |\n * | `\"type\"` | `string` | Component type |\n * | `\"room_type\"` | `string` | Room type classification |\n * | `\"name\"` | `string` | Display name of the space |\n *\n * **Derived from parametric data:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"area\"` | `number` | Bottom face area (from `areas_bottomFace`) |\n * | `\"breadth\"` | `number` | Breadth dimension |\n * | `\"depth\"` | `number` | Depth dimension |\n * | `\"height\"` | `number` | Height dimension |\n * | `\"massType\"` | `string \\| null` | Mass type classification |\n * | `\"spaceType\"` | `string \\| null` | Space type classification (Room, Balcony, etc.) |\n * | `\"storey\"` | `number \\| null` | Story the space belongs to |\n * | `\"departmentId\"` | `string \\| null` | Assigned department ID |\n * | `\"departmentName\"` | `string` | Assigned department name |\n * | `\"departmentColor\"` | `string` | Assigned department color (hex/CSS) |\n *\n * **Derived from mesh:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"position\"` | {@linkcode PVec3} | Local position relative to parent |\n * | `\"absolutePosition\"` | {@linkcode PVec3} | Absolute position in the scene |\n * | `\"rotation\"` | {@linkcode PVec3} | Euler rotation angles (radians) |\n * | `\"rotationQuaternion\"` | {@linkcode PQuat} \\| `null` | Quaternion rotation, or `null` if unset |\n *\n * **Derived from brep:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"planPoints\"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |\n */\nexport const PluginSpaceGetProperty = z.enum([\n // Basic\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n // Derived from parametric data\n \"area\",\n \"breadth\",\n \"depth\",\n \"height\",\n \"massType\",\n \"spaceType\",\n \"storey\",\n \"departmentId\",\n \"departmentName\",\n \"departmentColor\",\n // Derived from mesh\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n // Derived from brep\n \"planPoints\",\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to query |\n * | `properties` | {@linkcode PluginSpaceGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\n/**\n * Supported space type values.\n *\n * Mirrors the internal `SpaceType` enum from `spaceType.types.ts`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Room\"` | Standard room |\n * | `\"Program Block\"` | Program/department block |\n * | `\"Balcony\"` | Balcony space |\n * | `\"Road\"` | Road |\n * | `\"Garden\"` | Garden area |\n * | `\"Deck\"` | Deck |\n * | `\"Pool\"` | Pool |\n * | `\"Walkway\"` | Walkway |\n * | `\"Parking\"` | Parking area |\n */\nexport const PluginSpaceType = z.enum([\n \"Room\",\n \"Program Block\",\n \"Balcony\",\n \"Road\",\n \"Garden\",\n \"Deck\",\n \"Pool\",\n \"Walkway\",\n \"Parking\"\n])\n\n/**\n * Result of {@linkcode PluginSpaceApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginSpaceGetArgs.properties} will be present.\n */\nexport const PluginSpaceGetResult = z\n .object({\n // Basic\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n // Derived from parametric data\n area: z.number(),\n breadth: z.number(),\n depth: z.number(),\n height: z.number(),\n massType: z.string().nullable(),\n spaceType: PluginSpaceType.nullable(),\n storey: z.number().nullable(),\n departmentId: z.string().nullable(),\n departmentName: z.string(),\n departmentColor: z.string(),\n // Derived from mesh\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n // Derived from brep\n planPoints: z.array(PVec3),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\n/**\n * Result of {@linkcode PluginSpaceApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spacesIds` | `string[]` | IDs of all spaces in the project |\n */\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to delete |\n */\nexport const PluginSpaceDeleteArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>\n\n/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */\nexport type PluginSpaceDeleteResult = void\n\n/**\n * Supported mass type values for {@linkcode PluginSpaceUpdateArgs.properties.massType}.\n *\n * Mirrors the internal `MASS_TYPES` enum.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Plinth\"` | Plinth mass |\n * | `\"Void\"` | Void/cut-out |\n * | `\"Pergola\"` | Pergola structure |\n * | `\"Furniture\"` | Furniture element |\n * | `\"Facade element\"` | Facade element |\n * | `\"Generic mass\"` | Generic mass |\n * | `\"Room\"` | Room (default for spaces) |\n * | `\"Department\"` | Department block |\n * | `\"Building\"` | Building envelope |\n * | `\"Revit Import\"` | Imported from Revit |\n * | `\"Mass\"` | Generic mass type |\n * | `\"Site\"` | Site object |\n */\nexport const PluginMassType = z.enum([\n \"Plinth\",\n \"Void\",\n \"Pergola\",\n \"Furniture\",\n \"Facade element\",\n \"Generic mass\",\n \"Room\",\n \"Department\",\n \"Building\",\n \"Revit Import\",\n \"Mass\",\n \"Site\",\n])\n\n/**\n * Well-known (built-in) department IDs.\n *\n * | Value | Department |\n * |---|---|\n * | `\"DEFAULT\"` | Default department |\n * | `\"SITE\"` | Site department |\n * | `\"ENVELOPE\"` | Envelope department |\n * | `\"CORE\"` | Core department |\n */\nexport const PluginWellKnownDepartmentId = z.enum([\n \"DEFAULT\",\n \"SITE\",\n \"ENVELOPE\",\n \"CORE\",\n])\n\n/**\n * Accepted department ID values — either a {@linkcode PluginWellKnownDepartmentId}\n * or a UUID string for custom (user-created) departments.\n */\nexport const PluginDepartmentId = z.union([\n PluginWellKnownDepartmentId,\n z.uuid(),\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to update |\n * | `properties` | `object` | Key/value pairs of properties to update (all optional) |\n * | `properties.room_type` | `string?` | New room type label |\n * | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |\n * | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |\n */\nexport const PluginSpaceUpdateArgs = z.object({\n spaceId: z.string(),\n properties: z.object({\n room_type: z.string().optional(),\n massType: PluginMassType.optional(),\n spaceType: PluginSpaceType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n})\n\nexport type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.update}.\n *\n * Echoes back the `spaceId` and the values of properties that were updated.\n * Properties that were not included in the update request will be `undefined`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID that was updated |\n * | `room_type` | `string?` | Updated room type (if changed) |\n * | `massType` | `string?` | Updated mass type (if changed) |\n * | `spaceType` | `string?` | Updated space type (if changed) |\n * | `departmentId` | `string \\| null?` | Updated department ID (if changed) |\n */\nexport const PluginSpaceUpdateResult = z.object({\n spaceId: z.string(),\n room_type: z.string().optional(),\n massType: z.string().optional(),\n spaceType: z.string().optional(),\n departmentId: z.string().nullable().optional(),\n})\n\nexport type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Story (floor/storey) management.\n *\n * A story represents a building floor in the Snaptrude project. Stories\n * are identified by their integer **story value** (e.g. `1` for ground\n * floor, `2` for first floor, `-1` for a basement).\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.story`.\n */\nexport abstract class PluginStoryApi {\n constructor() {}\n\n /**\n * Get properties of a story by its storey number.\n *\n * Only the properties listed in {@linkcode PluginStoryGetArgs.properties args.properties}\n * are returned — unlisted properties will be `undefined` in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryGetArgs.storyValue args.storyValue} — Integer storey number\n * (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)\n * - {@linkcode PluginStoryGetArgs.properties args.properties} — Array of property names\n * to retrieve. See {@linkcode PluginStoryGetProperty} for available values.\n * @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties\n * @throws If the story with the given value does not exist\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.story.get({\n * storyValue: 1,\n * properties: [\"height\", \"name\", \"spacesCount\"],\n * })\n * console.log(info.name, info.height, info.spacesCount)\n * ```\n */\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n /**\n * Get all stories in the current project.\n *\n * Returns basic identification data for every storey. Stories are sorted\n * from **top to bottom** (highest story value first).\n *\n * @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,\n * each entry containing `value`, `id`, and `name`\n *\n * # Example\n * ```ts\n * const { stories } = await snaptrude.entity.story.getAll()\n * for (const s of stories) {\n * console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n /**\n * Create a new story (floor) in the project.\n *\n * The new story is inserted at the position specified by\n * {@linkcode PluginStoryCreateArgs.storyValue args.storyValue}. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryCreateArgs.storyValue args.storyValue} — Integer storey number\n * to create (e.g. `3` to add a third floor)\n * - {@linkcode PluginStoryCreateArgs.height args.height} — Optional height in Babylon\n * units. If omitted, the project's default storey height is used.\n * @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`\n * @throws If a story with the given value already exists or creation fails\n *\n * # Example\n * ```ts\n * // Create a new third floor with custom height\n * const { storyId } = await snaptrude.entity.story.create({\n * storyValue: 3,\n * height: 4.5,\n * })\n * ```\n */\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n /**\n * Update a story's height.\n *\n * Changes the floor-to-floor height of the specified story. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryUpdateArgs.storyValue args.storyValue} — Integer storey number\n * identifying the story to update\n * - {@linkcode PluginStoryUpdateArgs.height args.height} — New height value in Babylon\n * units\n * @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`\n * @throws If the story does not exist or the update fails\n *\n * # Example\n * ```ts\n * // Set ground floor height to 5 Babylon units\n * const result = await snaptrude.entity.story.update({\n * storyValue: 1,\n * height: 5,\n * })\n * ```\n */\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\n/**\n * Available properties that can be queried on a story.\n *\n * | Value | Type | Description |\n * |---|---|---|\n * | `\"value\"` | `number` | The integer storey number |\n * | `\"id\"` | `string` | Unique story identifier |\n * | `\"name\"` | `string` | Display name of the story |\n * | `\"height\"` | `number` | Floor-to-floor height in Babylon units |\n * | `\"base\"` | `number` | Base elevation in Babylon units |\n * | `\"hidden\"` | `boolean` | Whether the story is hidden in the viewport |\n * | `\"spacesCount\"` | `number` | Number of spaces on this story |\n * | `\"totalArea\"` | `number` | Total floor area of this story |\n */\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\n/**\n * Arguments for {@linkcode PluginStoryApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number to query |\n * | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginStoryGetArgs.properties} will be present.\n */\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\n/**\n * Result of {@linkcode PluginStoryApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |\n */\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number for the new story |\n * | `height` | `number?` | Optional height in Babylon units |\n */\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyId` | `string` | Unique ID of the created story |\n * | `storyValue` | `number` | The storey number of the created story |\n */\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | Storey number of the story to update |\n * | `height` | `number` | New height in Babylon units |\n */\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` | The storey number of the updated story |\n * | `height` | `number` | The new height after the update |\n */\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginDepartmentApi } from \"./department\"\nimport { PluginReferenceLineApi } from \"./referenceLine\"\nimport { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\n/**\n * CRUD operations on Snaptrude building entities.\n *\n * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)\n * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)\n * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines\n * - {@linkcode PluginEntityApi.department} — Create and query departments\n */\nexport abstract class PluginEntityApi {\n /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */\n public abstract space: PluginSpaceApi\n /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */\n public abstract story: PluginStoryApi\n /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */\n public abstract referenceLine: PluginReferenceLineApi\n /** Department operations. See {@linkcode PluginDepartmentApi}. */\n public abstract department: PluginDepartmentApi\n\n constructor() {}\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Query the current user selection in the Snaptrude editor.\n *\n * Accessed via `snaptrude.tools.selection`.\n */\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n /**\n * Get the IDs of all currently selected components.\n *\n * Returns the component IDs from the editor's active selection stack.\n * If nothing is selected, returns an empty array.\n *\n * The returned IDs can be used with {@linkcode PluginTransformApi.move},\n * {@linkcode PluginTransformApi.rotate}, or entity query methods like\n * {@linkcode PluginSpaceApi.get}.\n *\n * @returns A {@linkcode PluginSelectionGetResult} with a `selected` array\n * of component ID strings\n *\n * # Example\n * ```ts\n * const { selected } = await snaptrude.tools.selection.get()\n * if (selected.length > 0) {\n * // Move selected components 5 units along X\n * await snaptrude.tools.transform.move({\n * componentIds: selected,\n * displacement: snaptrude.core.math.vec3.new(5, 0, 0),\n * })\n * }\n * ```\n */\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\n/**\n * Result of {@linkcode PluginSelectionApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `selected` | `string[]` | Component IDs of the current selection |\n */\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Transform operations — move and rotate scene components.\n *\n * All transform methods accept an array of component IDs and apply the\n * transformation to each. Operations are recorded in Snaptrude's\n * command system for undo/redo support.\n *\n * Accessed via `snaptrude.tools.transform`.\n */\nexport abstract class PluginTransformApi {\n constructor() {}\n\n /**\n * Translate components by a displacement vector.\n *\n * Each component's position is offset by the given\n * {@linkcode PluginMoveArgs.displacement displacement} vector.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginMoveArgs.componentIds args.componentIds} — Array of component\n * ID strings to move\n * - {@linkcode PluginMoveArgs.displacement args.displacement} — Translation vector\n * as a {@linkcode PVec3} in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Move a space 10 units along the X axis\n * await snaptrude.tools.transform.move({\n * componentIds: [\"some-space-id\"],\n * displacement: vec3.new(10, 0, 0),\n * })\n * ```\n */\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n /**\n * Rotate components around an axis through a pivot point.\n *\n * Each component is rotated by {@linkcode PluginRotateArgs.angle angle}\n * radians around the {@linkcode PluginRotateArgs.axis axis} vector,\n * pivoting about the {@linkcode PluginRotateArgs.pivot pivot} point.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginRotateArgs.componentIds args.componentIds} — Array of component\n * ID strings to rotate\n * - {@linkcode PluginRotateArgs.angle args.angle} — Rotation angle in **radians**\n * - {@linkcode PluginRotateArgs.axis args.axis} — Rotation axis as a {@linkcode PVec3}\n * - {@linkcode PluginRotateArgs.pivot args.pivot} — Pivot point as a {@linkcode PVec3}\n * in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Rotate a space 45° around the Y axis at the origin\n * await snaptrude.tools.transform.rotate({\n * componentIds: [\"some-space-id\"],\n * angle: Math.PI / 4,\n * axis: vec3.new(0, 1, 0),\n * pivot: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\n/**\n * Arguments for {@linkcode PluginTransformApi.move}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to move |\n * | `displacement` | {@linkcode PVec3} | Translation vector in Babylon units |\n */\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\n/**\n * Arguments for {@linkcode PluginTransformApi.rotate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to rotate |\n * | `angle` | `number` | Rotation angle in radians |\n * | `axis` | {@linkcode PVec3} | Rotation axis direction |\n * | `pivot` | {@linkcode PVec3} | Pivot point in Babylon units |\n */\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\n/**\n * Snaptrude editor tools for querying and manipulating scene components.\n *\n * - {@linkcode PluginToolsApi.selection} — Query the current user selection\n * - {@linkcode PluginToolsApi.transform} — Move and rotate components\n */\nexport abstract class PluginToolsApi {\n /** Query the current selection. See {@linkcode PluginSelectionApi}. */\n public abstract selection: PluginSelectionApi\n /** Move and rotate components. See {@linkcode PluginTransformApi}. */\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Unit conversion between real-world units and Snaptrude's internal\n * (Babylon) coordinate system.\n *\n * Snaptrude uses an internal unit system (Babylon units) for all\n * coordinates and dimensions. Use these methods to convert between\n * real-world measurements and Babylon units.\n *\n * Accessed via `snaptrude.units`.\n */\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from a real-world unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertFromArgs.unit args.unit} — The source unit\n * to convert from. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric\n * value in the source unit\n * - {@linkcode PluginUnitsConvertFromArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted\n * `value` in Babylon units\n *\n * # Example\n * ```ts\n * // Convert 5 meters to Babylon units for use in API calls\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: snaptrude.core.math.vec3.new(0, 0, 0),\n * dimensions: { width: result.value, height: result.value, depth: result.value },\n * })\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to a real-world unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertToArgs.unit args.unit} — The target unit\n * to convert to. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric\n * value in Babylon units\n * - {@linkcode PluginUnitsConvertToArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertToResult} containing the converted\n * `value` in the target unit\n *\n * # Example\n * ```ts\n * // Get a space's area in square meters\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-id\",\n * properties: [\"area\"],\n * })\n * const areaInMeters = await snaptrude.units.convertTo({\n * unit: \"meters\",\n * value: info.area!,\n * degree: 2,\n * })\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Source real-world unit |\n * | `value` | `number` | Numeric value in the source unit |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in Babylon units |\n */\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Target real-world unit |\n * | `value` | `number` | Numeric value in Babylon units |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in the target unit |\n */\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\n/**\n * Root API surface for Snaptrude plugins.\n *\n * Access all plugin capabilities through the namespaced properties:\n *\n * - {@linkcode PluginApi.core} — Math and geometry primitives\n * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)\n * - {@linkcode PluginApi.tools} — Selection and transform tools\n * - {@linkcode PluginApi.units} — Unit conversion utilities\n */\nexport abstract class PluginApi {\n /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */\n public abstract core: PluginCoreApi\n /** Selection and transform tools. See {@linkcode PluginToolsApi}. */\n public abstract tools: PluginToolsApi\n /** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */\n public abstract entity: PluginEntityApi\n /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAUZ,IAAe,gBAAf,MAA6B;AAAA,EAClC,cAAc;AAA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,IAAM,6BAA+B,WAAO;AAAA,EACjD,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,+BAAiC,WAAO;AAAA,EACnD,OAAS,WAAO;AAClB,CAAC;AAaM,IAAM,2BAA6B,WAAO;AAAA,EAC/C,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,6BAA+B,WAAO;AAAA,EACjD,OAAS,WAAO;AAClB,CAAC;;;ACjJM,IAAe,YAAf,MAAyB;AAAA,EAU9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["import * as z from \"zod\"\n\n/**\n * 3D vector operations for positions, directions, and displacements.\n *\n * All methods are **pure** — they return new {@linkcode PVec3} values\n * without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.vec3`.\n */\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /**\n * Create a new 3D vector.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @returns A new {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const position = snaptrude.core.math.vec3.new(1, 2, 3)\n * // { x: 1, y: 2, z: 3 }\n * ```\n */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /**\n * Add two vectors component-wise.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`\n */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /**\n * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.\n *\n * @param a - Vector to subtract from\n * @param b - Vector to subtract\n * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`\n */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /**\n * Scale a vector by a scalar value.\n *\n * @param v - The vector to scale\n * @param scalar - The scalar multiplier\n * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`\n */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /**\n * Compute the dot product of two vectors.\n *\n * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle\n * between the vectors. Useful for checking orthogonality (result = 0)\n * or projection.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns The scalar dot product\n */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /**\n * Compute the cross product of two vectors.\n *\n * The result is a vector perpendicular to both inputs, with magnitude\n * equal to the area of the parallelogram they span. Useful for computing\n * surface normals.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}\n */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /**\n * Compute the length (magnitude) of a vector.\n *\n * @param v - The vector\n * @returns The Euclidean length `√(x² + y² + z²)`\n */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /**\n * Compute the squared length of a vector.\n *\n * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}\n * when comparing relative magnitudes.\n *\n * @param v - The vector\n * @returns The squared length `x² + y² + z²`\n */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /**\n * Normalize a vector to unit length.\n *\n * @param v - The vector to normalize\n * @returns A new unit-length {@linkcode PVec3} in the same direction,\n * or a zero vector `(0, 0, 0)` if the input has zero length\n */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /**\n * Compute the Euclidean distance between two points.\n *\n * @param a - First point\n * @param b - Second point\n * @returns The distance `|a - b|`\n */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /**\n * Linearly interpolate between two vectors.\n *\n * @param a - Start vector (returned when `t = 0`)\n * @param b - End vector (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new {@linkcode PVec3} at `a + (b - a) * t`\n */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /**\n * Negate a vector (reverse its direction).\n *\n * @param v - The vector to negate\n * @returns A new {@linkcode PVec3} with all components negated\n */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /**\n * Check if two vectors are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns `true` if all components match exactly\n */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /**\n * Check if two vectors are approximately equal within a tolerance.\n *\n * @param a - First vector\n * @param b - Second vector\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\n/**\n * A 3D vector with `x`, `y`, and `z` components.\n *\n * Used throughout the plugin API for positions, directions, displacements,\n * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.\n */\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\n/**\n * Quaternion operations for 3D rotations.\n *\n * Quaternions avoid gimbal lock and provide smooth interpolation\n * compared to Euler angles. All methods are **pure** — they return\n * new {@linkcode PQuat} values without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.quat`.\n */\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /**\n * Create a new quaternion from raw components.\n *\n * For most use cases prefer {@linkcode PluginQuatApi.fromAxisAngle}\n * or {@linkcode PluginQuatApi.fromEuler} instead.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @param w - The W (scalar) component\n * @returns A new {@linkcode PQuat}\n */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /**\n * Create an identity quaternion representing no rotation.\n *\n * @returns `{ x: 0, y: 0, z: 0, w: 1 }`\n */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /**\n * Create a quaternion from an axis and an angle.\n *\n * @param axis - The rotation axis as a {@linkcode PVec3} (will be normalized internally)\n * @param angle - The rotation angle in **radians**\n * @returns A new unit {@linkcode PQuat}, or identity if {@linkcode axis} has zero length\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * // 90° rotation around the Y axis\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * ```\n */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /**\n * Create a quaternion from Euler angles in **XYZ** rotation order.\n *\n * @param x - Rotation around X axis in **radians**\n * @param y - Rotation around Y axis in **radians**\n * @param z - Rotation around Z axis in **radians**\n * @returns A new {@linkcode PQuat}\n */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /**\n * Multiply two quaternions, combining their rotations.\n *\n * Quaternion multiplication is **not commutative**: `a * b ≠ b * a`.\n * The result applies rotation {@linkcode b} first, then {@linkcode a}.\n *\n * @param a - First quaternion (applied second)\n * @param b - Second quaternion (applied first)\n * @returns A new {@linkcode PQuat} representing the combined rotation\n */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /**\n * Compute the conjugate of a quaternion.\n *\n * For unit quaternions the conjugate equals the inverse.\n *\n * @param q - The quaternion\n * @returns A new {@linkcode PQuat} with negated vector part `(-x, -y, -z, w)`\n */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /**\n * Compute the length (magnitude) of a quaternion.\n *\n * @param q - The quaternion\n * @returns The magnitude `√(x² + y² + z² + w²)`\n */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /**\n * Normalize a quaternion to unit length.\n *\n * @param q - The quaternion to normalize\n * @returns A new unit-length {@linkcode PQuat}, or identity if the input has zero length\n */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /**\n * Compute the inverse of a quaternion.\n *\n * The inverse satisfies `q * inverse(q) = identity`.\n *\n * @param q - The quaternion to invert\n * @returns A new {@linkcode PQuat} that is the multiplicative inverse,\n * or identity if the input has zero length\n */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /**\n * Rotate a 3D vector by a quaternion.\n *\n * Computes `q * v * conjugate(q)` using the Hamilton product.\n *\n * @param q - The rotation quaternion (should be unit-length)\n * @param v - The vector to rotate as a {@linkcode PVec3}\n * @returns A new rotated {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * const rotated = quat.rotateVec3(rot, vec3.new(1, 0, 0))\n * // ≈ { x: 0, y: 0, z: -1 }\n * ```\n */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /**\n * Convert a quaternion to axis-angle representation.\n *\n * @param q - The quaternion to convert\n * @returns An object with:\n * - `axis` — The rotation axis as a unit {@linkcode PVec3}\n * (defaults to `(1, 0, 0)` when angle is zero)\n * - `angle` — The rotation angle in **radians**\n */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /**\n * Spherical linear interpolation between two quaternions.\n *\n * Produces smooth constant-speed rotation between {@linkcode a} and {@linkcode b}.\n *\n * @param a - Start quaternion (returned when `t = 0`)\n * @param b - End quaternion (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new interpolated {@linkcode PQuat}\n */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /**\n * Compute the dot product of two quaternions.\n *\n * A value close to `1` or `-1` indicates similar orientations;\n * a value close to `0` indicates maximally different orientations.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns The scalar dot product\n */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /**\n * Check if two quaternions are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginQuatApi.equalsApprox}.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns `true` if all components match exactly\n */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /**\n * Check if two quaternions are approximately equal within a tolerance.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\n/**\n * A quaternion with `x`, `y`, `z`, and `w` components.\n *\n * Used for representing 3D rotations without gimbal lock.\n * Equivalent to `BABYLON.Quaternion`.\n */\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\n/**\n * Math primitives for 3D vector and quaternion operations.\n *\n * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic\n * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations\n */\nexport abstract class PluginMathApi {\n /** 3D vector operations. See {@linkcode PluginVec3Api}. */\n public abstract vec3: PluginVec3Api\n /** Quaternion operations. See {@linkcode PluginQuatApi}. */\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Line segment construction.\n *\n * A {@linkcode PLine} is the simplest curve primitive — a straight\n * segment between two 3D points. Lines can be wrapped as a\n * {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.line`.\n */\nexport abstract class PluginLineApi {\n constructor() {}\n\n /**\n * Create a new line segment between two points.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @returns A new {@linkcode PLine}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { line } = snaptrude.core.geom\n *\n * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\n/**\n * A line segment defined by a start and end point.\n *\n * Discriminated by `curveType: \"Line\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Line\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the segment |\n * | `endPoint` | {@linkcode PVec3} | End point of the segment |\n */\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Arc construction.\n *\n * A {@linkcode PArc} represents a circular arc in 3D space, defined by\n * start/end points, a centre, and a rotation axis. Arcs can be wrapped\n * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.arc`.\n */\nexport abstract class PluginArcApi {\n constructor() {}\n\n /**\n * Create a new arc from start, end, centre, and axis.\n *\n * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}\n * along the circle centred at {@linkcode centrePoint}, in the\n * direction determined by the right-hand rule around {@linkcode axis}.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}\n * @param axis - The arc's rotation axis as a {@linkcode PVec3}\n * (perpendicular to the arc's plane)\n * @returns A new {@linkcode PArc}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { arc } = snaptrude.core.geom\n *\n * // Quarter-circle arc on the XZ plane\n * const a = arc.new(\n * vec3.new(1, 0, 0), // start\n * vec3.new(0, 0, 1), // end\n * vec3.new(0, 0, 0), // centre\n * vec3.new(0, 1, 0), // Y-up axis\n * )\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\n/**\n * A circular arc defined by start, end, centre, and axis.\n *\n * Discriminated by `curveType: \"Arc\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Arc\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the arc |\n * | `endPoint` | {@linkcode PVec3} | End point of the arc |\n * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |\n * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |\n */\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\n/**\n * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.\n *\n * Use this to build heterogeneous curve lists (mixing lines and arcs)\n * when constructing a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.curve`.\n */\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /**\n * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.\n *\n * This is an identity operation — it simply returns the input unchanged.\n * It exists for type-level clarity when building mixed curve lists.\n *\n * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap\n * @returns The same value typed as {@linkcode PCurve}\n */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\n/**\n * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.\n *\n * Discriminated on the `curveType` field:\n * - `\"Line\"` → {@linkcode PLine}\n * - `\"Arc\"` → {@linkcode PArc}\n *\n * Use `curve.curveType` to narrow the type in a switch or if-statement.\n */\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\n/**\n * Profile construction — a closed loop of {@linkcode PCurve}s.\n *\n * Profiles are the primary 2D shape primitive used for creating\n * extruded entities like spaces. Build profiles either from an\n * explicit list of curves or from a list of points (auto-connected\n * with line segments).\n *\n * Accessed via `snaptrude.core.geom.profile`.\n */\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /**\n * Create a profile from an ordered list of curves.\n *\n * The curves should form a closed loop — the end point of each curve\n * should coincide with the start point of the next.\n *\n * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop\n * @returns A new {@linkcode PProfile}\n */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /**\n * Create a profile by connecting a list of points with line segments.\n *\n * The points are connected in order, with the last point automatically\n * connected back to the first to close the loop.\n *\n * This is a **host API call** — it returns a `Promise`.\n *\n * @param args - An object containing:\n * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered\n * array of {@linkcode PVec3} forming the profile vertices\n * @returns A {@linkcode PProfile} with line-segment curves connecting the points\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Create an L-shaped profile\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 5),\n * vec3.new(5, 0, 5),\n * vec3.new(5, 0, 10),\n * vec3.new(0, 0, 10),\n * ],\n * })\n * ```\n */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\n/**\n * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |\n */\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\n/**\n * A closed profile composed of an ordered list of curves.\n *\n * Profiles are used as input to entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |\n */\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\n/**\n * Geometry primitives for constructing 2D/3D shapes.\n *\n * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.\n * Profiles can then be used with entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * - {@linkcode PluginGeomApi.line} — Line segment construction\n * - {@linkcode PluginGeomApi.arc} — Arc construction\n * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)\n * - {@linkcode PluginGeomApi.profile} — Closed loop of curves\n */\nexport abstract class PluginGeomApi {\n /** Line segment construction. See {@linkcode PluginLineApi}. */\n public abstract line: PluginLineApi\n /** Arc construction. See {@linkcode PluginArcApi}. */\n public abstract arc: PluginArcApi\n /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */\n public abstract curve: PluginCurveApi\n /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\n/**\n * Core primitives used across the plugin API.\n *\n * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations\n * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)\n */\nexport abstract class PluginCoreApi {\n /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */\n public abstract math: PluginMathApi\n /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Department management — create and query departments.\n *\n * A **department** is a named, colored grouping applied to spaces.\n * Departments are used to categorize spaces by function (e.g. \"FOH\",\n * \"Emergency\", \"Residential\") and control their visual appearance.\n *\n * Accessed via `snaptrude.entity.department`.\n */\nexport abstract class PluginDepartmentApi {\n constructor() {}\n\n /**\n * Create a new department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginDepartmentCreateArgs.name args.name} — Display name\n * - {@linkcode PluginDepartmentCreateArgs.color args.color} — CSS hex color string (e.g. `\"#b5e1dc\"`)\n * @returns A {@linkcode PluginDepartmentCreateResult} with the `departmentId`\n * of the created department\n * @throws If department creation fails\n *\n * # Example\n * ```ts\n * const { departmentId } = await snaptrude.entity.department.create({\n * name: \"Emergency\",\n * color: \"#f5e68b\",\n * })\n * ```\n */\n public abstract create(\n args: PluginDepartmentCreateArgs\n ): PluginApiReturn<PluginDepartmentCreateResult>\n\n /**\n * Get all departments in the current project.\n *\n * Returns every department including well-known ones (Default, Site, etc.)\n * and user-created departments.\n *\n * @returns A {@linkcode PluginDepartmentGetAllResult} with a `departments` array\n *\n * # Example\n * ```ts\n * const { departments } = await snaptrude.entity.department.getAll()\n * for (const dept of departments) {\n * console.log(dept.id, dept.name, dept.color)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginDepartmentGetAllResult>\n}\n\n/**\n * Arguments for {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `name` | `string` | Display name of the department |\n * | `color` | `string` | CSS hex color string (e.g. `\"#b5e1dc\"`) |\n */\nexport const PluginDepartmentCreateArgs = z.object({\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentCreateArgs = z.infer<\n typeof PluginDepartmentCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departmentId` | `string` | Unique ID of the created department |\n */\nexport const PluginDepartmentCreateResult = z.object({\n departmentId: z.string(),\n})\n\nexport type PluginDepartmentCreateResult = z.infer<\n typeof PluginDepartmentCreateResult\n>\n\n/**\n * A single department entry returned by {@linkcode PluginDepartmentApi.getAll}.\n */\nexport const PluginDepartmentEntry = z.object({\n id: z.string(),\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentEntry = z.infer<typeof PluginDepartmentEntry>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departments` | {@linkcode PluginDepartmentEntry}`[]` | All departments in the project |\n */\nexport const PluginDepartmentGetAllResult = z.object({\n departments: z.array(PluginDepartmentEntry),\n})\n\nexport type PluginDepartmentGetAllResult = z.infer<\n typeof PluginDepartmentGetAllResult\n>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PProfile } from \"../core/geom/profile\"\nimport { PCurve } from \"../core/geom/curve\"\n\n/**\n * Reference line management — create, query, and delete reference lines.\n *\n * A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,\n * typically used for grid lines and alignment guides. Reference lines\n * carry properties such as grid tags, labels, and line styles.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.referenceLine`.\n */\nexport abstract class PluginReferenceLineApi {\n constructor() {}\n\n /**\n * Create multiple reference lines from a profile.\n *\n * Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes\n * a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`\n * internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A\n * {@linkcode PProfile} whose curves define the reference lines to create\n * @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the\n * `referenceLineIds` of the created reference lines\n * @throws If reference line creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))\n * const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))\n * const profile = snaptrude.core.geom.profile.new([l1, l2])\n *\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({\n * profile,\n * })\n * ```\n */\n public abstract createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): PluginApiReturn<PluginReferenceLineCreateMultiResult>\n\n /**\n * Get properties of a reference line by its ID.\n *\n * Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID\n * - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of\n * property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.\n * @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the\n * requested properties\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.referenceLine.get({\n * referenceLineId: \"some-ref-line-id\",\n * properties: [\"curve\"],\n * })\n * console.log(result.curve) // PCurve\n * ```\n */\n public abstract get(\n args: PluginReferenceLineGetArgs\n ): PluginApiReturn<PluginReferenceLineGetResult>\n\n /**\n * Get the IDs of all reference lines in the current project.\n *\n * Returns every reference line across all stories.\n * Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query\n * individual reference line properties.\n *\n * @returns A {@linkcode PluginReferenceLineGetAllResult} with a\n * `referenceLineIds` array\n *\n * # Example\n * ```ts\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()\n * console.log(`Project has ${referenceLineIds.length} reference lines`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>\n\n /**\n * Delete a reference line by its ID.\n *\n * Permanently removes the reference line and its associated mesh from\n * the scene. This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID to delete\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * await snaptrude.entity.referenceLine.delete({\n * referenceLineId: \"some-ref-line-id\",\n * })\n * ```\n */\n public abstract delete(\n args: PluginReferenceLineDeleteArgs\n ): PluginApiReturn<PluginReferenceLineDeleteResult>\n}\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |\n */\nexport const PluginReferenceLineCreateMultiArgs = z.object({\n profile: PProfile,\n})\n\nexport type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of the created reference lines |\n */\nexport const PluginReferenceLineCreateMultiResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>\n\n/**\n * Available properties that can be queried on a reference line.\n *\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"curve\"` | {@linkcode PCurve} | The curve geometry of the reference line |\n */\nexport const PluginReferenceLineGetProperty = z.enum([\n \"curve\",\n])\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to query |\n * | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginReferenceLineGetArgs = z.object({\n referenceLineId: z.string(),\n properties: z.array(PluginReferenceLineGetProperty),\n})\n\nexport type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginReferenceLineGetArgs.properties} will be present.\n */\nexport const PluginReferenceLineGetResult = z\n .object({\n curve: PCurve,\n })\n .partial()\n\nexport type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |\n */\nexport const PluginReferenceLineGetAllResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to delete |\n */\nexport const PluginReferenceLineDeleteArgs = z.object({\n referenceLineId: z.string(),\n})\n\nexport type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>\n\n/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */\nexport type PluginReferenceLineDeleteResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\n/**\n * Space (room/mass) management — create, query, and delete spaces.\n *\n * A **space** is a 3D volume representing a room or mass in the\n * Snaptrude scene. Spaces live on a particular story and carry\n * properties such as name, area, department, and room type.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.space`.\n */\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n /**\n * Create a rectangular (box) space.\n *\n * Generates an axis-aligned box with the given dimensions at the\n * specified position. The created space is automatically assigned\n * to the active story and a default department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin\n * position as a {@linkcode PVec3} in Babylon units\n * - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box\n * dimensions `{ width, height, depth }` in Babylon units\n * @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`\n * of the created space\n * @throws If space creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * })\n * ```\n */\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n /**\n * Create a space by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is extruded\n * upward (along the Y axis) by {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight\n * extrudeHeight}, then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. The created space is automatically assigned to the active story\n * and a default department.\n *\n * Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile\n * from a list of points.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed\n * {@linkcode PProfile} defining the floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —\n * Extrusion height in Babylon units\n * - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset\n * position as a {@linkcode PVec3} in Babylon units\n * @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`\n * of the created space\n * @throws If the profile is invalid or mesh creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 8),\n * vec3.new(0, 0, 8),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile,\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Get the IDs of all spaces in the current project.\n *\n * Returns every space (mass that is not a building) across all stories.\n * Use the returned IDs with {@linkcode PluginSpaceApi.get} to query\n * individual space properties.\n *\n * @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array\n *\n * # Example\n * ```ts\n * const { spacesIds } = await snaptrude.entity.space.getAll()\n * console.log(`Project has ${spacesIds.length} spaces`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n /**\n * Get properties of a space by its ID.\n *\n * Only the properties listed in {@linkcode PluginSpaceGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID\n * (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})\n * - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property\n * names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.\n * @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested\n * properties\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-space-id\",\n * properties: [\"name\", \"area\", \"position\"],\n * })\n * console.log(info.name, info.area, info.position)\n * ```\n */\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n /**\n * Delete a space by its ID.\n *\n * Permanently removes the space and its associated mesh from the scene.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID\n * to delete\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.delete({ spaceId: \"some-space-id\" })\n * ```\n */\n public abstract delete({\n spaceId,\n }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>\n\n /**\n * Update properties of a space by its ID.\n *\n * Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties\n * args.properties} will be updated — omitted properties remain unchanged.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID\n * to update\n * - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs\n * of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.\n * @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and\n * the updated property values\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.space.update({\n * spaceId: \"some-space-id\",\n * properties: {\n * room_type: \"Kitchen\",\n * massType: \"Room\",\n * departmentId: \"CORE\",\n * },\n * })\n * ```\n */\n public abstract update(\n args: PluginSpaceUpdateArgs\n ): PluginApiReturn<PluginSpaceUpdateResult>\n}\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `position` | {@linkcode PVec3} | Origin position in Babylon units |\n * | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |\n */\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<\n typeof PluginSpaceCreateRectangularArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<\n typeof PluginSpaceCreateRectangularResult\n>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |\n * | `extrudeHeight` | `number` | Extrusion height in Babylon units |\n * | `position` | {@linkcode PVec3} | Offset position in Babylon units |\n */\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<\n typeof PluginSpaceCreateFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<\n typeof PluginSpaceCreateFromProfileResult\n>\n\n/**\n * Available properties that can be queried on a space.\n *\n * **Basic:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"id\"` | `string` | Unique space identifier |\n * | `\"type\"` | `string` | Component type |\n * | `\"room_type\"` | `string` | Room type classification |\n * | `\"name\"` | `string` | Display name of the space |\n *\n * **Derived from parametric data:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"area\"` | `number` | Bottom face area (from `areas_bottomFace`) |\n * | `\"breadth\"` | `number` | Breadth dimension |\n * | `\"depth\"` | `number` | Depth dimension |\n * | `\"height\"` | `number` | Height dimension |\n * | `\"massType\"` | `string \\| null` | Mass type classification |\n * | `\"spaceType\"` | `string \\| null` | Space type classification (Room, Balcony, etc.) |\n * | `\"storey\"` | `number \\| null` | Story the space belongs to |\n * | `\"departmentId\"` | `string \\| null` | Assigned department ID |\n * | `\"departmentName\"` | `string` | Assigned department name |\n * | `\"departmentColor\"` | `string` | Assigned department color (hex/CSS) |\n *\n * **Derived from mesh:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"position\"` | {@linkcode PVec3} | Local position relative to parent |\n * | `\"absolutePosition\"` | {@linkcode PVec3} | Absolute position in the scene |\n * | `\"rotation\"` | {@linkcode PVec3} | Euler rotation angles (radians) |\n * | `\"rotationQuaternion\"` | {@linkcode PQuat} \\| `null` | Quaternion rotation, or `null` if unset |\n *\n * **Derived from brep:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"planPoints\"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |\n */\nexport const PluginSpaceGetProperty = z.enum([\n // Basic\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n // Derived from parametric data\n \"area\",\n \"breadth\",\n \"depth\",\n \"height\",\n \"massType\",\n \"spaceType\",\n \"storey\",\n \"departmentId\",\n \"departmentName\",\n \"departmentColor\",\n // Derived from mesh\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n // Derived from brep\n \"planPoints\",\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to query |\n * | `properties` | {@linkcode PluginSpaceGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\n/**\n * Supported space type values.\n *\n * Mirrors the internal `SpaceType` enum from `spaceType.types.ts`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Room\"` | Standard room |\n * | `\"Program Block\"` | Program/department block |\n * | `\"Balcony\"` | Balcony space |\n * | `\"Road\"` | Road |\n * | `\"Garden\"` | Garden area |\n * | `\"Deck\"` | Deck |\n * | `\"Pool\"` | Pool |\n * | `\"Walkway\"` | Walkway |\n */\nexport const PluginSpaceType = z.enum([\n \"Room\",\n \"Program Block\",\n \"Balcony\",\n \"Road\",\n \"Garden\",\n \"Deck\",\n \"Pool\",\n \"Walkway\",\n])\n\n/**\n * Result of {@linkcode PluginSpaceApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginSpaceGetArgs.properties} will be present.\n */\nexport const PluginSpaceGetResult = z\n .object({\n // Basic\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n // Derived from parametric data\n area: z.number(),\n breadth: z.number(),\n depth: z.number(),\n height: z.number(),\n massType: z.string().nullable(),\n spaceType: PluginSpaceType.nullable(),\n storey: z.number().nullable(),\n departmentId: z.string().nullable(),\n departmentName: z.string(),\n departmentColor: z.string(),\n // Derived from mesh\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n // Derived from brep\n planPoints: z.array(PVec3),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\n/**\n * Result of {@linkcode PluginSpaceApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spacesIds` | `string[]` | IDs of all spaces in the project |\n */\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to delete |\n */\nexport const PluginSpaceDeleteArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>\n\n/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */\nexport type PluginSpaceDeleteResult = void\n\n/**\n * Supported mass type values for {@linkcode PluginSpaceUpdateArgs.properties.massType}.\n *\n * Mirrors the internal `MASS_TYPES` enum.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Plinth\"` | Plinth mass |\n * | `\"Void\"` | Void/cut-out |\n * | `\"Pergola\"` | Pergola structure |\n * | `\"Furniture\"` | Furniture element |\n * | `\"Facade element\"` | Facade element |\n * | `\"Generic mass\"` | Generic mass |\n * | `\"Room\"` | Room (default for spaces) |\n * | `\"Department\"` | Department block |\n * | `\"Building\"` | Building envelope |\n * | `\"Revit Import\"` | Imported from Revit |\n * | `\"Mass\"` | Generic mass type |\n * | `\"Site\"` | Site object |\n */\nexport const PluginMassType = z.enum([\n \"Plinth\",\n \"Void\",\n \"Pergola\",\n \"Furniture\",\n \"Facade element\",\n \"Generic mass\",\n \"Room\",\n \"Department\",\n \"Building\",\n \"Revit Import\",\n \"Mass\",\n \"Site\",\n])\n\n/**\n * Well-known (built-in) department IDs.\n *\n * | Value | Department |\n * |---|---|\n * | `\"DEFAULT\"` | Default department |\n * | `\"SITE\"` | Site department |\n * | `\"ENVELOPE\"` | Envelope department |\n * | `\"CORE\"` | Core department |\n */\nexport const PluginWellKnownDepartmentId = z.enum([\n \"DEFAULT\",\n \"SITE\",\n \"ENVELOPE\",\n \"CORE\",\n])\n\n/**\n * Accepted department ID values — either a {@linkcode PluginWellKnownDepartmentId}\n * or a UUID string for custom (user-created) departments.\n */\nexport const PluginDepartmentId = z.union([\n PluginWellKnownDepartmentId,\n z.uuid(),\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to update |\n * | `properties` | `object` | Key/value pairs of properties to update (all optional) |\n * | `properties.room_type` | `string?` | New room type label |\n * | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |\n * | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |\n */\nexport const PluginSpaceUpdateArgs = z.object({\n spaceId: z.string(),\n properties: z.object({\n room_type: z.string().optional(),\n massType: PluginMassType.optional(),\n spaceType: PluginSpaceType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n})\n\nexport type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.update}.\n *\n * Echoes back the `spaceId` and the values of properties that were updated.\n * Properties that were not included in the update request will be `undefined`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID that was updated |\n * | `room_type` | `string?` | Updated room type (if changed) |\n * | `massType` | `string?` | Updated mass type (if changed) |\n * | `spaceType` | `string?` | Updated space type (if changed) |\n * | `departmentId` | `string \\| null?` | Updated department ID (if changed) |\n */\nexport const PluginSpaceUpdateResult = z.object({\n spaceId: z.string(),\n room_type: z.string().optional(),\n massType: z.string().optional(),\n spaceType: z.string().optional(),\n departmentId: z.string().nullable().optional(),\n})\n\nexport type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Story (floor/storey) management.\n *\n * A story represents a building floor in the Snaptrude project. Stories\n * are identified by their integer **story value** (e.g. `1` for ground\n * floor, `2` for first floor, `-1` for a basement).\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.story`.\n */\nexport abstract class PluginStoryApi {\n constructor() {}\n\n /**\n * Get properties of a story by its storey number.\n *\n * Only the properties listed in {@linkcode PluginStoryGetArgs.properties args.properties}\n * are returned — unlisted properties will be `undefined` in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryGetArgs.storyValue args.storyValue} — Integer storey number\n * (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)\n * - {@linkcode PluginStoryGetArgs.properties args.properties} — Array of property names\n * to retrieve. See {@linkcode PluginStoryGetProperty} for available values.\n * @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties\n * @throws If the story with the given value does not exist\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.story.get({\n * storyValue: 1,\n * properties: [\"height\", \"name\", \"spacesCount\"],\n * })\n * console.log(info.name, info.height, info.spacesCount)\n * ```\n */\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n /**\n * Get all stories in the current project.\n *\n * Returns basic identification data for every storey. Stories are sorted\n * from **top to bottom** (highest story value first).\n *\n * @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,\n * each entry containing `value`, `id`, and `name`\n *\n * # Example\n * ```ts\n * const { stories } = await snaptrude.entity.story.getAll()\n * for (const s of stories) {\n * console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n /**\n * Create a new story (floor) in the project.\n *\n * The new story is inserted at the position specified by\n * {@linkcode PluginStoryCreateArgs.storyValue args.storyValue}. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryCreateArgs.storyValue args.storyValue} — Integer storey number\n * to create (e.g. `3` to add a third floor)\n * - {@linkcode PluginStoryCreateArgs.height args.height} — Optional height in Babylon\n * units. If omitted, the project's default storey height is used.\n * @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`\n * @throws If a story with the given value already exists or creation fails\n *\n * # Example\n * ```ts\n * // Create a new third floor with custom height\n * const { storyId } = await snaptrude.entity.story.create({\n * storyValue: 3,\n * height: 4.5,\n * })\n * ```\n */\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n /**\n * Update a story's height.\n *\n * Changes the floor-to-floor height of the specified story. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryUpdateArgs.storyValue args.storyValue} — Integer storey number\n * identifying the story to update\n * - {@linkcode PluginStoryUpdateArgs.height args.height} — New height value in Babylon\n * units\n * @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`\n * @throws If the story does not exist or the update fails\n *\n * # Example\n * ```ts\n * // Set ground floor height to 5 Babylon units\n * const result = await snaptrude.entity.story.update({\n * storyValue: 1,\n * height: 5,\n * })\n * ```\n */\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\n/**\n * Available properties that can be queried on a story.\n *\n * | Value | Type | Description |\n * |---|---|---|\n * | `\"value\"` | `number` | The integer storey number |\n * | `\"id\"` | `string` | Unique story identifier |\n * | `\"name\"` | `string` | Display name of the story |\n * | `\"height\"` | `number` | Floor-to-floor height in Babylon units |\n * | `\"base\"` | `number` | Base elevation in Babylon units |\n * | `\"hidden\"` | `boolean` | Whether the story is hidden in the viewport |\n * | `\"spacesCount\"` | `number` | Number of spaces on this story |\n * | `\"totalArea\"` | `number` | Total floor area of this story |\n */\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\n/**\n * Arguments for {@linkcode PluginStoryApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number to query |\n * | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginStoryGetArgs.properties} will be present.\n */\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\n/**\n * Result of {@linkcode PluginStoryApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |\n */\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number for the new story |\n * | `height` | `number?` | Optional height in Babylon units |\n */\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyId` | `string` | Unique ID of the created story |\n * | `storyValue` | `number` | The storey number of the created story |\n */\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | Storey number of the story to update |\n * | `height` | `number` | New height in Babylon units |\n */\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` | The storey number of the updated story |\n * | `height` | `number` | The new height after the update |\n */\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginDepartmentApi } from \"./department\"\nimport { PluginReferenceLineApi } from \"./referenceLine\"\nimport { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\n/**\n * CRUD operations on Snaptrude building entities.\n *\n * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)\n * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)\n * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines\n * - {@linkcode PluginEntityApi.department} — Create and query departments\n */\nexport abstract class PluginEntityApi {\n /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */\n public abstract space: PluginSpaceApi\n /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */\n public abstract story: PluginStoryApi\n /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */\n public abstract referenceLine: PluginReferenceLineApi\n /** Department operations. See {@linkcode PluginDepartmentApi}. */\n public abstract department: PluginDepartmentApi\n\n constructor() {}\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Query the current user selection in the Snaptrude editor.\n *\n * Accessed via `snaptrude.tools.selection`.\n */\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n /**\n * Get the IDs of all currently selected components.\n *\n * Returns the component IDs from the editor's active selection stack.\n * If nothing is selected, returns an empty array.\n *\n * The returned IDs can be used with {@linkcode PluginTransformApi.move},\n * {@linkcode PluginTransformApi.rotate}, or entity query methods like\n * {@linkcode PluginSpaceApi.get}.\n *\n * @returns A {@linkcode PluginSelectionGetResult} with a `selected` array\n * of component ID strings\n *\n * # Example\n * ```ts\n * const { selected } = await snaptrude.tools.selection.get()\n * if (selected.length > 0) {\n * // Move selected components 5 units along X\n * await snaptrude.tools.transform.move({\n * componentIds: selected,\n * displacement: snaptrude.core.math.vec3.new(5, 0, 0),\n * })\n * }\n * ```\n */\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\n/**\n * Result of {@linkcode PluginSelectionApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `selected` | `string[]` | Component IDs of the current selection |\n */\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Transform operations — move and rotate scene components.\n *\n * All transform methods accept an array of component IDs and apply the\n * transformation to each. Operations are recorded in Snaptrude's\n * command system for undo/redo support.\n *\n * Accessed via `snaptrude.tools.transform`.\n */\nexport abstract class PluginTransformApi {\n constructor() {}\n\n /**\n * Translate components by a displacement vector.\n *\n * Each component's position is offset by the given\n * {@linkcode PluginMoveArgs.displacement displacement} vector.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginMoveArgs.componentIds args.componentIds} — Array of component\n * ID strings to move\n * - {@linkcode PluginMoveArgs.displacement args.displacement} — Translation vector\n * as a {@linkcode PVec3} in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Move a space 10 units along the X axis\n * await snaptrude.tools.transform.move({\n * componentIds: [\"some-space-id\"],\n * displacement: vec3.new(10, 0, 0),\n * })\n * ```\n */\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n /**\n * Rotate components around an axis through a pivot point.\n *\n * Each component is rotated by {@linkcode PluginRotateArgs.angle angle}\n * radians around the {@linkcode PluginRotateArgs.axis axis} vector,\n * pivoting about the {@linkcode PluginRotateArgs.pivot pivot} point.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginRotateArgs.componentIds args.componentIds} — Array of component\n * ID strings to rotate\n * - {@linkcode PluginRotateArgs.angle args.angle} — Rotation angle in **radians**\n * - {@linkcode PluginRotateArgs.axis args.axis} — Rotation axis as a {@linkcode PVec3}\n * - {@linkcode PluginRotateArgs.pivot args.pivot} — Pivot point as a {@linkcode PVec3}\n * in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Rotate a space 45° around the Y axis at the origin\n * await snaptrude.tools.transform.rotate({\n * componentIds: [\"some-space-id\"],\n * angle: Math.PI / 4,\n * axis: vec3.new(0, 1, 0),\n * pivot: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\n/**\n * Arguments for {@linkcode PluginTransformApi.move}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to move |\n * | `displacement` | {@linkcode PVec3} | Translation vector in Babylon units |\n */\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\n/**\n * Arguments for {@linkcode PluginTransformApi.rotate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to rotate |\n * | `angle` | `number` | Rotation angle in radians |\n * | `axis` | {@linkcode PVec3} | Rotation axis direction |\n * | `pivot` | {@linkcode PVec3} | Pivot point in Babylon units |\n */\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\n/**\n * Snaptrude editor tools for querying and manipulating scene components.\n *\n * - {@linkcode PluginToolsApi.selection} — Query the current user selection\n * - {@linkcode PluginToolsApi.transform} — Move and rotate components\n */\nexport abstract class PluginToolsApi {\n /** Query the current selection. See {@linkcode PluginSelectionApi}. */\n public abstract selection: PluginSelectionApi\n /** Move and rotate components. See {@linkcode PluginTransformApi}. */\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Unit conversion between real-world units and Snaptrude's internal\n * (Babylon) coordinate system.\n *\n * Snaptrude uses an internal unit system (Babylon units) for all\n * coordinates and dimensions. Use these methods to convert between\n * real-world measurements and Babylon units.\n *\n * Accessed via `snaptrude.units`.\n */\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from a real-world unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertFromArgs.unit args.unit} — The source unit\n * to convert from. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric\n * value in the source unit\n * - {@linkcode PluginUnitsConvertFromArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted\n * `value` in Babylon units\n *\n * # Example\n * ```ts\n * // Convert 5 meters to Babylon units for use in API calls\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: snaptrude.core.math.vec3.new(0, 0, 0),\n * dimensions: { width: result.value, height: result.value, depth: result.value },\n * })\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to a real-world unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertToArgs.unit args.unit} — The target unit\n * to convert to. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric\n * value in Babylon units\n * - {@linkcode PluginUnitsConvertToArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertToResult} containing the converted\n * `value` in the target unit\n *\n * # Example\n * ```ts\n * // Get a space's area in square meters\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-id\",\n * properties: [\"area\"],\n * })\n * const areaInMeters = await snaptrude.units.convertTo({\n * unit: \"meters\",\n * value: info.area!,\n * degree: 2,\n * })\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Source real-world unit |\n * | `value` | `number` | Numeric value in the source unit |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in Babylon units |\n */\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Target real-world unit |\n * | `value` | `number` | Numeric value in Babylon units |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in the target unit |\n */\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\n/**\n * Root API surface for Snaptrude plugins.\n *\n * Access all plugin capabilities through the namespaced properties:\n *\n * - {@linkcode PluginApi.core} — Math and geometry primitives\n * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)\n * - {@linkcode PluginApi.tools} — Selection and transform tools\n * - {@linkcode PluginApi.units} — Unit conversion utilities\n */\nexport abstract class PluginApi {\n /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */\n public abstract core: PluginCoreApi\n /** Selection and transform tools. See {@linkcode PluginToolsApi}. */\n public abstract tools: PluginToolsApi\n /** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */\n public abstract entity: PluginEntityApi\n /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n"],"mappings":";AAAA,YAAY,OAAO;AAUZ,IAAe,gBAAf,MAA6B;AAAA,EAClC,cAAc;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBf,IAAI,GAAW,GAAWA,KAAkB;AAC1C,WAAO,EAAE,GAAG,GAAG,GAAAA,IAAE;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,GAAU,GAAiB;AAC7B,WAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,SAAS,GAAU,GAAiB;AAClC,WAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,GAAU,QAAuB;AACrC,WAAO,EAAE,GAAG,EAAE,IAAI,QAAQ,GAAG,EAAE,IAAI,QAAQ,GAAG,EAAE,IAAI,OAAO;AAAA,E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,UAAQ,WAAO,CAAC;AAAA,EAChC,cAAc;AAChB,CAAC;AAcM,IAAM,mBAAqB,WAAO;AAAA,EACvC,cAAgB,UAAQ,WAAO,CAAC;AAAA,EAChC,OAAS,WAAO;AAAA,EAChB,MAAM;AAAA,EACN,OAAO;AACT,CAAC;;;ACzGM,IAAe,iBAAf,MAA8B;AAAA,EAMnC,cAAc;AAAA,EAAC;AACjB;;;AChBA,YAAYC,SAAO;AAaZ,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;AAiEjB;AAaO,IAAM,YAAc,SAAK;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAaM,IAAM,6BAA+B,WAAO;AAAA,EACjD,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,+BAAiC,WAAO;AAAA,EACnD,OAAS,WAAO;AAClB,CAAC;AAaM,IAAM,2BAA6B,WAAO;AAAA,EAC/C,MAAM;AAAA,EACN,OAAS,WAAO;AAAA,EAChB,QAAU,WAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,6BAA+B,WAAO;AAAA,EACjD,OAAS,WAAO;AAClB,CAAC;;;ACjJM,IAAe,YAAf,MAAyB;AAAA,EAU9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["import * as z from \"zod\"\n\n/**\n * 3D vector operations for positions, directions, and displacements.\n *\n * All methods are **pure** — they return new {@linkcode PVec3} values\n * without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.vec3`.\n */\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /**\n * Create a new 3D vector.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @returns A new {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const position = snaptrude.core.math.vec3.new(1, 2, 3)\n * // { x: 1, y: 2, z: 3 }\n * ```\n */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /**\n * Add two vectors component-wise.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`\n */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /**\n * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.\n *\n * @param a - Vector to subtract from\n * @param b - Vector to subtract\n * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`\n */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /**\n * Scale a vector by a scalar value.\n *\n * @param v - The vector to scale\n * @param scalar - The scalar multiplier\n * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`\n */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /**\n * Compute the dot product of two vectors.\n *\n * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle\n * between the vectors. Useful for checking orthogonality (result = 0)\n * or projection.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns The scalar dot product\n */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /**\n * Compute the cross product of two vectors.\n *\n * The result is a vector perpendicular to both inputs, with magnitude\n * equal to the area of the parallelogram they span. Useful for computing\n * surface normals.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}\n */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /**\n * Compute the length (magnitude) of a vector.\n *\n * @param v - The vector\n * @returns The Euclidean length `√(x² + y² + z²)`\n */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /**\n * Compute the squared length of a vector.\n *\n * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}\n * when comparing relative magnitudes.\n *\n * @param v - The vector\n * @returns The squared length `x² + y² + z²`\n */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /**\n * Normalize a vector to unit length.\n *\n * @param v - The vector to normalize\n * @returns A new unit-length {@linkcode PVec3} in the same direction,\n * or a zero vector `(0, 0, 0)` if the input has zero length\n */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /**\n * Compute the Euclidean distance between two points.\n *\n * @param a - First point\n * @param b - Second point\n * @returns The distance `|a - b|`\n */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /**\n * Linearly interpolate between two vectors.\n *\n * @param a - Start vector (returned when `t = 0`)\n * @param b - End vector (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new {@linkcode PVec3} at `a + (b - a) * t`\n */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /**\n * Negate a vector (reverse its direction).\n *\n * @param v - The vector to negate\n * @returns A new {@linkcode PVec3} with all components negated\n */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /**\n * Check if two vectors are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns `true` if all components match exactly\n */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /**\n * Check if two vectors are approximately equal within a tolerance.\n *\n * @param a - First vector\n * @param b - Second vector\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\n/**\n * A 3D vector with `x`, `y`, and `z` components.\n *\n * Used throughout the plugin API for positions, directions, displacements,\n * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.\n */\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\n/**\n * Quaternion operations for 3D rotations.\n *\n * Quaternions avoid gimbal lock and provide smooth interpolation\n * compared to Euler angles. All methods are **pure** — they return\n * new {@linkcode PQuat} values without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.quat`.\n */\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /**\n * Create a new quaternion from raw components.\n *\n * For most use cases prefer {@linkcode PluginQuatApi.fromAxisAngle}\n * or {@linkcode PluginQuatApi.fromEuler} instead.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @param w - The W (scalar) component\n * @returns A new {@linkcode PQuat}\n */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /**\n * Create an identity quaternion representing no rotation.\n *\n * @returns `{ x: 0, y: 0, z: 0, w: 1 }`\n */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /**\n * Create a quaternion from an axis and an angle.\n *\n * @param axis - The rotation axis as a {@linkcode PVec3} (will be normalized internally)\n * @param angle - The rotation angle in **radians**\n * @returns A new unit {@linkcode PQuat}, or identity if {@linkcode axis} has zero length\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * // 90° rotation around the Y axis\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * ```\n */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /**\n * Create a quaternion from Euler angles in **XYZ** rotation order.\n *\n * @param x - Rotation around X axis in **radians**\n * @param y - Rotation around Y axis in **radians**\n * @param z - Rotation around Z axis in **radians**\n * @returns A new {@linkcode PQuat}\n */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /**\n * Multiply two quaternions, combining their rotations.\n *\n * Quaternion multiplication is **not commutative**: `a * b ≠ b * a`.\n * The result applies rotation {@linkcode b} first, then {@linkcode a}.\n *\n * @param a - First quaternion (applied second)\n * @param b - Second quaternion (applied first)\n * @returns A new {@linkcode PQuat} representing the combined rotation\n */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /**\n * Compute the conjugate of a quaternion.\n *\n * For unit quaternions the conjugate equals the inverse.\n *\n * @param q - The quaternion\n * @returns A new {@linkcode PQuat} with negated vector part `(-x, -y, -z, w)`\n */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /**\n * Compute the length (magnitude) of a quaternion.\n *\n * @param q - The quaternion\n * @returns The magnitude `√(x² + y² + z² + w²)`\n */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /**\n * Normalize a quaternion to unit length.\n *\n * @param q - The quaternion to normalize\n * @returns A new unit-length {@linkcode PQuat}, or identity if the input has zero length\n */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /**\n * Compute the inverse of a quaternion.\n *\n * The inverse satisfies `q * inverse(q) = identity`.\n *\n * @param q - The quaternion to invert\n * @returns A new {@linkcode PQuat} that is the multiplicative inverse,\n * or identity if the input has zero length\n */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /**\n * Rotate a 3D vector by a quaternion.\n *\n * Computes `q * v * conjugate(q)` using the Hamilton product.\n *\n * @param q - The rotation quaternion (should be unit-length)\n * @param v - The vector to rotate as a {@linkcode PVec3}\n * @returns A new rotated {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * const rotated = quat.rotateVec3(rot, vec3.new(1, 0, 0))\n * // ≈ { x: 0, y: 0, z: -1 }\n * ```\n */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /**\n * Convert a quaternion to axis-angle representation.\n *\n * @param q - The quaternion to convert\n * @returns An object with:\n * - `axis` — The rotation axis as a unit {@linkcode PVec3}\n * (defaults to `(1, 0, 0)` when angle is zero)\n * - `angle` — The rotation angle in **radians**\n */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /**\n * Spherical linear interpolation between two quaternions.\n *\n * Produces smooth constant-speed rotation between {@linkcode a} and {@linkcode b}.\n *\n * @param a - Start quaternion (returned when `t = 0`)\n * @param b - End quaternion (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new interpolated {@linkcode PQuat}\n */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /**\n * Compute the dot product of two quaternions.\n *\n * A value close to `1` or `-1` indicates similar orientations;\n * a value close to `0` indicates maximally different orientations.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns The scalar dot product\n */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /**\n * Check if two quaternions are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginQuatApi.equalsApprox}.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns `true` if all components match exactly\n */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /**\n * Check if two quaternions are approximately equal within a tolerance.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\n/**\n * A quaternion with `x`, `y`, `z`, and `w` components.\n *\n * Used for representing 3D rotations without gimbal lock.\n * Equivalent to `BABYLON.Quaternion`.\n */\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\n/**\n * Math primitives for 3D vector and quaternion operations.\n *\n * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic\n * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations\n */\nexport abstract class PluginMathApi {\n /** 3D vector operations. See {@linkcode PluginVec3Api}. */\n public abstract vec3: PluginVec3Api\n /** Quaternion operations. See {@linkcode PluginQuatApi}. */\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Line segment construction.\n *\n * A {@linkcode PLine} is the simplest curve primitive — a straight\n * segment between two 3D points. Lines can be wrapped as a\n * {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.line`.\n */\nexport abstract class PluginLineApi {\n constructor() {}\n\n /**\n * Create a new line segment between two points.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @returns A new {@linkcode PLine}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { line } = snaptrude.core.geom\n *\n * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\n/**\n * A line segment defined by a start and end point.\n *\n * Discriminated by `curveType: \"Line\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Line\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the segment |\n * | `endPoint` | {@linkcode PVec3} | End point of the segment |\n */\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Arc construction.\n *\n * A {@linkcode PArc} represents a circular arc in 3D space, defined by\n * start/end points, a centre, and a rotation axis. Arcs can be wrapped\n * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.arc`.\n */\nexport abstract class PluginArcApi {\n constructor() {}\n\n /**\n * Create a new arc from start, end, centre, and axis.\n *\n * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}\n * along the circle centred at {@linkcode centrePoint}, in the\n * direction determined by the right-hand rule around {@linkcode axis}.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}\n * @param axis - The arc's rotation axis as a {@linkcode PVec3}\n * (perpendicular to the arc's plane)\n * @returns A new {@linkcode PArc}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { arc } = snaptrude.core.geom\n *\n * // Quarter-circle arc on the XZ plane\n * const a = arc.new(\n * vec3.new(1, 0, 0), // start\n * vec3.new(0, 0, 1), // end\n * vec3.new(0, 0, 0), // centre\n * vec3.new(0, 1, 0), // Y-up axis\n * )\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\n/**\n * A circular arc defined by start, end, centre, and axis.\n *\n * Discriminated by `curveType: \"Arc\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Arc\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the arc |\n * | `endPoint` | {@linkcode PVec3} | End point of the arc |\n * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |\n * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |\n */\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\n/**\n * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.\n *\n * Use this to build heterogeneous curve lists (mixing lines and arcs)\n * when constructing a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.curve`.\n */\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /**\n * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.\n *\n * This is an identity operation — it simply returns the input unchanged.\n * It exists for type-level clarity when building mixed curve lists.\n *\n * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap\n * @returns The same value typed as {@linkcode PCurve}\n */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\n/**\n * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.\n *\n * Discriminated on the `curveType` field:\n * - `\"Line\"` → {@linkcode PLine}\n * - `\"Arc\"` → {@linkcode PArc}\n *\n * Use `curve.curveType` to narrow the type in a switch or if-statement.\n */\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\n/**\n * Profile construction — a closed loop of {@linkcode PCurve}s.\n *\n * Profiles are the primary 2D shape primitive used for creating\n * extruded entities like spaces. Build profiles either from an\n * explicit list of curves or from a list of points (auto-connected\n * with line segments).\n *\n * Accessed via `snaptrude.core.geom.profile`.\n */\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /**\n * Create a profile from an ordered list of curves.\n *\n * The curves should form a closed loop — the end point of each curve\n * should coincide with the start point of the next.\n *\n * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop\n * @returns A new {@linkcode PProfile}\n */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /**\n * Create a profile by connecting a list of points with line segments.\n *\n * The points are connected in order, with the last point automatically\n * connected back to the first to close the loop.\n *\n * This is a **host API call** — it returns a `Promise`.\n *\n * @param args - An object containing:\n * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered\n * array of {@linkcode PVec3} forming the profile vertices\n * @returns A {@linkcode PProfile} with line-segment curves connecting the points\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Create an L-shaped profile\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 5),\n * vec3.new(5, 0, 5),\n * vec3.new(5, 0, 10),\n * vec3.new(0, 0, 10),\n * ],\n * })\n * ```\n */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\n/**\n * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |\n */\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\n/**\n * A closed profile composed of an ordered list of curves.\n *\n * Profiles are used as input to entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |\n */\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\n/**\n * Geometry primitives for constructing 2D/3D shapes.\n *\n * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.\n * Profiles can then be used with entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * - {@linkcode PluginGeomApi.line} — Line segment construction\n * - {@linkcode PluginGeomApi.arc} — Arc construction\n * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)\n * - {@linkcode PluginGeomApi.profile} — Closed loop of curves\n */\nexport abstract class PluginGeomApi {\n /** Line segment construction. See {@linkcode PluginLineApi}. */\n public abstract line: PluginLineApi\n /** Arc construction. See {@linkcode PluginArcApi}. */\n public abstract arc: PluginArcApi\n /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */\n public abstract curve: PluginCurveApi\n /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\n/**\n * Core primitives used across the plugin API.\n *\n * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations\n * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)\n */\nexport abstract class PluginCoreApi {\n /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */\n public abstract math: PluginMathApi\n /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Department management — create and query departments.\n *\n * A **department** is a named, colored grouping applied to spaces.\n * Departments are used to categorize spaces by function (e.g. \"FOH\",\n * \"Emergency\", \"Residential\") and control their visual appearance.\n *\n * Accessed via `snaptrude.entity.department`.\n */\nexport abstract class PluginDepartmentApi {\n constructor() {}\n\n /**\n * Create a new department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginDepartmentCreateArgs.name args.name} — Display name\n * - {@linkcode PluginDepartmentCreateArgs.color args.color} — CSS hex color string (e.g. `\"#b5e1dc\"`)\n * @returns A {@linkcode PluginDepartmentCreateResult} with the `departmentId`\n * of the created department\n * @throws If department creation fails\n *\n * # Example\n * ```ts\n * const { departmentId } = await snaptrude.entity.department.create({\n * name: \"Emergency\",\n * color: \"#f5e68b\",\n * })\n * ```\n */\n public abstract create(\n args: PluginDepartmentCreateArgs\n ): PluginApiReturn<PluginDepartmentCreateResult>\n\n /**\n * Get all departments in the current project.\n *\n * Returns every department including well-known ones (Default, Site, etc.)\n * and user-created departments.\n *\n * @returns A {@linkcode PluginDepartmentGetAllResult} with a `departments` array\n *\n * # Example\n * ```ts\n * const { departments } = await snaptrude.entity.department.getAll()\n * for (const dept of departments) {\n * console.log(dept.id, dept.name, dept.color)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginDepartmentGetAllResult>\n}\n\n/**\n * Arguments for {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `name` | `string` | Display name of the department |\n * | `color` | `string` | CSS hex color string (e.g. `\"#b5e1dc\"`) |\n */\nexport const PluginDepartmentCreateArgs = z.object({\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentCreateArgs = z.infer<\n typeof PluginDepartmentCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departmentId` | `string` | Unique ID of the created department |\n */\nexport const PluginDepartmentCreateResult = z.object({\n departmentId: z.string(),\n})\n\nexport type PluginDepartmentCreateResult = z.infer<\n typeof PluginDepartmentCreateResult\n>\n\n/**\n * A single department entry returned by {@linkcode PluginDepartmentApi.getAll}.\n */\nexport const PluginDepartmentEntry = z.object({\n id: z.string(),\n name: z.string(),\n color: z.string(),\n})\n\nexport type PluginDepartmentEntry = z.infer<typeof PluginDepartmentEntry>\n\n/**\n * Result of {@linkcode PluginDepartmentApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `departments` | {@linkcode PluginDepartmentEntry}`[]` | All departments in the project |\n */\nexport const PluginDepartmentGetAllResult = z.object({\n departments: z.array(PluginDepartmentEntry),\n})\n\nexport type PluginDepartmentGetAllResult = z.infer<\n typeof PluginDepartmentGetAllResult\n>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PProfile } from \"../core/geom/profile\"\nimport { PCurve } from \"../core/geom/curve\"\n\n/**\n * Reference line management — create, query, and delete reference lines.\n *\n * A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,\n * typically used for grid lines and alignment guides. Reference lines\n * carry properties such as grid tags, labels, and line styles.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.referenceLine`.\n */\nexport abstract class PluginReferenceLineApi {\n constructor() {}\n\n /**\n * Create multiple reference lines from a profile.\n *\n * Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes\n * a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`\n * internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A\n * {@linkcode PProfile} whose curves define the reference lines to create\n * @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the\n * `referenceLineIds` of the created reference lines\n * @throws If reference line creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))\n * const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))\n * const profile = snaptrude.core.geom.profile.new([l1, l2])\n *\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({\n * profile,\n * })\n * ```\n */\n public abstract createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): PluginApiReturn<PluginReferenceLineCreateMultiResult>\n\n /**\n * Get properties of a reference line by its ID.\n *\n * Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID\n * - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of\n * property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.\n * @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the\n * requested properties\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.referenceLine.get({\n * referenceLineId: \"some-ref-line-id\",\n * properties: [\"curve\"],\n * })\n * console.log(result.curve) // PCurve\n * ```\n */\n public abstract get(\n args: PluginReferenceLineGetArgs\n ): PluginApiReturn<PluginReferenceLineGetResult>\n\n /**\n * Get the IDs of all reference lines in the current project.\n *\n * Returns every reference line across all stories.\n * Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query\n * individual reference line properties.\n *\n * @returns A {@linkcode PluginReferenceLineGetAllResult} with a\n * `referenceLineIds` array\n *\n * # Example\n * ```ts\n * const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()\n * console.log(`Project has ${referenceLineIds.length} reference lines`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>\n\n /**\n * Delete a reference line by its ID.\n *\n * Permanently removes the reference line and its associated mesh from\n * the scene. This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —\n * The unique reference line ID to delete\n * @throws If the reference line does not exist\n *\n * # Example\n * ```ts\n * await snaptrude.entity.referenceLine.delete({\n * referenceLineId: \"some-ref-line-id\",\n * })\n * ```\n */\n public abstract delete(\n args: PluginReferenceLineDeleteArgs\n ): PluginApiReturn<PluginReferenceLineDeleteResult>\n}\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |\n */\nexport const PluginReferenceLineCreateMultiArgs = z.object({\n profile: PProfile,\n})\n\nexport type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.createMulti}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of the created reference lines |\n */\nexport const PluginReferenceLineCreateMultiResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>\n\n/**\n * Available properties that can be queried on a reference line.\n *\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"curve\"` | {@linkcode PCurve} | The curve geometry of the reference line |\n */\nexport const PluginReferenceLineGetProperty = z.enum([\n \"curve\",\n])\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to query |\n * | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginReferenceLineGetArgs = z.object({\n referenceLineId: z.string(),\n properties: z.array(PluginReferenceLineGetProperty),\n})\n\nexport type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginReferenceLineGetArgs.properties} will be present.\n */\nexport const PluginReferenceLineGetResult = z\n .object({\n curve: PCurve,\n })\n .partial()\n\nexport type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>\n\n/**\n * Result of {@linkcode PluginReferenceLineApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |\n */\nexport const PluginReferenceLineGetAllResult = z.object({\n referenceLineIds: z.array(z.string()),\n})\n\nexport type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginReferenceLineApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `referenceLineId` | `string` | The reference line ID to delete |\n */\nexport const PluginReferenceLineDeleteArgs = z.object({\n referenceLineId: z.string(),\n})\n\nexport type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>\n\n/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */\nexport type PluginReferenceLineDeleteResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\n/**\n * Space (room/mass) management — create, query, and delete spaces.\n *\n * A **space** is a 3D volume representing a room or mass in the\n * Snaptrude scene. Spaces live on a particular story and carry\n * properties such as name, area, department, and room type.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.space`.\n */\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n /**\n * Create a rectangular (box) space.\n *\n * Generates an axis-aligned box with the given dimensions at the\n * specified position. The created space is automatically assigned\n * to the active story and a default department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin\n * position as a {@linkcode PVec3} in Babylon units\n * - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box\n * dimensions `{ width, height, depth }` in Babylon units\n * @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`\n * of the created space\n * @throws If space creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * })\n * ```\n */\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n /**\n * Create a space by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is extruded\n * upward (along the Y axis) by {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight\n * extrudeHeight}, then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. The created space is automatically assigned to the active story\n * and a default department.\n *\n * Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile\n * from a list of points.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed\n * {@linkcode PProfile} defining the floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —\n * Extrusion height in Babylon units\n * - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset\n * position as a {@linkcode PVec3} in Babylon units\n * @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`\n * of the created space\n * @throws If the profile is invalid or mesh creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 8),\n * vec3.new(0, 0, 8),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile,\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Get the IDs of all spaces in the current project.\n *\n * Returns every space (mass that is not a building) across all stories.\n * Use the returned IDs with {@linkcode PluginSpaceApi.get} to query\n * individual space properties.\n *\n * @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array\n *\n * # Example\n * ```ts\n * const { spacesIds } = await snaptrude.entity.space.getAll()\n * console.log(`Project has ${spacesIds.length} spaces`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n /**\n * Get properties of a space by its ID.\n *\n * Only the properties listed in {@linkcode PluginSpaceGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID\n * (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})\n * - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property\n * names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.\n * @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested\n * properties\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-space-id\",\n * properties: [\"name\", \"area\", \"position\"],\n * })\n * console.log(info.name, info.area, info.position)\n * ```\n */\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n /**\n * Delete a space by its ID.\n *\n * Permanently removes the space and its associated mesh from the scene.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID\n * to delete\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.delete({ spaceId: \"some-space-id\" })\n * ```\n */\n public abstract delete({\n spaceId,\n }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>\n\n /**\n * Update properties of a space by its ID.\n *\n * Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties\n * args.properties} will be updated — omitted properties remain unchanged.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID\n * to update\n * - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs\n * of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.\n * @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and\n * the updated property values\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const result = await snaptrude.entity.space.update({\n * spaceId: \"some-space-id\",\n * properties: {\n * room_type: \"Kitchen\",\n * massType: \"Room\",\n * departmentId: \"CORE\",\n * },\n * })\n * ```\n */\n public abstract update(\n args: PluginSpaceUpdateArgs\n ): PluginApiReturn<PluginSpaceUpdateResult>\n}\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `position` | {@linkcode PVec3} | Origin position in Babylon units |\n * | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |\n */\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<\n typeof PluginSpaceCreateRectangularArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<\n typeof PluginSpaceCreateRectangularResult\n>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |\n * | `extrudeHeight` | `number` | Extrusion height in Babylon units |\n * | `position` | {@linkcode PVec3} | Offset position in Babylon units |\n */\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<\n typeof PluginSpaceCreateFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<\n typeof PluginSpaceCreateFromProfileResult\n>\n\n/**\n * Available properties that can be queried on a space.\n *\n * **Basic:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"id\"` | `string` | Unique space identifier |\n * | `\"type\"` | `string` | Component type |\n * | `\"room_type\"` | `string` | Room type classification |\n * | `\"name\"` | `string` | Display name of the space |\n *\n * **Derived from parametric data:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"area\"` | `number` | Bottom face area (from `areas_bottomFace`) |\n * | `\"breadth\"` | `number` | Breadth dimension |\n * | `\"depth\"` | `number` | Depth dimension |\n * | `\"height\"` | `number` | Height dimension |\n * | `\"massType\"` | `string \\| null` | Mass type classification |\n * | `\"spaceType\"` | `string \\| null` | Space type classification (Room, Balcony, etc.) |\n * | `\"storey\"` | `number \\| null` | Story the space belongs to |\n * | `\"departmentId\"` | `string \\| null` | Assigned department ID |\n * | `\"departmentName\"` | `string` | Assigned department name |\n * | `\"departmentColor\"` | `string` | Assigned department color (hex/CSS) |\n *\n * **Derived from mesh:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"position\"` | {@linkcode PVec3} | Local position relative to parent |\n * | `\"absolutePosition\"` | {@linkcode PVec3} | Absolute position in the scene |\n * | `\"rotation\"` | {@linkcode PVec3} | Euler rotation angles (radians) |\n * | `\"rotationQuaternion\"` | {@linkcode PQuat} \\| `null` | Quaternion rotation, or `null` if unset |\n *\n * **Derived from brep:**\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"planPoints\"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |\n */\nexport const PluginSpaceGetProperty = z.enum([\n // Basic\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n // Derived from parametric data\n \"area\",\n \"breadth\",\n \"depth\",\n \"height\",\n \"massType\",\n \"spaceType\",\n \"storey\",\n \"departmentId\",\n \"departmentName\",\n \"departmentColor\",\n // Derived from mesh\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n // Derived from brep\n \"planPoints\",\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to query |\n * | `properties` | {@linkcode PluginSpaceGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\n/**\n * Supported space type values.\n *\n * Mirrors the internal `SpaceType` enum from `spaceType.types.ts`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Room\"` | Standard room |\n * | `\"Program Block\"` | Program/department block |\n * | `\"Balcony\"` | Balcony space |\n * | `\"Road\"` | Road |\n * | `\"Garden\"` | Garden area |\n * | `\"Deck\"` | Deck |\n * | `\"Pool\"` | Pool |\n * | `\"Walkway\"` | Walkway |\n * | `\"Parking\"` | Parking area |\n */\nexport const PluginSpaceType = z.enum([\n \"Room\",\n \"Program Block\",\n \"Balcony\",\n \"Road\",\n \"Garden\",\n \"Deck\",\n \"Pool\",\n \"Walkway\",\n \"Parking\"\n])\n\n/**\n * Result of {@linkcode PluginSpaceApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginSpaceGetArgs.properties} will be present.\n */\nexport const PluginSpaceGetResult = z\n .object({\n // Basic\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n // Derived from parametric data\n area: z.number(),\n breadth: z.number(),\n depth: z.number(),\n height: z.number(),\n massType: z.string().nullable(),\n spaceType: PluginSpaceType.nullable(),\n storey: z.number().nullable(),\n departmentId: z.string().nullable(),\n departmentName: z.string(),\n departmentColor: z.string(),\n // Derived from mesh\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n // Derived from brep\n planPoints: z.array(PVec3),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\n/**\n * Result of {@linkcode PluginSpaceApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spacesIds` | `string[]` | IDs of all spaces in the project |\n */\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to delete |\n */\nexport const PluginSpaceDeleteArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>\n\n/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */\nexport type PluginSpaceDeleteResult = void\n\n/**\n * Supported mass type values for {@linkcode PluginSpaceUpdateArgs.properties.massType}.\n *\n * Mirrors the internal `MASS_TYPES` enum.\n *\n * | Value | Description |\n * |---|---|\n * | `\"Plinth\"` | Plinth mass |\n * | `\"Void\"` | Void/cut-out |\n * | `\"Pergola\"` | Pergola structure |\n * | `\"Furniture\"` | Furniture element |\n * | `\"Facade element\"` | Facade element |\n * | `\"Generic mass\"` | Generic mass |\n * | `\"Room\"` | Room (default for spaces) |\n * | `\"Department\"` | Department block |\n * | `\"Building\"` | Building envelope |\n * | `\"Revit Import\"` | Imported from Revit |\n * | `\"Mass\"` | Generic mass type |\n * | `\"Site\"` | Site object |\n */\nexport const PluginMassType = z.enum([\n \"Plinth\",\n \"Void\",\n \"Pergola\",\n \"Furniture\",\n \"Facade element\",\n \"Generic mass\",\n \"Room\",\n \"Department\",\n \"Building\",\n \"Revit Import\",\n \"Mass\",\n \"Site\",\n])\n\n/**\n * Well-known (built-in) department IDs.\n *\n * | Value | Department |\n * |---|---|\n * | `\"DEFAULT\"` | Default department |\n * | `\"SITE\"` | Site department |\n * | `\"ENVELOPE\"` | Envelope department |\n * | `\"CORE\"` | Core department |\n */\nexport const PluginWellKnownDepartmentId = z.enum([\n \"DEFAULT\",\n \"SITE\",\n \"ENVELOPE\",\n \"CORE\",\n])\n\n/**\n * Accepted department ID values — either a {@linkcode PluginWellKnownDepartmentId}\n * or a UUID string for custom (user-created) departments.\n */\nexport const PluginDepartmentId = z.union([\n PluginWellKnownDepartmentId,\n z.uuid(),\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to update |\n * | `properties` | `object` | Key/value pairs of properties to update (all optional) |\n * | `properties.room_type` | `string?` | New room type label |\n * | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |\n * | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |\n */\nexport const PluginSpaceUpdateArgs = z.object({\n spaceId: z.string(),\n properties: z.object({\n room_type: z.string().optional(),\n massType: PluginMassType.optional(),\n spaceType: PluginSpaceType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n})\n\nexport type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.update}.\n *\n * Echoes back the `spaceId` and the values of properties that were updated.\n * Properties that were not included in the update request will be `undefined`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID that was updated |\n * | `room_type` | `string?` | Updated room type (if changed) |\n * | `massType` | `string?` | Updated mass type (if changed) |\n * | `spaceType` | `string?` | Updated space type (if changed) |\n * | `departmentId` | `string \\| null?` | Updated department ID (if changed) |\n */\nexport const PluginSpaceUpdateResult = z.object({\n spaceId: z.string(),\n room_type: z.string().optional(),\n massType: z.string().optional(),\n spaceType: z.string().optional(),\n departmentId: z.string().nullable().optional(),\n})\n\nexport type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Story (floor/storey) management.\n *\n * A story represents a building floor in the Snaptrude project. Stories\n * are identified by their integer **story value** (e.g. `1` for ground\n * floor, `2` for first floor, `-1` for a basement).\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.story`.\n */\nexport abstract class PluginStoryApi {\n constructor() {}\n\n /**\n * Get properties of a story by its storey number.\n *\n * Only the properties listed in {@linkcode PluginStoryGetArgs.properties args.properties}\n * are returned — unlisted properties will be `undefined` in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryGetArgs.storyValue args.storyValue} — Integer storey number\n * (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)\n * - {@linkcode PluginStoryGetArgs.properties args.properties} — Array of property names\n * to retrieve. See {@linkcode PluginStoryGetProperty} for available values.\n * @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties\n * @throws If the story with the given value does not exist\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.story.get({\n * storyValue: 1,\n * properties: [\"height\", \"name\", \"spacesCount\"],\n * })\n * console.log(info.name, info.height, info.spacesCount)\n * ```\n */\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n /**\n * Get all stories in the current project.\n *\n * Returns basic identification data for every storey. Stories are sorted\n * from **top to bottom** (highest story value first).\n *\n * @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,\n * each entry containing `value`, `id`, and `name`\n *\n * # Example\n * ```ts\n * const { stories } = await snaptrude.entity.story.getAll()\n * for (const s of stories) {\n * console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n /**\n * Create a new story (floor) in the project.\n *\n * The new story is inserted at the position specified by\n * {@linkcode PluginStoryCreateArgs.storyValue args.storyValue}. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryCreateArgs.storyValue args.storyValue} — Integer storey number\n * to create (e.g. `3` to add a third floor)\n * - {@linkcode PluginStoryCreateArgs.height args.height} — Optional height in Babylon\n * units. If omitted, the project's default storey height is used.\n * @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`\n * @throws If a story with the given value already exists or creation fails\n *\n * # Example\n * ```ts\n * // Create a new third floor with custom height\n * const { storyId } = await snaptrude.entity.story.create({\n * storyValue: 3,\n * height: 4.5,\n * })\n * ```\n */\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n /**\n * Update a story's height.\n *\n * Changes the floor-to-floor height of the specified story. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryUpdateArgs.storyValue args.storyValue} — Integer storey number\n * identifying the story to update\n * - {@linkcode PluginStoryUpdateArgs.height args.height} — New height value in Babylon\n * units\n * @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`\n * @throws If the story does not exist or the update fails\n *\n * # Example\n * ```ts\n * // Set ground floor height to 5 Babylon units\n * const result = await snaptrude.entity.story.update({\n * storyValue: 1,\n * height: 5,\n * })\n * ```\n */\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\n/**\n * Available properties that can be queried on a story.\n *\n * | Value | Type | Description |\n * |---|---|---|\n * | `\"value\"` | `number` | The integer storey number |\n * | `\"id\"` | `string` | Unique story identifier |\n * | `\"name\"` | `string` | Display name of the story |\n * | `\"height\"` | `number` | Floor-to-floor height in Babylon units |\n * | `\"base\"` | `number` | Base elevation in Babylon units |\n * | `\"hidden\"` | `boolean` | Whether the story is hidden in the viewport |\n * | `\"spacesCount\"` | `number` | Number of spaces on this story |\n * | `\"totalArea\"` | `number` | Total floor area of this story |\n */\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\n/**\n * Arguments for {@linkcode PluginStoryApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number to query |\n * | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginStoryGetArgs.properties} will be present.\n */\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\n/**\n * Result of {@linkcode PluginStoryApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |\n */\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number for the new story |\n * | `height` | `number?` | Optional height in Babylon units |\n */\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyId` | `string` | Unique ID of the created story |\n * | `storyValue` | `number` | The storey number of the created story |\n */\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | Storey number of the story to update |\n * | `height` | `number` | New height in Babylon units |\n */\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` | The storey number of the updated story |\n * | `height` | `number` | The new height after the update |\n */\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginDepartmentApi } from \"./department\"\nimport { PluginReferenceLineApi } from \"./referenceLine\"\nimport { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\n/**\n * CRUD operations on Snaptrude building entities.\n *\n * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)\n * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)\n * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines\n * - {@linkcode PluginEntityApi.department} — Create and query departments\n */\nexport abstract class PluginEntityApi {\n /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */\n public abstract space: PluginSpaceApi\n /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */\n public abstract story: PluginStoryApi\n /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */\n public abstract referenceLine: PluginReferenceLineApi\n /** Department operations. See {@linkcode PluginDepartmentApi}. */\n public abstract department: PluginDepartmentApi\n\n constructor() {}\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Query the current user selection in the Snaptrude editor.\n *\n * Accessed via `snaptrude.tools.selection`.\n */\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n /**\n * Get the IDs of all currently selected components.\n *\n * Returns the component IDs from the editor's active selection stack.\n * If nothing is selected, returns an empty array.\n *\n * The returned IDs can be used with {@linkcode PluginTransformApi.move},\n * {@linkcode PluginTransformApi.rotate}, or entity query methods like\n * {@linkcode PluginSpaceApi.get}.\n *\n * @returns A {@linkcode PluginSelectionGetResult} with a `selected` array\n * of component ID strings\n *\n * # Example\n * ```ts\n * const { selected } = await snaptrude.tools.selection.get()\n * if (selected.length > 0) {\n * // Move selected components 5 units along X\n * await snaptrude.tools.transform.move({\n * componentIds: selected,\n * displacement: snaptrude.core.math.vec3.new(5, 0, 0),\n * })\n * }\n * ```\n */\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\n/**\n * Result of {@linkcode PluginSelectionApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `selected` | `string[]` | Component IDs of the current selection |\n */\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Transform operations — move and rotate scene components.\n *\n * All transform methods accept an array of component IDs and apply the\n * transformation to each. Operations are recorded in Snaptrude's\n * command system for undo/redo support.\n *\n * Accessed via `snaptrude.tools.transform`.\n */\nexport abstract class PluginTransformApi {\n constructor() {}\n\n /**\n * Translate components by a displacement vector.\n *\n * Each component's position is offset by the given\n * {@linkcode PluginMoveArgs.displacement displacement} vector.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginMoveArgs.componentIds args.componentIds} — Array of component\n * ID strings to move\n * - {@linkcode PluginMoveArgs.displacement args.displacement} — Translation vector\n * as a {@linkcode PVec3} in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Move a space 10 units along the X axis\n * await snaptrude.tools.transform.move({\n * componentIds: [\"some-space-id\"],\n * displacement: vec3.new(10, 0, 0),\n * })\n * ```\n */\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n /**\n * Rotate components around an axis through a pivot point.\n *\n * Each component is rotated by {@linkcode PluginRotateArgs.angle angle}\n * radians around the {@linkcode PluginRotateArgs.axis axis} vector,\n * pivoting about the {@linkcode PluginRotateArgs.pivot pivot} point.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginRotateArgs.componentIds args.componentIds} — Array of component\n * ID strings to rotate\n * - {@linkcode PluginRotateArgs.angle args.angle} — Rotation angle in **radians**\n * - {@linkcode PluginRotateArgs.axis args.axis} — Rotation axis as a {@linkcode PVec3}\n * - {@linkcode PluginRotateArgs.pivot args.pivot} — Pivot point as a {@linkcode PVec3}\n * in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Rotate a space 45° around the Y axis at the origin\n * await snaptrude.tools.transform.rotate({\n * componentIds: [\"some-space-id\"],\n * angle: Math.PI / 4,\n * axis: vec3.new(0, 1, 0),\n * pivot: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\n/**\n * Arguments for {@linkcode PluginTransformApi.move}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to move |\n * | `displacement` | {@linkcode PVec3} | Translation vector in Babylon units |\n */\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\n/**\n * Arguments for {@linkcode PluginTransformApi.rotate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to rotate |\n * | `angle` | `number` | Rotation angle in radians |\n * | `axis` | {@linkcode PVec3} | Rotation axis direction |\n * | `pivot` | {@linkcode PVec3} | Pivot point in Babylon units |\n */\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\n/**\n * Snaptrude editor tools for querying and manipulating scene components.\n *\n * - {@linkcode PluginToolsApi.selection} — Query the current user selection\n * - {@linkcode PluginToolsApi.transform} — Move and rotate components\n */\nexport abstract class PluginToolsApi {\n /** Query the current selection. See {@linkcode PluginSelectionApi}. */\n public abstract selection: PluginSelectionApi\n /** Move and rotate components. See {@linkcode PluginTransformApi}. */\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Unit conversion between real-world units and Snaptrude's internal\n * (Babylon) coordinate system.\n *\n * Snaptrude uses an internal unit system (Babylon units) for all\n * coordinates and dimensions. Use these methods to convert between\n * real-world measurements and Babylon units.\n *\n * Accessed via `snaptrude.units`.\n */\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from a real-world unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertFromArgs.unit args.unit} — The source unit\n * to convert from. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric\n * value in the source unit\n * - {@linkcode PluginUnitsConvertFromArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted\n * `value` in Babylon units\n *\n * # Example\n * ```ts\n * // Convert 5 meters to Babylon units for use in API calls\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: snaptrude.core.math.vec3.new(0, 0, 0),\n * dimensions: { width: result.value, height: result.value, depth: result.value },\n * })\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to a real-world unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertToArgs.unit args.unit} — The target unit\n * to convert to. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric\n * value in Babylon units\n * - {@linkcode PluginUnitsConvertToArgs.degree args.degree} — (Optional)\n * Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1\n * @returns A {@linkcode PluginUnitsConvertToResult} containing the converted\n * `value` in the target unit\n *\n * # Example\n * ```ts\n * // Get a space's area in square meters\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-id\",\n * properties: [\"area\"],\n * })\n * const areaInMeters = await snaptrude.units.convertTo({\n * unit: \"meters\",\n * value: info.area!,\n * degree: 2,\n * })\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Source real-world unit |\n * | `value` | `number` | Numeric value in the source unit |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in Babylon units |\n */\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Target real-world unit |\n * | `value` | `number` | Numeric value in Babylon units |\n * | `degree` | `1 \\| 2 \\| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |\n */\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n degree: z.number().int().min(1).max(3).optional(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in the target unit |\n */\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\n/**\n * Root API surface for Snaptrude plugins.\n *\n * Access all plugin capabilities through the namespaced properties:\n *\n * - {@linkcode PluginApi.core} — Math and geometry primitives\n * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)\n * - {@linkcode PluginApi.tools} — Selection and transform tools\n * - {@linkcode PluginApi.units} — Unit conversion utilities\n */\nexport abstract class PluginApi {\n /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */\n public abstract core: PluginCoreApi\n /** Selection and transform tools. See {@linkcode PluginToolsApi}. */\n public abstract tools: PluginToolsApi\n /** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */\n public abstract entity: PluginEntityApi\n /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n"],"mappings":";AAAA,YAAY,OAAO;AAUZ,IAAe,gBAAf,MAA6B;AAAA,EAClC,cAAc;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBf,IAAI,GAAW,GAAWA,KAAkB;AAC1C,WAAO,EAAE,GAAG,GAAG,GAAAA,IAAE;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,GAAU,GAAiB;AAC7B,WAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG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E,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAClD,CAAC;AAWM,IAAM,6BAA+B,WAAO;AAAA,EACjD,OAAS,WAAO;AAClB,CAAC;;;ACjJM,IAAe,YAAf,MAAyB;AAAA,EAU9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
package/package.json
CHANGED
package/src/api/entity/space.ts
CHANGED
|
@@ -363,6 +363,7 @@ export type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>
|
|
|
363
363
|
* | `"Deck"` | Deck |
|
|
364
364
|
* | `"Pool"` | Pool |
|
|
365
365
|
* | `"Walkway"` | Walkway |
|
|
366
|
+
* | `"Parking"` | Parking area |
|
|
366
367
|
*/
|
|
367
368
|
export const PluginSpaceType = z.enum([
|
|
368
369
|
"Room",
|
|
@@ -373,6 +374,7 @@ export const PluginSpaceType = z.enum([
|
|
|
373
374
|
"Deck",
|
|
374
375
|
"Pool",
|
|
375
376
|
"Walkway",
|
|
377
|
+
"Parking"
|
|
376
378
|
])
|
|
377
379
|
|
|
378
380
|
/**
|