@snaptrude/plugin-core 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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/buildableEnvelope.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/copy.ts","../src/api/tools/offset.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 * Buildable Envelope management — create and update parametric zoning envelopes.\n *\n * A **buildable envelope** is the regulated volume inside which a building may\n * be massed. The host owns envelope identity: {@linkcode PluginBuildableEnvelopeApi.create create}\n * mints a `buildableEnvelopeId` and returns it; {@linkcode PluginBuildableEnvelopeApi.update update}\n * requires that id to target the existing envelope.\n *\n * Accessed via `snaptrude.entity.buildableEnvelope`.\n */\nexport abstract class PluginBuildableEnvelopeApi {\n constructor() {}\n\n /**\n * Create a new parametric buildable envelope.\n *\n * @param args - A {@linkcode PluginBuildableEnvelopeCreateArgs} object.\n * @returns A {@linkcode PluginBuildableEnvelopeCreateResult} with the\n * `buildableEnvelopeId` of the created envelope.\n * @throws If validation fails or generation produces no renderable geometry.\n *\n * # Example\n * ```ts\n * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.create({\n * sitePolygon: [\n * { x: 0, z: 0 },\n * { x: 100, z: 0 },\n * { x: 100, z: 80 },\n * { x: 0, z: 80 },\n * ],\n * lengthUnit: \"ft\",\n * setbacks: [\n * { aboveHeight: 0, front: 10, side: 5, rear: 10 },\n * { aboveHeight: 100, front: 20, side: 10, rear: 20 },\n * ],\n * verticalCap: { kind: \"max_height\", maxHeight: 150 },\n * floorToFloor: 12,\n * })\n * ```\n */\n public abstract create(\n args: PluginBuildableEnvelopeCreateArgs\n ): PluginApiReturn<PluginBuildableEnvelopeCreateResult>\n\n /**\n * Update an existing parametric buildable envelope.\n *\n * @param args - A {@linkcode PluginBuildableEnvelopeUpdateArgs} object.\n * `buildableEnvelopeId` is required and must match an existing envelope on\n * the canvas.\n * @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the\n * `buildableEnvelopeId` of the updated envelope.\n * @throws If validation fails, the envelope does not exist, or generation\n * produces no renderable geometry.\n *\n * # Example\n * ```ts\n * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.update({\n * buildableEnvelopeId: existingId,\n * sitePolygon: [\n * { x: 0, z: 0 },\n * { x: 100, z: 0 },\n * { x: 100, z: 80 },\n * { x: 0, z: 80 },\n * ],\n * lengthUnit: \"ft\",\n * setbacks: [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],\n * verticalCap: { kind: \"max_height\", maxHeight: 175 },\n * floorToFloor: 12,\n * })\n * ```\n */\n public abstract update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): PluginApiReturn<PluginBuildableEnvelopeUpdateResult>\n}\n\n/**\n * Site polygon vertex in the request `lengthUnit`.\n *\n * Vertices may be passed as `{x, z}` objects or `[x, z]` tuples. Numeric\n * values must be finite (no `NaN` or `±Infinity`).\n */\nexport const PluginBuildableEnvelopePolygonVertex = z.union([\n z.object({ x: z.number().finite(), z: z.number().finite() }).strict(),\n z.tuple([z.number().finite(), z.number().finite()]),\n])\n\nexport type PluginBuildableEnvelopePolygonVertex = z.infer<\n typeof PluginBuildableEnvelopePolygonVertex\n>\n\n/**\n * Vertical cap for a buildable envelope.\n *\n * Use exactly one shape:\n * - `{ kind: \"max_height\", maxHeight }`\n * - `{ kind: \"max_floors\", maxFloors }`\n *\n * Floor-to-floor height is not nested here; it is always supplied as the\n * top-level `floorToFloor` argument.\n */\nexport const PluginBuildableEnvelopeVerticalCap = z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"max_height\"),\n maxHeight: z.number().finite().positive(),\n }).strict(),\n z.object({\n kind: z.literal(\"max_floors\"),\n maxFloors: z.number().finite().int().positive(),\n }).strict(),\n])\n\nexport type PluginBuildableEnvelopeVerticalCap = z.infer<\n typeof PluginBuildableEnvelopeVerticalCap\n>\n\n/**\n * One tier of a buildable envelope's setback profile.\n *\n * Tiers are ordered by `aboveHeight`. The first tier (index 0) must have\n * `aboveHeight: 0` and describes the ground footprint; each subsequent tier\n * describes the complete setback at a strictly greater height. Each tier\n * carries its own `front`, `side`, and `rear` values — there is no\n * inheritance from earlier tiers.\n *\n * All numeric values must be finite and nonnegative, in the request\n * `lengthUnit`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `aboveHeight` | `number` | Height at or above which this tier applies; the ground tier uses `0` |\n * | `front` | `number` | Front setback for this tier |\n * | `side` | `number` | Side setback for this tier |\n * | `rear` | `number` | Rear setback for this tier |\n */\nexport const PluginBuildableEnvelopeSetbackTier = z.object({\n aboveHeight: z.number().finite().nonnegative(),\n front: z.number().finite().nonnegative(),\n side: z.number().finite().nonnegative(),\n rear: z.number().finite().nonnegative(),\n}).strict()\n\nexport type PluginBuildableEnvelopeSetbackTier = z.infer<\n typeof PluginBuildableEnvelopeSetbackTier\n>\n\n// Enforces setback tier ordering invariants on the parsed args shape:\n// - setbacks[0].aboveHeight === 0\n// - aboveHeight strictly increasing thereafter\n// Length >= 1 is enforced earlier by z.array(...).min(1).\nfunction refineSetbackTiers(\n args: { setbacks: PluginBuildableEnvelopeSetbackTier[] },\n ctx: z.RefinementCtx\n): void {\n const tiers = args.setbacks\n if (tiers.length === 0) return\n if (tiers[0].aboveHeight !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"setbacks\", 0, \"aboveHeight\"],\n message: \"Ground tier required: setbacks[0].aboveHeight must be 0.\",\n })\n }\n for (let i = 1; i < tiers.length; i++) {\n if (!(tiers[i].aboveHeight > tiers[i - 1].aboveHeight)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"setbacks\", i, \"aboveHeight\"],\n message:\n \"Setback tiers must be ordered by strictly increasing aboveHeight.\",\n })\n }\n }\n}\n\n/**\n * Arguments for {@linkcode PluginBuildableEnvelopeApi.create}.\n *\n * Strict schema. The host owns identity — no `buildableEnvelopeId` is accepted\n * on create; the id is minted by the host and returned in\n * {@linkcode PluginBuildableEnvelopeCreateResult}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |\n * | `lengthUnit` | `\"ft\" \\| \"m\"` | Unit used by all length fields |\n * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |\n * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |\n * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |\n * | `farRatio` | `number?` | Optional FAR value, positive when provided |\n * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |\n */\nexport const PluginBuildableEnvelopeCreateArgs = z\n .object({\n sitePolygon: z.array(PluginBuildableEnvelopePolygonVertex).min(3),\n lengthUnit: z.union([z.literal(\"ft\"), z.literal(\"m\")]),\n setbacks: z.array(PluginBuildableEnvelopeSetbackTier).min(1),\n verticalCap: PluginBuildableEnvelopeVerticalCap,\n floorToFloor: z.number().finite().positive(),\n farRatio: z.number().finite().positive().optional(),\n lotCoverageMaxPct: z.number().finite().min(0).max(100).optional(),\n })\n .strict()\n .superRefine(refineSetbackTiers)\n\nexport type PluginBuildableEnvelopeCreateArgs = z.infer<\n typeof PluginBuildableEnvelopeCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginBuildableEnvelopeApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the created buildable envelope |\n */\nexport const PluginBuildableEnvelopeCreateResult = z.object({\n buildableEnvelopeId: z.string().min(1),\n}).strict()\n\nexport type PluginBuildableEnvelopeCreateResult = z.infer<\n typeof PluginBuildableEnvelopeCreateResult\n>\n\n/**\n * Arguments for {@linkcode PluginBuildableEnvelopeApi.update}.\n *\n * Strict schema. `buildableEnvelopeId` is required and identifies the prior\n * envelope on the canvas to update.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Existing envelope ID to update; non-empty |\n * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |\n * | `lengthUnit` | `\"ft\" \\| \"m\"` | Unit used by all length fields |\n * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |\n * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |\n * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |\n * | `farRatio` | `number?` | Optional FAR value, positive when provided |\n * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |\n */\nexport const PluginBuildableEnvelopeUpdateArgs = z\n .object({\n buildableEnvelopeId: z.string().min(1),\n sitePolygon: z.array(PluginBuildableEnvelopePolygonVertex).min(3),\n lengthUnit: z.union([z.literal(\"ft\"), z.literal(\"m\")]),\n setbacks: z.array(PluginBuildableEnvelopeSetbackTier).min(1),\n verticalCap: PluginBuildableEnvelopeVerticalCap,\n floorToFloor: z.number().finite().positive(),\n farRatio: z.number().finite().positive().optional(),\n lotCoverageMaxPct: z.number().finite().min(0).max(100).optional(),\n })\n .strict()\n .superRefine(refineSetbackTiers)\n\nexport type PluginBuildableEnvelopeUpdateArgs = z.infer<\n typeof PluginBuildableEnvelopeUpdateArgs\n>\n\n/**\n * Result of {@linkcode PluginBuildableEnvelopeApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the updated buildable envelope |\n */\nexport const PluginBuildableEnvelopeUpdateResult = z.object({\n buildableEnvelopeId: z.string().min(1),\n}).strict()\n\nexport type PluginBuildableEnvelopeUpdateResult = z.infer<\n typeof PluginBuildableEnvelopeUpdateResult\n>\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, update, 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 used as\n * the outer boundary and extruded upward (along the Y axis) by\n * {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight extrudeHeight},\n * then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. Optional {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles\n * innerProfiles} are used as holes inside the outer boundary. The created\n * space is automatically assigned to the active story 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 outer floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles args.innerProfiles} —\n * Optional closed {@linkcode PProfile}`[]` loops to subtract as holes\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 outerProfile = 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 * const holeProfile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(3, 0, 3),\n * vec3.new(7, 0, 3),\n * vec3.new(7, 0, 5),\n * vec3.new(3, 0, 5),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile: outerProfile,\n * innerProfiles: [holeProfile],\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Update a space's BRep and mesh geometry by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile profile} is\n * extruded upward (along the Y axis) by\n * {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight extrudeHeight}\n * and applied to the existing space. The space keeps the same `spaceId`,\n * metadata, department, and transform; only its geometry is replaced.\n *\n * Profile points are interpreted in scene coordinates. Profiles returned by\n * {@linkcode PluginSpaceApi.get} with `\"profile\"` can be passed back directly;\n * `\"planPoints\"` can be used to construct line-only profiles in the same X/Z\n * plan coordinate space.\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 PluginSpaceUpdateGeometryFromProfileArgs.spaceId args.spaceId} —\n * The unique space ID to update\n * - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile args.profile} —\n * A closed {@linkcode PProfile} defining the new floor shape\n * - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight\n * args.extrudeHeight} — New extrusion height in Babylon units\n * @returns A {@linkcode PluginSpaceUpdateGeometryFromProfileResult} with the\n * `spaceId` of the updated space\n * @throws If the space does not exist, the component is not a space/mass, the\n * height is not positive, or the profile cannot create valid geometry\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(12, 0, 0),\n * vec3.new(12, 0, 6),\n * vec3.new(0, 0, 6),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.updateGeometryFromProfile({\n * spaceId: \"some-space-id\",\n * profile,\n * extrudeHeight: 4,\n * })\n * ```\n */\n public abstract updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): PluginApiReturn<PluginSpaceUpdateGeometryFromProfileResult>\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 outer floor shape |\n * | `innerProfiles` | {@linkcode PProfile}`[]` | Optional closed profiles to subtract as holes |\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 innerProfiles: z.array(PProfile).optional(),\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 * Arguments for {@linkcode PluginSpaceApi.updateGeometryFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Space to update |\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the new floor shape |\n * | `extrudeHeight` | `number` | New extrusion height in Babylon units |\n */\nexport const PluginSpaceUpdateGeometryFromProfileArgs = z.object({\n spaceId: z.string(),\n profile: PProfile,\n extrudeHeight: z.number(),\n})\n\nexport type PluginSpaceUpdateGeometryFromProfileArgs = z.infer<\n typeof PluginSpaceUpdateGeometryFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.updateGeometryFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the updated space |\n */\nexport const PluginSpaceUpdateGeometryFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceUpdateGeometryFromProfileResult = z.infer<\n typeof PluginSpaceUpdateGeometryFromProfileResult\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 * | `\"profile\"` | {@linkcode PProfile} | Bottom outer profile in world space, preserving line/arc curve data. |\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 \"profile\",\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 * | `\"Envelope\"` | Envelope |\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 \"Envelope\",\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 profile: PProfile,\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 { PluginBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { 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 * - {@linkcode PluginEntityApi.buildableEnvelope} — Create or update parametric buildable envelopes\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 /** Buildable Envelope operations. See {@linkcode PluginBuildableEnvelopeApi}. */\n public abstract buildableEnvelope: PluginBuildableEnvelopeApi\n\n constructor() {}\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport type { ComponentId } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Copy mode for `snaptrude.tools.copy`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"instance\"` | Create instanced copies where possible |\n * | `\"unique\"` | Create independent geometry copies |\n */\nexport const PluginCopyMode = z.enum([\"instance\", \"unique\"])\n\nexport type PluginCopyMode = z.infer<typeof PluginCopyMode>\n\n/**\n * Arguments for `snaptrude.tools.copy`.\n *\n * Creates one or more copies for each component in `componentIds`. Copy `i` is\n * offset by `displacement * i`, where `i` starts at `1`. Source positions are\n * preserved. In `\"instance\"` mode, a unique source mesh can be replaced by an\n * instance at the same position so the source and copied objects remain in the\n * same instance family. The created copy stack becomes the active editor\n * selection, matching the native paste workflow.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to copy |\n * | `displacement` | {@linkcode PVec3} | Offset applied to each copy in Babylon units |\n * | `count` | `number` | Number of copies per component. Defaults to `1` |\n * | `copyMode` | {@linkcode PluginCopyMode} | `\"instance\"` or `\"unique\"`. Defaults to `\"instance\"` |\n */\nexport const PluginCopyArgs = z.object({\n componentIds: z.array(z.string()).min(1),\n displacement: PVec3,\n count: z.number().int().positive().optional(),\n copyMode: PluginCopyMode.optional(),\n})\n\nexport type PluginCopyArgs = z.infer<typeof PluginCopyArgs>\n\n/**\n * Result of `snaptrude.tools.copy`.\n *\n * Returned IDs are Snaptrude component IDs for the newly created copies, not\n * Babylon mesh IDs.\n */\nexport const PluginCopyResult = z.object({\n copiedIds: z.array(z.string()),\n})\n\nexport type PluginCopyResult = {\n copiedIds: ComponentId[]\n}\n","import * as z from \"zod\"\nimport type { ComponentId } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Arguments for `snaptrude.tools.offset`.\n *\n * Runs Snaptrude's offset/split operation on the top profile of a scene\n * component. A positive distance offsets outward from the selected profile;\n * a negative distance offsets inward. If `profilePickPoint` is omitted, the\n * outer top profile is used. If `profilePickPoint` is provided, the nearest top\n * contour profile to that point is used, matching the interactive offset tool's\n * pick behavior.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentId` | `string` | Component ID to offset |\n * | `distance` | `number` | Signed offset distance in Snaptrude units |\n * | `profilePickPoint` | {@linkcode PVec3} | Optional point used to choose a top contour profile |\n */\nexport const PluginOffsetArgs = z.object({\n componentId: z.string().min(1),\n distance: z.number(),\n profilePickPoint: PVec3.optional(),\n})\n\nexport type PluginOffsetArgs = z.infer<typeof PluginOffsetArgs>\n\n/**\n * Result of `snaptrude.tools.offset`.\n *\n * `createdIds` are the components created by the offset operation. `deletedIds`\n * are components removed by split-style offsets.\n */\nexport const PluginOffsetResult = z.object({\n createdIds: z.array(z.string()),\n deletedIds: z.array(z.string()),\n})\n\nexport type PluginOffsetResult = {\n createdIds: ComponentId[]\n deletedIds: ComponentId[]\n}\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\"\nimport type { PluginApiReturn } from \"../../types\"\nimport type { PluginCopyArgs, PluginCopyResult } from \"./copy\"\nimport type { PluginOffsetArgs, PluginOffsetResult } from \"./offset\"\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 * - {@linkcode PluginToolsApi.copy} — Copy components\n * - {@linkcode PluginToolsApi.offset} — Offset or split component profiles\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 /** Copy components by ID. See {@linkcode PluginCopyArgs}. */\n public abstract copy(args: PluginCopyArgs): PluginApiReturn<PluginCopyResult>\n\n /** Offset or split a component profile. See {@linkcode PluginOffsetArgs}. */\n public abstract offset(\n args: PluginOffsetArgs,\n ): PluginApiReturn<PluginOffsetResult>\n\n constructor() {}\n}\n\nexport * from \"./copy\"\nexport * from \"./offset\"\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} — Copy, offset, 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 /** Copy, offset, 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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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","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/buildableEnvelope.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/copy.ts","../src/api/tools/offset.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 * Buildable Envelope management — create and update parametric zoning envelopes.\n *\n * A **buildable envelope** is the regulated volume inside which a building may\n * be massed. The host owns envelope identity: {@linkcode PluginBuildableEnvelopeApi.create create}\n * mints a `buildableEnvelopeId` and returns it; {@linkcode PluginBuildableEnvelopeApi.update update}\n * requires that id to target the existing envelope.\n *\n * Accessed via `snaptrude.entity.buildableEnvelope`.\n */\nexport abstract class PluginBuildableEnvelopeApi {\n constructor() {}\n\n /**\n * Create a new parametric buildable envelope.\n *\n * @param args - A {@linkcode PluginBuildableEnvelopeCreateArgs} object.\n * @returns A {@linkcode PluginBuildableEnvelopeCreateResult} with the\n * `buildableEnvelopeId` of the created envelope.\n * @throws If validation fails or generation produces no renderable geometry.\n *\n * # Example\n * ```ts\n * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.create({\n * sitePolygon: [\n * { x: 0, z: 0 },\n * { x: 100, z: 0 },\n * { x: 100, z: 80 },\n * { x: 0, z: 80 },\n * ],\n * lengthUnit: \"ft\",\n * setbacks: [\n * { aboveHeight: 0, front: 10, side: 5, rear: 10 },\n * { aboveHeight: 100, front: 20, side: 10, rear: 20 },\n * ],\n * verticalCap: { kind: \"max_height\", maxHeight: 150 },\n * floorToFloor: 12,\n * })\n * ```\n */\n public abstract create(\n args: PluginBuildableEnvelopeCreateArgs\n ): PluginApiReturn<PluginBuildableEnvelopeCreateResult>\n\n /**\n * Update an existing parametric buildable envelope.\n *\n * @param args - A {@linkcode PluginBuildableEnvelopeUpdateArgs} object.\n * `buildableEnvelopeId` is required and must match an existing envelope on\n * the canvas.\n * @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the\n * `buildableEnvelopeId` of the updated envelope.\n * @throws If validation fails, the envelope does not exist, or generation\n * produces no renderable geometry.\n *\n * # Example\n * ```ts\n * const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.update({\n * buildableEnvelopeId: existingId,\n * sitePolygon: [\n * { x: 0, z: 0 },\n * { x: 100, z: 0 },\n * { x: 100, z: 80 },\n * { x: 0, z: 80 },\n * ],\n * lengthUnit: \"ft\",\n * setbacks: [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],\n * verticalCap: { kind: \"max_height\", maxHeight: 175 },\n * floorToFloor: 12,\n * })\n * ```\n */\n public abstract update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): PluginApiReturn<PluginBuildableEnvelopeUpdateResult>\n}\n\n/**\n * Site polygon vertex in the request `lengthUnit`.\n *\n * Vertices may be passed as `{x, z}` objects or `[x, z]` tuples. Numeric\n * values must be finite (no `NaN` or `±Infinity`).\n */\nexport const PluginBuildableEnvelopePolygonVertex = z.union([\n z.object({ x: z.number().finite(), z: z.number().finite() }).strict(),\n z.tuple([z.number().finite(), z.number().finite()]),\n])\n\nexport type PluginBuildableEnvelopePolygonVertex = z.infer<\n typeof PluginBuildableEnvelopePolygonVertex\n>\n\n/**\n * Vertical cap for a buildable envelope.\n *\n * Use exactly one shape:\n * - `{ kind: \"max_height\", maxHeight }`\n * - `{ kind: \"max_floors\", maxFloors }`\n *\n * Floor-to-floor height is not nested here; it is always supplied as the\n * top-level `floorToFloor` argument.\n */\nexport const PluginBuildableEnvelopeVerticalCap = z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"max_height\"),\n maxHeight: z.number().finite().positive(),\n }).strict(),\n z.object({\n kind: z.literal(\"max_floors\"),\n maxFloors: z.number().finite().int().positive(),\n }).strict(),\n])\n\nexport type PluginBuildableEnvelopeVerticalCap = z.infer<\n typeof PluginBuildableEnvelopeVerticalCap\n>\n\n/**\n * One tier of a buildable envelope's setback profile.\n *\n * Tiers are ordered by `aboveHeight`. The first tier (index 0) must have\n * `aboveHeight: 0` and describes the ground footprint; each subsequent tier\n * describes the complete setback at a strictly greater height. Each tier\n * carries its own `front`, `side`, and `rear` values — there is no\n * inheritance from earlier tiers.\n *\n * All numeric values must be finite and nonnegative, in the request\n * `lengthUnit`.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `aboveHeight` | `number` | Height at or above which this tier applies; the ground tier uses `0` |\n * | `front` | `number` | Front setback for this tier |\n * | `side` | `number` | Side setback for this tier |\n * | `rear` | `number` | Rear setback for this tier |\n */\nexport const PluginBuildableEnvelopeSetbackTier = z.object({\n aboveHeight: z.number().finite().nonnegative(),\n front: z.number().finite().nonnegative(),\n side: z.number().finite().nonnegative(),\n rear: z.number().finite().nonnegative(),\n}).strict()\n\nexport type PluginBuildableEnvelopeSetbackTier = z.infer<\n typeof PluginBuildableEnvelopeSetbackTier\n>\n\n// Enforces setback tier ordering invariants on the parsed args shape:\n// - setbacks[0].aboveHeight === 0\n// - aboveHeight strictly increasing thereafter\n// Length >= 1 is enforced earlier by z.array(...).min(1).\nfunction refineSetbackTiers(\n args: { setbacks: PluginBuildableEnvelopeSetbackTier[] },\n ctx: z.RefinementCtx\n): void {\n const tiers = args.setbacks\n if (tiers.length === 0) return\n if (tiers[0].aboveHeight !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"setbacks\", 0, \"aboveHeight\"],\n message: \"Ground tier required: setbacks[0].aboveHeight must be 0.\",\n })\n }\n for (let i = 1; i < tiers.length; i++) {\n if (!(tiers[i].aboveHeight > tiers[i - 1].aboveHeight)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"setbacks\", i, \"aboveHeight\"],\n message:\n \"Setback tiers must be ordered by strictly increasing aboveHeight.\",\n })\n }\n }\n}\n\n/**\n * Arguments for {@linkcode PluginBuildableEnvelopeApi.create}.\n *\n * Strict schema. The host owns identity — no `buildableEnvelopeId` is accepted\n * on create; the id is minted by the host and returned in\n * {@linkcode PluginBuildableEnvelopeCreateResult}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |\n * | `lengthUnit` | `\"ft\" \\| \"m\"` | Unit used by all length fields |\n * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |\n * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |\n * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |\n * | `farRatio` | `number?` | Optional FAR value, positive when provided |\n * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |\n */\nexport const PluginBuildableEnvelopeCreateArgs = z\n .object({\n sitePolygon: z.array(PluginBuildableEnvelopePolygonVertex).min(3),\n lengthUnit: z.union([z.literal(\"ft\"), z.literal(\"m\")]),\n setbacks: z.array(PluginBuildableEnvelopeSetbackTier).min(1),\n verticalCap: PluginBuildableEnvelopeVerticalCap,\n floorToFloor: z.number().finite().positive(),\n farRatio: z.number().finite().positive().optional(),\n lotCoverageMaxPct: z.number().finite().min(0).max(100).optional(),\n })\n .strict()\n .superRefine(refineSetbackTiers)\n\nexport type PluginBuildableEnvelopeCreateArgs = z.infer<\n typeof PluginBuildableEnvelopeCreateArgs\n>\n\n/**\n * Result of {@linkcode PluginBuildableEnvelopeApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the created buildable envelope |\n */\nexport const PluginBuildableEnvelopeCreateResult = z.object({\n buildableEnvelopeId: z.string().min(1),\n}).strict()\n\nexport type PluginBuildableEnvelopeCreateResult = z.infer<\n typeof PluginBuildableEnvelopeCreateResult\n>\n\n/**\n * Arguments for {@linkcode PluginBuildableEnvelopeApi.update}.\n *\n * Strict schema. `buildableEnvelopeId` is required and identifies the prior\n * envelope on the canvas to update.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Existing envelope ID to update; non-empty |\n * | `sitePolygon` | {@linkcode PluginBuildableEnvelopePolygonVertex}`[]` | Site polygon vertices in `lengthUnit`; minimum 3 vertices |\n * | `lengthUnit` | `\"ft\" \\| \"m\"` | Unit used by all length fields |\n * | `setbacks` | {@linkcode PluginBuildableEnvelopeSetbackTier}`[]` | Setback profile, ground tier first; minimum 1 tier |\n * | `verticalCap` | {@linkcode PluginBuildableEnvelopeVerticalCap} | Maximum height or floor count |\n * | `floorToFloor` | `number` | Required floor-to-floor height in `lengthUnit` |\n * | `farRatio` | `number?` | Optional FAR value, positive when provided |\n * | `lotCoverageMaxPct` | `number?` | Optional lot coverage cap, `0..100` |\n */\nexport const PluginBuildableEnvelopeUpdateArgs = z\n .object({\n buildableEnvelopeId: z.string().min(1),\n sitePolygon: z.array(PluginBuildableEnvelopePolygonVertex).min(3),\n lengthUnit: z.union([z.literal(\"ft\"), z.literal(\"m\")]),\n setbacks: z.array(PluginBuildableEnvelopeSetbackTier).min(1),\n verticalCap: PluginBuildableEnvelopeVerticalCap,\n floorToFloor: z.number().finite().positive(),\n farRatio: z.number().finite().positive().optional(),\n lotCoverageMaxPct: z.number().finite().min(0).max(100).optional(),\n })\n .strict()\n .superRefine(refineSetbackTiers)\n\nexport type PluginBuildableEnvelopeUpdateArgs = z.infer<\n typeof PluginBuildableEnvelopeUpdateArgs\n>\n\n/**\n * Result of {@linkcode PluginBuildableEnvelopeApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `buildableEnvelopeId` | `string` | Non-empty unique ID of the updated buildable envelope |\n */\nexport const PluginBuildableEnvelopeUpdateResult = z.object({\n buildableEnvelopeId: z.string().min(1),\n}).strict()\n\nexport type PluginBuildableEnvelopeUpdateResult = z.infer<\n typeof PluginBuildableEnvelopeUpdateResult\n>\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, update, 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 used as\n * the outer boundary and extruded upward (along the Y axis) by\n * {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight extrudeHeight},\n * then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. Optional {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles\n * innerProfiles} are used as holes inside the outer boundary. The created\n * space is automatically assigned to the active story 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 outer floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles args.innerProfiles} —\n * Optional closed {@linkcode PProfile}`[]` loops to subtract as holes\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 outerProfile = 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 * const holeProfile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(3, 0, 3),\n * vec3.new(7, 0, 3),\n * vec3.new(7, 0, 5),\n * vec3.new(3, 0, 5),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile: outerProfile,\n * innerProfiles: [holeProfile],\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Update a space's BRep and mesh geometry by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile profile} is\n * extruded upward (along the Y axis) by\n * {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight extrudeHeight}\n * and applied to the existing space. The space keeps the same `spaceId`,\n * metadata, department, and transform; only its geometry is replaced.\n *\n * Profile points are interpreted in scene coordinates. Profiles returned by\n * {@linkcode PluginSpaceApi.get} with `\"profile\"` can be passed back directly;\n * `\"planPoints\"` can be used to construct line-only profiles in the same X/Z\n * plan coordinate space.\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 PluginSpaceUpdateGeometryFromProfileArgs.spaceId args.spaceId} —\n * The unique space ID to update\n * - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile args.profile} —\n * A closed {@linkcode PProfile} defining the new floor shape\n * - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight\n * args.extrudeHeight} — New extrusion height in Babylon units\n * @returns A {@linkcode PluginSpaceUpdateGeometryFromProfileResult} with the\n * `spaceId` of the updated space\n * @throws If the space does not exist, the component is not a space/mass, the\n * height is not positive, or the profile cannot create valid geometry\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(12, 0, 0),\n * vec3.new(12, 0, 6),\n * vec3.new(0, 0, 6),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.updateGeometryFromProfile({\n * spaceId: \"some-space-id\",\n * profile,\n * extrudeHeight: 4,\n * })\n * ```\n */\n public abstract updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): PluginApiReturn<PluginSpaceUpdateGeometryFromProfileResult>\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 * Create many spaces in a single undoable operation.\n *\n * Each item is either a rectangular box (`kind: \"rectangular\"`) or an\n * extruded profile (`kind: \"profile\"`), and may optionally set `room_type`,\n * `spaceType`, `massType`, and `departmentId`. All creations — and the\n * optional property assignments — are batched into **one** command, so the\n * entire batch is undone/redone in a single step.\n *\n * All items are validated first; if any item is invalid the call **throws**\n * and no spaces are created (nothing is applied) — consistent with the\n * single-item create methods.\n *\n * @param args - {@linkcode PluginSpaceBulkCreateArgs} with an `items` array\n * @returns A {@linkcode PluginSpaceBulkCreateResult} with the `spaceIds` of\n * the created spaces, in input order\n * @throws If any item has invalid dimensions, height, or profile\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceIds } = await snaptrude.entity.space.bulkCreate({\n * items: [\n * {\n * kind: \"rectangular\",\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * spaceType: \"Room\",\n * departmentId: \"CORE\",\n * },\n * {\n * kind: \"profile\",\n * profile: await snaptrude.core.geom.profile.fromLinePoints({\n * points: [vec3.new(0, 0, 0), vec3.new(8, 0, 0), vec3.new(8, 0, 6), vec3.new(0, 0, 6)],\n * }),\n * extrudeHeight: 3,\n * position: vec3.new(10, 0, 0),\n * massType: \"Room\",\n * },\n * ],\n * })\n * ```\n */\n public abstract bulkCreate(\n args: PluginSpaceBulkCreateArgs,\n ): PluginApiReturn<PluginSpaceBulkCreateResult>\n\n /**\n * Update many existing spaces in a single undoable operation.\n *\n * Each item targets an existing space by `spaceId` and may change its\n * geometry (`profile` + `extrudeHeight`, which must be supplied together) and/or\n * its `properties` (`room_type`, `massType`, `spaceType`, `departmentId` —\n * nested under `properties`, mirroring {@linkcode PluginSpaceApi.update}). All\n * changes are batched into **one** command, so the entire batch is\n * undone/redone in a single step.\n *\n * All items are validated first; if any item is invalid — an unknown\n * `spaceId`, a non-positive height, or supplying only one of\n * `profile`/`extrudeHeight` — the call **throws** and no changes are applied.\n *\n * @param args - {@linkcode PluginSpaceBulkUpdateArgs} with an `items` array\n * @returns A {@linkcode PluginSpaceBulkUpdateResult} echoing one\n * {@linkcode PluginSpaceUpdateResult} per item in `spaces`, in input order\n * @throws If any item targets an unknown space, has a non-positive height, or\n * supplies only one of `profile`/`extrudeHeight`\n *\n * # Example\n * ```ts\n * const { spaces } = await snaptrude.entity.space.bulkUpdate({\n * items: [\n * { spaceId: \"space-a\", properties: { room_type: \"Kitchen\", spaceType: \"Room\" } },\n * { spaceId: \"space-b\", profile, extrudeHeight: 4 },\n * ],\n * })\n * ```\n */\n public abstract bulkUpdate(\n args: PluginSpaceBulkUpdateArgs,\n ): PluginApiReturn<PluginSpaceBulkUpdateResult>\n\n /**\n * Delete many spaces in a single undoable operation.\n *\n * All deletions are batched into **one** command, so the entire batch is\n * undone/redone in a single step.\n *\n * All IDs are validated first; if any ID is unknown or is not a space the\n * call **throws** and no spaces are deleted — consistent with the single-item\n * {@linkcode PluginSpaceApi.delete}.\n *\n * @param args - {@linkcode PluginSpaceBulkDeleteArgs} with a `spaceIds` array\n * @returns A {@linkcode PluginSpaceBulkDeleteResult} with `deletedSpaceIds`\n * (the removed IDs, in input order)\n * @throws If any ID does not resolve to an existing space\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.bulkDelete({ spaceIds: [\"space-a\", \"space-b\"] })\n * ```\n */\n public abstract bulkDelete(\n args: PluginSpaceBulkDeleteArgs,\n ): PluginApiReturn<PluginSpaceBulkDeleteResult>\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 outer floor shape |\n * | `innerProfiles` | {@linkcode PProfile}`[]` | Optional closed profiles to subtract as holes |\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 innerProfiles: z.array(PProfile).optional(),\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 * Arguments for {@linkcode PluginSpaceApi.updateGeometryFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Space to update |\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the new floor shape |\n * | `extrudeHeight` | `number` | New extrusion height in Babylon units |\n */\nexport const PluginSpaceUpdateGeometryFromProfileArgs = z.object({\n spaceId: z.string(),\n profile: PProfile,\n extrudeHeight: z.number(),\n})\n\nexport type PluginSpaceUpdateGeometryFromProfileArgs = z.infer<\n typeof PluginSpaceUpdateGeometryFromProfileArgs\n>\n\n/**\n * Result of {@linkcode PluginSpaceApi.updateGeometryFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the updated space |\n */\nexport const PluginSpaceUpdateGeometryFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceUpdateGeometryFromProfileResult = z.infer<\n typeof PluginSpaceUpdateGeometryFromProfileResult\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 * | `\"profile\"` | {@linkcode PProfile} | Bottom outer profile in world space, preserving line/arc curve data. |\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 \"profile\",\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 * | `\"Envelope\"` | Envelope |\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 \"Envelope\",\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 profile: PProfile,\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\n// ---------------------------------------------------------------------------\n// Bulk operations\n// ---------------------------------------------------------------------------\n\n/**\n * A single item for {@linkcode PluginSpaceApi.bulkCreate}.\n *\n * Discriminated on `kind`:\n * - `\"rectangular\"` — a box defined by `position` + `dimensions` (mirrors\n * {@linkcode PluginSpaceCreateRectangularArgs})\n * - `\"profile\"` — an extruded `profile` (with optional `innerProfiles`) by\n * `extrudeHeight` at `position` (mirrors {@linkcode PluginSpaceCreateFromProfileArgs})\n *\n * Every item may optionally set `room_type`, `spaceType`, `massType`, and\n * `departmentId`; these are applied within the same single undo step as the\n * creation.\n */\nexport const PluginSpaceBulkCreateItem = z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"rectangular\"),\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n room_type: z.string().optional(),\n spaceType: PluginSpaceType.optional(),\n massType: PluginMassType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n z.object({\n kind: z.literal(\"profile\"),\n profile: PProfile,\n innerProfiles: z.array(PProfile).optional(),\n extrudeHeight: z.number(),\n position: PVec3,\n room_type: z.string().optional(),\n spaceType: PluginSpaceType.optional(),\n massType: PluginMassType.optional(),\n departmentId: PluginDepartmentId.optional(),\n }),\n])\n\nexport type PluginSpaceBulkCreateItem = z.infer<typeof PluginSpaceBulkCreateItem>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.bulkCreate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `items` | {@linkcode PluginSpaceBulkCreateItem}`[]` | Spaces to create |\n */\nexport const PluginSpaceBulkCreateArgs = z.object({\n items: z.array(PluginSpaceBulkCreateItem),\n})\n\nexport type PluginSpaceBulkCreateArgs = z.infer<typeof PluginSpaceBulkCreateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.bulkCreate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceIds` | `string[]` | IDs of the created spaces, in input order |\n */\nexport const PluginSpaceBulkCreateResult = z.object({\n spaceIds: z.array(z.string()),\n})\n\nexport type PluginSpaceBulkCreateResult = z.infer<\n typeof PluginSpaceBulkCreateResult\n>\n\n/**\n * A single item for {@linkcode PluginSpaceApi.bulkUpdate}.\n *\n * Targets an existing space by `spaceId`. Geometry fields `profile` and\n * `extrudeHeight` must be supplied **together** (mirrors\n * {@linkcode PluginSpaceUpdateGeometryFromProfileArgs}). Property changes are\n * nested under `properties`, mirroring {@linkcode PluginSpaceUpdateArgs}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space to update |\n * | `profile` | {@linkcode PProfile}`?` | New floor shape (requires `extrudeHeight`) |\n * | `extrudeHeight` | `number?` | New extrusion height (requires `profile`) |\n * | `properties` | `object?` | Property changes (same shape as {@linkcode PluginSpaceUpdateArgs.properties}) |\n */\nexport const PluginSpaceBulkUpdateItem = z.object({\n spaceId: z.string(),\n profile: PProfile.optional(),\n extrudeHeight: z.number().optional(),\n properties: z\n .object({\n room_type: z.string().optional(),\n massType: PluginMassType.optional(),\n spaceType: PluginSpaceType.optional(),\n departmentId: PluginDepartmentId.optional(),\n })\n .optional(),\n})\n\nexport type PluginSpaceBulkUpdateItem = z.infer<typeof PluginSpaceBulkUpdateItem>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.bulkUpdate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `items` | {@linkcode PluginSpaceBulkUpdateItem}`[]` | Spaces to update |\n */\nexport const PluginSpaceBulkUpdateArgs = z.object({\n items: z.array(PluginSpaceBulkUpdateItem),\n})\n\nexport type PluginSpaceBulkUpdateArgs = z.infer<typeof PluginSpaceBulkUpdateArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.bulkUpdate}.\n *\n * Echoes one {@linkcode PluginSpaceUpdateResult} per item, in input order —\n * the same per-space shape returned by {@linkcode PluginSpaceApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaces` | {@linkcode PluginSpaceUpdateResult}`[]` | Per-item updated values, in input order |\n */\nexport const PluginSpaceBulkUpdateResult = z.object({\n spaces: z.array(PluginSpaceUpdateResult),\n})\n\nexport type PluginSpaceBulkUpdateResult = z.infer<\n typeof PluginSpaceBulkUpdateResult\n>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.bulkDelete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceIds` | `string[]` | The space IDs to delete |\n */\nexport const PluginSpaceBulkDeleteArgs = z.object({\n spaceIds: z.array(z.string()),\n})\n\nexport type PluginSpaceBulkDeleteArgs = z.infer<typeof PluginSpaceBulkDeleteArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.bulkDelete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `deletedSpaceIds` | `string[]` | The space IDs that were removed |\n */\nexport const PluginSpaceBulkDeleteResult = z.object({\n deletedSpaceIds: z.array(z.string()),\n})\n\nexport type PluginSpaceBulkDeleteResult = z.infer<\n typeof PluginSpaceBulkDeleteResult\n>\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 { PluginBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { 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 * - {@linkcode PluginEntityApi.buildableEnvelope} — Create or update parametric buildable envelopes\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 /** Buildable Envelope operations. See {@linkcode PluginBuildableEnvelopeApi}. */\n public abstract buildableEnvelope: PluginBuildableEnvelopeApi\n\n constructor() {}\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport type { ComponentId } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Copy mode for `snaptrude.tools.copy`.\n *\n * | Value | Description |\n * |---|---|\n * | `\"instance\"` | Create instanced copies where possible |\n * | `\"unique\"` | Create independent geometry copies |\n */\nexport const PluginCopyMode = z.enum([\"instance\", \"unique\"])\n\nexport type PluginCopyMode = z.infer<typeof PluginCopyMode>\n\n/**\n * Arguments for `snaptrude.tools.copy`.\n *\n * Creates one or more copies for each component in `componentIds`. Copy `i` is\n * offset by `displacement * i`, where `i` starts at `1`. Source positions are\n * preserved. In `\"instance\"` mode, a unique source mesh can be replaced by an\n * instance at the same position so the source and copied objects remain in the\n * same instance family. The created copy stack becomes the active editor\n * selection, matching the native paste workflow.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to copy |\n * | `displacement` | {@linkcode PVec3} | Offset applied to each copy in Babylon units |\n * | `count` | `number` | Number of copies per component. Defaults to `1` |\n * | `copyMode` | {@linkcode PluginCopyMode} | `\"instance\"` or `\"unique\"`. Defaults to `\"instance\"` |\n */\nexport const PluginCopyArgs = z.object({\n componentIds: z.array(z.string()).min(1),\n displacement: PVec3,\n count: z.number().int().positive().optional(),\n copyMode: PluginCopyMode.optional(),\n})\n\nexport type PluginCopyArgs = z.infer<typeof PluginCopyArgs>\n\n/**\n * Result of `snaptrude.tools.copy`.\n *\n * Returned IDs are Snaptrude component IDs for the newly created copies, not\n * Babylon mesh IDs.\n */\nexport const PluginCopyResult = z.object({\n copiedIds: z.array(z.string()),\n})\n\nexport type PluginCopyResult = {\n copiedIds: ComponentId[]\n}\n","import * as z from \"zod\"\nimport type { ComponentId } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Arguments for `snaptrude.tools.offset`.\n *\n * Runs Snaptrude's offset/split operation on the top profile of a scene\n * component. A positive distance offsets outward from the selected profile;\n * a negative distance offsets inward. If `profilePickPoint` is omitted, the\n * outer top profile is used. If `profilePickPoint` is provided, the nearest top\n * contour profile to that point is used, matching the interactive offset tool's\n * pick behavior.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentId` | `string` | Component ID to offset |\n * | `distance` | `number` | Signed offset distance in Snaptrude units |\n * | `profilePickPoint` | {@linkcode PVec3} | Optional point used to choose a top contour profile |\n */\nexport const PluginOffsetArgs = z.object({\n componentId: z.string().min(1),\n distance: z.number(),\n profilePickPoint: PVec3.optional(),\n})\n\nexport type PluginOffsetArgs = z.infer<typeof PluginOffsetArgs>\n\n/**\n * Result of `snaptrude.tools.offset`.\n *\n * `createdIds` are the components created by the offset operation. `deletedIds`\n * are components removed by split-style offsets.\n */\nexport const PluginOffsetResult = z.object({\n createdIds: z.array(z.string()),\n deletedIds: z.array(z.string()),\n})\n\nexport type PluginOffsetResult = {\n createdIds: ComponentId[]\n deletedIds: ComponentId[]\n}\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\"\nimport type { PluginApiReturn } from \"../../types\"\nimport type { PluginCopyArgs, PluginCopyResult } from \"./copy\"\nimport type { PluginOffsetArgs, PluginOffsetResult } from \"./offset\"\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 * - {@linkcode PluginToolsApi.copy} — Copy components\n * - {@linkcode PluginToolsApi.offset} — Offset or split component profiles\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 /** Copy components by ID. See {@linkcode PluginCopyArgs}. */\n public abstract copy(args: PluginCopyArgs): PluginApiReturn<PluginCopyResult>\n\n /** Offset or split a component profile. See {@linkcode PluginOffsetArgs}. */\n public abstract offset(\n args: PluginOffsetArgs,\n ): PluginApiReturn<PluginOffsetResult>\n\n constructor() {}\n}\n\nexport * from \"./copy\"\nexport * from \"./offset\"\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} — Copy, offset, 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 /** Copy, offset, 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;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;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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