@snaptrude/plugin-core 0.9.10 → 0.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,561 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle } from "../../handles";
4
+ /**
5
+ * `snaptrude.design.family.*` — author NATIVE parametric families from a JSON spec.
6
+ *
7
+ * A parametric family is a reusable, parameter-driven building component: a
8
+ * curtain-wall panel, a louvre screen, a balustrade, a shading fin. Unlike the
9
+ * rest of `design.*`, you do not build one out of geometry calls — you write a
10
+ * JSON **spec** describing its parameters and its geometry rules, and the host
11
+ * compiles that into a live parametric definition the user can place, flex and
12
+ * save to their library.
13
+ *
14
+ * ## Workflow
15
+ *
16
+ * ```
17
+ * getReference() read the spec DSL once — grammar, ops, expressions, example
18
+ * prepare({ bundle }) validate + compile + show a live ghost; nothing committed
19
+ * flex({ values }) re-run at new values; returns the geometry delta
20
+ * place() arm placement — the USER clicks to drop it
21
+ * create({ name }) commit it to the project's family library
22
+ * ```
23
+ *
24
+ * ## Read getReference() first
25
+ *
26
+ * The spec DSL is a closed expression language with its own op set, coordinate
27
+ * convention (**+Y up, Snaptrude units** — the scene's own unit, 1 SU = 254 mm;
28
+ * literals may carry a unit suffix such as `600mm` or `2ft`)
29
+ * and part-naming law. It is deliberately NOT duplicated in these types:
30
+ * {@linkcode PluginDesignFamilyApi.getReference} returns the whole reference,
31
+ * generated from a family that is actually registered in the host, so the
32
+ * documentation cannot drift from what the compiler accepts.
33
+ *
34
+ * ## The repair contract
35
+ *
36
+ * {@linkcode PluginDesignFamilyApi.prepare} does **not** throw on an invalid
37
+ * spec — it returns `{ ok: false, errors }` where each error carries a JSON
38
+ * pointer into the bundle you sent (e.g. `"/root/geometry/2/body/0/w"`). Read
39
+ * `errors[0].path`, fix that node, and call `prepare` again. A failed `prepare`
40
+ * leaves the previous good draft standing, so it costs nothing but the node you
41
+ * broke. Re-authoring from scratch throws away everything already correct.
42
+ *
43
+ * Accessed via `snaptrude.design.family`.
44
+ */
45
+ export declare abstract class PluginDesignFamilyApi {
46
+ constructor();
47
+ /**
48
+ * Read the family-spec DSL reference: grammar, the op table, the expression
49
+ * whitelist, the coordinate convention, the repair contract, and a worked
50
+ * example taken from a registered family.
51
+ *
52
+ * Read this before authoring a family for the first time in a session. The
53
+ * DSL is a closed language — a guessed op or function is a rejected spec.
54
+ *
55
+ * @returns The reference text
56
+ *
57
+ * @examplePrompt How do I write a parametric family spec?
58
+ * @examplePrompt Show me the family DSL
59
+ *
60
+ * # Example
61
+ * ```ts
62
+ * const { reference } = await snaptrude.design.family.getReference()
63
+ * ```
64
+ */
65
+ abstract getReference(): PluginApiReturn<PluginFamilyReference>;
66
+ /**
67
+ * Validate, compile and preview a family spec. Nothing is committed to the
68
+ * model or the library — call {@linkcode PluginDesignFamilyApi.place} or
69
+ * {@linkcode PluginDesignFamilyApi.create} for that.
70
+ *
71
+ * Safe to call repeatedly while iterating. On success, check `partCount` and
72
+ * `bbox` against what you intended before treating the family as correct — a
73
+ * facade that built 3 parts, or a 3 m screen reporting 40 m of height, is a
74
+ * visible bug the validator cannot catch.
75
+ *
76
+ * @param args The spec bundle, as `{ bundle }` or `{ spec }`
77
+ * @returns Build report, or `{ ok: false, errors }` with JSON-pointer paths
78
+ *
79
+ * @examplePrompt Make a louvre screen with adjustable blade count and tilt
80
+ * @examplePrompt Design a curtain wall panel family with 8 bays
81
+ * @examplePrompt Create a railing family I can adjust
82
+ *
83
+ * # Example
84
+ * ```ts
85
+ * const r = await snaptrude.design.family.prepare({ bundle })
86
+ * if (!r.ok) console.error(r.errors[0].path, r.errors[0].message)
87
+ * ```
88
+ */
89
+ abstract prepare(args: PluginDesignFamilyPrepareArgs): PluginApiReturn<PluginFamilyPrepareResult>;
90
+ /**
91
+ * Re-run the prepared family's recipe at new parameter values.
92
+ *
93
+ * Values are merged over the current ones and clamped to the parameter
94
+ * sheet's min/max, so a partial `{ bays: 6 }` is fine. The returned `changed`
95
+ * buckets are the host's own diff of what the geometry did — flexing a
96
+ * driving parameter and reporting them demonstrates the family is parametric.
97
+ *
98
+ * @param args The parameter values to change
99
+ * @returns The new build plus the geometry delta
100
+ *
101
+ * @examplePrompt Change it to 6 bays
102
+ * @examplePrompt Show me what happens with 20 blades
103
+ *
104
+ * # Example
105
+ * ```ts
106
+ * const { changed } = await snaptrude.design.family.flex({ values: { bays: 6 } })
107
+ * console.log(`removed ${changed.removed}, rebuilt ${changed.rebuilt}`)
108
+ * ```
109
+ */
110
+ abstract flex(args: PluginDesignFamilyFlexArgs): PluginApiReturn<PluginFamilyFlexResult>;
111
+ /**
112
+ * The prepared family's spec bundle, or `null` when nothing is prepared.
113
+ *
114
+ * @returns The draft bundle, or `null`
115
+ *
116
+ * # Example
117
+ * ```ts
118
+ * const bundle = await snaptrude.design.family.get()
119
+ * ```
120
+ */
121
+ abstract get(): PluginApiReturn<PluginFamilyBundle | null>;
122
+ /**
123
+ * Every parametric family registered in this session — native and imported.
124
+ *
125
+ * @returns One summary per family
126
+ *
127
+ * @examplePrompt What families are available?
128
+ *
129
+ * # Example
130
+ * ```ts
131
+ * const families = await snaptrude.design.family.list()
132
+ * ```
133
+ */
134
+ abstract list(): PluginApiReturn<PluginFamilySummary[]>;
135
+ /**
136
+ * Put a family into the model — either the prepared draft or any family from
137
+ * {@linkcode PluginDesignFamilyApi.list}.
138
+ *
139
+ * Two modes, chosen by whether you pass `position`:
140
+ *
141
+ * **With `position`** the component is created there and then, undoably. Use
142
+ * this when you know where it goes — you were given coordinates, or you are
143
+ * copying an existing instance. The returned `component` handle works with
144
+ * `design.transform.move` / `.rotate` and with
145
+ * {@linkcode PluginDesignFamilyApi.setParameters}.
146
+ *
147
+ * **Without `position`** it arms placement mode with a ghost on the cursor
148
+ * and returns immediately — no geometry yet. The USER clicks to drop it, so
149
+ * tell them to. Prefer this when the location is a judgement call.
150
+ *
151
+ * To COPY a placed component, place its family again at the new position with
152
+ * the same `values` — there is no separate copy call.
153
+ *
154
+ * @param args Which family, where, and at what parameter values
155
+ * @returns What was placed; `component` is present only in positioned mode
156
+ *
157
+ * @examplePrompt Place it in the model
158
+ * @examplePrompt Put a louvre screen at the origin
159
+ * @examplePrompt Copy that table two metres to the right
160
+ *
161
+ * # Example
162
+ * ```ts
163
+ * // positioned — geometry exists when this resolves
164
+ * const { component } = await snaptrude.design.family.place({
165
+ * id: "revit:gypsum-stud-partition~90ad72",
166
+ * position: { x: 0, y: 0, z: 0 },
167
+ * rotation: 90,
168
+ * })
169
+ * await snaptrude.design.transform.move([component], { x: 2, y: 0, z: 0 })
170
+ *
171
+ * // interactive — the user clicks
172
+ * await snaptrude.design.family.place()
173
+ * ```
174
+ */
175
+ abstract place(args?: PluginDesignFamilyPlaceArgs): PluginApiReturn<PluginFamilyPlaceResult>;
176
+ /**
177
+ * Read a placed component's current parameter values and its sheet.
178
+ *
179
+ * Use before {@linkcode PluginDesignFamilyApi.setParameters} so you change
180
+ * what is actually there: parameter KEYS are the family's own, not the
181
+ * label the user says, and a Revit-imported family carries parameters that
182
+ * do not drive geometry at all.
183
+ *
184
+ * @param args The component to read
185
+ * @returns Its definition, current values, and the parameter sheet
186
+ *
187
+ * @examplePrompt What size is that table?
188
+ * @examplePrompt Show me the parameters on this partition
189
+ *
190
+ * # Example
191
+ * ```ts
192
+ * const { values, parameters } = await snaptrude.design.family.getParameters({ component })
193
+ * ```
194
+ */
195
+ abstract getParameters(args: PluginDesignFamilyGetParametersArgs): PluginApiReturn<PluginFamilyInstanceParameters | null>;
196
+ /**
197
+ * Change a placed component's parameters and rebuild its geometry in place.
198
+ *
199
+ * Partial: pass only what changes. The component keeps its position,
200
+ * rotation and identity — this is an edit, not a replace, and it is undoable.
201
+ *
202
+ * Only parameters with `drivesGeometry` actually move the mesh. Setting one
203
+ * that does not is accepted and stored (it round-trips to Revit) but nothing
204
+ * visible happens — say so rather than claiming a change the user cannot see.
205
+ *
206
+ * @param args The component and the values to change
207
+ * @returns The values now in effect
208
+ *
209
+ * @examplePrompt Make that table seat 8
210
+ * @examplePrompt Change the stud spacing to 400
211
+ *
212
+ * # Example
213
+ * ```ts
214
+ * await snaptrude.design.family.setParameters({ component, values: { seats: 8 } })
215
+ * ```
216
+ */
217
+ abstract setParameters(args: PluginDesignFamilySetParametersArgs): PluginApiReturn<PluginFamilyInstanceParameters>;
218
+ /**
219
+ * Commit the prepared bundle to the project's parametric-definition library,
220
+ * so it survives the session and appears in the Families panel.
221
+ *
222
+ * @param args Optional library name and team scope
223
+ * @returns The catalogued definition's id and version
224
+ *
225
+ * @examplePrompt Save this as a family called Vertical Louvre
226
+ * @examplePrompt Add it to my library
227
+ *
228
+ * # Example
229
+ * ```ts
230
+ * const { definitionId } = await snaptrude.design.family.create({ name: "Louvre Screen" })
231
+ * ```
232
+ */
233
+ abstract create(args?: PluginDesignFamilyCreateArgs): PluginApiReturn<PluginFamilyCreateResult>;
234
+ }
235
+ /** The family-spec DSL reference returned by `getReference`. */
236
+ export interface PluginFamilyReference {
237
+ /** Grammar, op table, expression whitelist, repair contract, worked example. */
238
+ reference: string;
239
+ }
240
+ /**
241
+ * A family spec bundle. `root` is the family; `deps` carries every spec
242
+ * reachable through an `instance` op, keyed by spec id, so a saved family is
243
+ * self-contained and reloads anywhere.
244
+ *
245
+ * The internal shape of a spec is documented by
246
+ * {@linkcode PluginDesignFamilyApi.getReference}, not by these types — it is a
247
+ * data DSL whose grammar changes independently of this API surface.
248
+ */
249
+ export interface PluginFamilyBundle {
250
+ root: Record<string, unknown>;
251
+ deps?: Record<string, Record<string, unknown>>;
252
+ }
253
+ /** Axis-aligned extents of a built family. Snaptrude units (1 SU = 254 mm), +Y up. */
254
+ export interface PluginFamilyBBox {
255
+ min: [number, number, number];
256
+ max: [number, number, number];
257
+ /** `[width, height, depth]` in Snaptrude units — convert with `core.units.convert` for display. */
258
+ size: [number, number, number];
259
+ }
260
+ /** One row of a family's parameter sheet. */
261
+ export interface PluginFamilyParameter {
262
+ key: string;
263
+ label: string;
264
+ type: "length" | "integer" | "enum" | "text" | "boolean";
265
+ /** Current value. `length`/`integer` are numbers; the rest are strings. */
266
+ value: string | number;
267
+ default: string | number;
268
+ /**
269
+ * Whether this parameter actually drives geometry — INFERRED by the host from
270
+ * which names the spec's expressions reference. `false` means the value is
271
+ * stored and round-tripped but moves nothing.
272
+ */
273
+ drivesGeometry: boolean;
274
+ min?: number;
275
+ max?: number;
276
+ options?: readonly string[];
277
+ }
278
+ /**
279
+ * A validation diagnostic. `path` is a JSON pointer into the submitted bundle —
280
+ * fix that node and re-`prepare`.
281
+ */
282
+ export interface PluginFamilyDiagnostic {
283
+ /** JSON pointer, e.g. `"/root/geometry/2/body/0/w"`. */
284
+ path: string;
285
+ code: "schema" | "bad-expression" | "unknown-name" | "unknown-def" | "cycle" | "duplicate-name" | "unbounded-repeat" | "depth" | "bad-dimension" | "proportion";
286
+ message: string;
287
+ hint?: string;
288
+ }
289
+ /** What `prepare` reports. */
290
+ export interface PluginFamilyPrepareResult {
291
+ /** `false` means the spec was rejected — read `errors`, fix, re-prepare. */
292
+ ok: boolean;
293
+ familyId?: string;
294
+ version?: number;
295
+ label?: string;
296
+ /** How many parts the family built. Sanity-check against intent. */
297
+ partCount?: number;
298
+ /** Extents in Snaptrude units. Sanity-check against intent. */
299
+ bbox?: PluginFamilyBBox;
300
+ evalMs?: number;
301
+ parameters?: PluginFamilyParameter[];
302
+ /** Computed quantities, when the spec declares a `takeoff` block. */
303
+ takeoff?: Record<string, number | string>;
304
+ /** The first few part names — enough to check the naming came out right. */
305
+ sampleParts?: string[];
306
+ /** Present when `snapshot` was asked for. */
307
+ snapshot?: PluginFamilySnapshot;
308
+ errors: PluginFamilyDiagnostic[];
309
+ warnings: PluginFamilyDiagnostic[];
310
+ /** Set when the bundle validated but threw while building. */
311
+ error?: string;
312
+ }
313
+ /**
314
+ * The host's diff of what a flex did to the geometry. This is the evidence that
315
+ * a family is parametric.
316
+ */
317
+ export interface PluginFamilyChangeBuckets {
318
+ added: number;
319
+ removed: number;
320
+ moved: number;
321
+ rebuilt: number;
322
+ addedNames: string[];
323
+ removedNames: string[];
324
+ }
325
+ /** What `flex` reports. */
326
+ export interface PluginFamilyFlexResult {
327
+ ok: boolean;
328
+ /** The RESOLVED values after merge + clamping — not necessarily what was sent. */
329
+ values?: Record<string, number | string>;
330
+ partCount?: number;
331
+ bbox?: PluginFamilyBBox;
332
+ evalMs?: number;
333
+ changed?: PluginFamilyChangeBuckets;
334
+ takeoff?: Record<string, number | string>;
335
+ /** Proportion warnings at the flexed values (code `proportion`): a part thinner than 0.5 mm, a part or family over 50 m, a family under 10 mm — the signature of a unit slip. */
336
+ warnings?: PluginFamilyDiagnostic[];
337
+ /** Present when `snapshot` was asked for. */
338
+ snapshot?: PluginFamilySnapshot;
339
+ error?: string;
340
+ }
341
+ /** One family available to place — from the session registry or the catalog. */
342
+ export interface PluginFamilySummary {
343
+ id: string;
344
+ version: number;
345
+ label: string;
346
+ category?: string;
347
+ /** Number of rows on the family's parameter sheet. */
348
+ parameters: number;
349
+ /**
350
+ * Where the family came from, which decides how far you can edit it.
351
+ *
352
+ * `"native"` — authored from a JSON spec through this API. Its recipe is
353
+ * data, so every parameter genuinely re-runs the geometry.
354
+ *
355
+ * `"revit"` — imported from a Revit family. Parameters exist and are
356
+ * editable, but only those the importer could bind to geometry actually
357
+ * change the mesh; the rest are carried for round-tripping. Check
358
+ * `drivesGeometry` on the parameter before promising the user a change.
359
+ */
360
+ kind: "native" | "revit";
361
+ }
362
+ /** What `place` reports. */
363
+ export interface PluginFamilyPlaceResult {
364
+ ok: boolean;
365
+ familyId?: string;
366
+ version?: number;
367
+ /**
368
+ * The created component — present ONLY when `position` was given. In
369
+ * interactive mode nothing exists yet, so there is nothing to hand back;
370
+ * the user has not clicked.
371
+ */
372
+ component?: ComponentHandle;
373
+ error?: string;
374
+ }
375
+ /** A placed component's parameter state, from `getParameters` / `setParameters`. */
376
+ export interface PluginFamilyInstanceParameters {
377
+ /** The definition this instance is pinned to. */
378
+ familyId: string;
379
+ version: number;
380
+ label: string;
381
+ /** Current values, keyed by parameter key. */
382
+ values: Record<string, number | string>;
383
+ /** The sheet: what each key means, its bounds, and whether it moves geometry. */
384
+ parameters: PluginFamilyParameter[];
385
+ /** Present when `getParameters` was asked for a `snapshot`. */
386
+ snapshot?: PluginFamilySnapshot;
387
+ }
388
+ /** What `create` reports. */
389
+ export interface PluginFamilyCreateResult {
390
+ ok: boolean;
391
+ definitionId?: string;
392
+ version?: number;
393
+ guid?: string;
394
+ error?: string;
395
+ }
396
+ /**
397
+ * A spec bundle as it crosses the boundary: `root` plus optional `deps`.
398
+ *
399
+ * Loose by design — the spec grammar is a data DSL validated by the host's own
400
+ * validator, which returns JSON-pointer diagnostics far more useful than a Zod
401
+ * shape error. This schema only guarantees the envelope is an object.
402
+ */
403
+ export declare const PluginFamilyBundleSchema: z.ZodObject<{
404
+ root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
405
+ deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
406
+ }, z.core.$strip>;
407
+ /**
408
+ * Arguments for {@linkcode PluginDesignFamilyApi.prepare}.
409
+ *
410
+ * | Property | Type | Description |
411
+ * |---|---|---|
412
+ * | `bundle` | {@linkcode PluginFamilyBundle} | The family spec bundle |
413
+ * | `spec` | {@linkcode PluginFamilyBundle} | Alias for `bundle` |
414
+ * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the built family |
415
+ *
416
+ * Exactly one of `bundle` / `spec` is required. A bare `FamilySpec` (no `root`
417
+ * wrapper) is also accepted by the host and wrapped for the caller.
418
+ */
419
+ /**
420
+ * Ask for a picture with the result: `true` for the default sheet (iso, front,
421
+ * right and top tiles with a dimension line), or an object to choose views and
422
+ * tile size. The picture is an isolated offscreen render of the family alone —
423
+ * the viewport is not moved — and comes back as a PNG data URL in the result's
424
+ * `snapshot.image`. Through the agent's `run_worker`, return the result and the
425
+ * image reaches the model as an image.
426
+ */
427
+ export declare const PluginFamilySnapshotOption: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
428
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
429
+ top: "top";
430
+ front: "front";
431
+ right: "right";
432
+ iso: "iso";
433
+ }>>>;
434
+ tileSize: z.ZodOptional<z.ZodNumber>;
435
+ }, z.core.$strip>]>;
436
+ export type PluginFamilySnapshotOption = z.infer<typeof PluginFamilySnapshotOption>;
437
+ /** The picture block on prepare / flex / getParameters results when `snapshot` was asked for. */
438
+ export interface PluginFamilySnapshot {
439
+ ok: boolean;
440
+ /** PNG data URL of the composed sheet. */
441
+ image?: string;
442
+ views?: ("iso" | "front" | "right" | "top")[];
443
+ /** [width, height, depth] in Snaptrude units. */
444
+ size?: [number, number, number];
445
+ ms?: number;
446
+ /** Set when the picture could not be taken (e.g. the legacy renderer); the call itself still succeeded. */
447
+ error?: string;
448
+ }
449
+ export declare const PluginDesignFamilyPrepareArgs: z.ZodObject<{
450
+ bundle: z.ZodOptional<z.ZodObject<{
451
+ root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
452
+ deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
453
+ }, z.core.$strip>>;
454
+ spec: z.ZodOptional<z.ZodObject<{
455
+ root: z.ZodRecord<z.ZodString, z.ZodUnknown>;
456
+ deps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
457
+ }, z.core.$strip>>;
458
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
459
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
460
+ top: "top";
461
+ front: "front";
462
+ right: "right";
463
+ iso: "iso";
464
+ }>>>;
465
+ tileSize: z.ZodOptional<z.ZodNumber>;
466
+ }, z.core.$strip>]>>;
467
+ }, z.core.$strip>;
468
+ export type PluginDesignFamilyPrepareArgs = z.infer<typeof PluginDesignFamilyPrepareArgs>;
469
+ /**
470
+ * Arguments for {@linkcode PluginDesignFamilyApi.flex}.
471
+ *
472
+ * | Property | Type | Description |
473
+ * |---|---|---|
474
+ * | `values` | `Record<string, number \| string>` | Parameter values to change (partial) |
475
+ * | `snapshot` | {@linkcode PluginFamilySnapshotOption} | Also return a picture of the flexed family |
476
+ */
477
+ export declare const PluginDesignFamilyFlexArgs: z.ZodObject<{
478
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
479
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
480
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
481
+ top: "top";
482
+ front: "front";
483
+ right: "right";
484
+ iso: "iso";
485
+ }>>>;
486
+ tileSize: z.ZodOptional<z.ZodNumber>;
487
+ }, z.core.$strip>]>>;
488
+ }, z.core.$strip>;
489
+ export type PluginDesignFamilyFlexArgs = z.infer<typeof PluginDesignFamilyFlexArgs>;
490
+ /**
491
+ * Arguments for {@linkcode PluginDesignFamilyApi.create}.
492
+ *
493
+ * | Property | Type | Description |
494
+ * |---|---|---|
495
+ * | `name` | `string` | Library name; defaults to the spec's own label |
496
+ * | `teamId` | `string` | Team library to save into; omit for personal |
497
+ */
498
+ export declare const PluginDesignFamilyCreateArgs: z.ZodObject<{
499
+ name: z.ZodOptional<z.ZodString>;
500
+ teamId: z.ZodOptional<z.ZodString>;
501
+ }, z.core.$strip>;
502
+ export type PluginDesignFamilyCreateArgs = z.infer<typeof PluginDesignFamilyCreateArgs>;
503
+ /**
504
+ * Arguments for {@linkcode PluginDesignFamilyApi.place}.
505
+ *
506
+ * | Property | Type | Description |
507
+ * |---|---|---|
508
+ * | `id` | `string` | Family to place, from {@linkcode PluginDesignFamilyApi.list}. Omit to place the prepared draft |
509
+ * | `version` | `number` | Exact version; defaults to the newest known |
510
+ * | `position` | `{ x, y, z }` | Place HERE, without user interaction. Omit to arm the cursor instead |
511
+ * | `rotation` | `number` | Yaw in degrees about +Y. Only with `position` |
512
+ * | `values` | `Record<string, number \| string>` | Parameter values for THIS instance |
513
+ * | `storey` | `number` | Storey to place on; defaults to the active one |
514
+ */
515
+ export declare const PluginDesignFamilyPlaceArgs: z.ZodObject<{
516
+ id: z.ZodOptional<z.ZodString>;
517
+ version: z.ZodOptional<z.ZodNumber>;
518
+ position: z.ZodOptional<z.ZodObject<{
519
+ x: z.ZodNumber;
520
+ y: z.ZodNumber;
521
+ z: z.ZodNumber;
522
+ }, z.core.$strip>>;
523
+ rotation: z.ZodOptional<z.ZodNumber>;
524
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
525
+ storey: z.ZodOptional<z.ZodNumber>;
526
+ }, z.core.$strip>;
527
+ export type PluginDesignFamilyPlaceArgs = z.infer<typeof PluginDesignFamilyPlaceArgs>;
528
+ /**
529
+ * Arguments for {@linkcode PluginDesignFamilyApi.getParameters}.
530
+ *
531
+ * | Property | Type | Description |
532
+ * |---|---|---|
533
+ * | `component` | {@linkcode ComponentHandle} | A placed parametric component |
534
+ */
535
+ export declare const PluginDesignFamilyGetParametersArgs: z.ZodObject<{
536
+ component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
537
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
538
+ views: z.ZodOptional<z.ZodArray<z.ZodEnum<{
539
+ top: "top";
540
+ front: "front";
541
+ right: "right";
542
+ iso: "iso";
543
+ }>>>;
544
+ tileSize: z.ZodOptional<z.ZodNumber>;
545
+ }, z.core.$strip>]>>;
546
+ }, z.core.$strip>;
547
+ export type PluginDesignFamilyGetParametersArgs = z.infer<typeof PluginDesignFamilyGetParametersArgs>;
548
+ /**
549
+ * Arguments for {@linkcode PluginDesignFamilyApi.setParameters}.
550
+ *
551
+ * | Property | Type | Description |
552
+ * |---|---|---|
553
+ * | `component` | {@linkcode ComponentHandle} | A placed parametric component |
554
+ * | `values` | `Record<string, number \| string>` | Values to change (partial) |
555
+ */
556
+ export declare const PluginDesignFamilySetParametersArgs: z.ZodObject<{
557
+ component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
558
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
559
+ }, z.core.$strip>;
560
+ export type PluginDesignFamilySetParametersArgs = z.infer<typeof PluginDesignFamilySetParametersArgs>;
561
+ //# sourceMappingURL=family.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"family.d.ts","sourceRoot":"","sources":["../../../src/api/design/family.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;OAiBG;aACa,YAAY,IAAI,eAAe,CAAC,qBAAqB,CAAC;IAEtE;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,OAAO,CACrB,IAAI,EAAE,6BAA6B,GAClC,eAAe,CAAC,yBAAyB,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;OAmBG;aACa,IAAI,CAClB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,sBAAsB,CAAC;IAE1C;;;;;;;;;OASG;aACa,GAAG,IAAI,eAAe,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAEjE;;;;;;;;;;;OAWG;aACa,IAAI,IAAI,eAAe,CAAC,mBAAmB,EAAE,CAAC;IAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;aACa,KAAK,CACnB,IAAI,CAAC,EAAE,2BAA2B,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