@snaptrude/plugin-core 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/entity/department.d.ts +99 -0
- package/dist/api/entity/department.d.ts.map +1 -0
- package/dist/api/entity/index.d.ts +10 -0
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +259 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +256 -9
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/units/index.d.ts +9 -0
- package/dist/api/units/index.d.ts.map +1 -1
- package/dist/index.cjs +258 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +238 -90
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api/entity/department.ts +113 -0
- package/src/api/entity/index.ts +10 -0
- package/src/api/entity/referenceLine.ts +215 -0
- package/src/api/entity/space.ts +231 -8
- package/src/api/units/index.ts +9 -0
- package/tsup.config.ts +0 -1
|
@@ -144,6 +144,35 @@ export declare abstract class PluginSpaceApi {
|
|
|
144
144
|
* ```
|
|
145
145
|
*/
|
|
146
146
|
abstract delete({ spaceId, }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>;
|
|
147
|
+
/**
|
|
148
|
+
* Update properties of a space by its ID.
|
|
149
|
+
*
|
|
150
|
+
* Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties
|
|
151
|
+
* args.properties} will be updated — omitted properties remain unchanged.
|
|
152
|
+
* This operation is undoable via Snaptrude's command system.
|
|
153
|
+
*
|
|
154
|
+
* @param args - An object containing:
|
|
155
|
+
* - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID
|
|
156
|
+
* to update
|
|
157
|
+
* - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs
|
|
158
|
+
* of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.
|
|
159
|
+
* @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and
|
|
160
|
+
* the updated property values
|
|
161
|
+
* @throws If the space does not exist or the component is not a space/mass
|
|
162
|
+
*
|
|
163
|
+
* # Example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const result = await snaptrude.entity.space.update({
|
|
166
|
+
* spaceId: "some-space-id",
|
|
167
|
+
* properties: {
|
|
168
|
+
* room_type: "Kitchen",
|
|
169
|
+
* massType: "Room",
|
|
170
|
+
* departmentId: "CORE",
|
|
171
|
+
* },
|
|
172
|
+
* })
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
abstract update(args: PluginSpaceUpdateArgs): PluginApiReturn<PluginSpaceUpdateResult>;
|
|
147
176
|
}
|
|
148
177
|
/**
|
|
149
178
|
* Arguments for {@linkcode PluginSpaceApi.createRectangular}.
|
|
@@ -246,30 +275,61 @@ export type PluginSpaceCreateFromProfileResult = z.infer<typeof PluginSpaceCreat
|
|
|
246
275
|
/**
|
|
247
276
|
* Available properties that can be queried on a space.
|
|
248
277
|
*
|
|
278
|
+
* **Basic:**
|
|
249
279
|
* | Value | Return Type | Description |
|
|
250
280
|
* |---|---|---|
|
|
251
281
|
* | `"id"` | `string` | Unique space identifier |
|
|
252
282
|
* | `"type"` | `string` | Component type |
|
|
253
283
|
* | `"room_type"` | `string` | Room type classification |
|
|
254
284
|
* | `"name"` | `string` | Display name of the space |
|
|
255
|
-
*
|
|
256
|
-
*
|
|
285
|
+
*
|
|
286
|
+
* **Derived from parametric data:**
|
|
287
|
+
* | Value | Return Type | Description |
|
|
288
|
+
* |---|---|---|
|
|
289
|
+
* | `"area"` | `number` | Bottom face area (from `areas_bottomFace`) |
|
|
290
|
+
* | `"breadth"` | `number` | Breadth dimension |
|
|
291
|
+
* | `"depth"` | `number` | Depth dimension |
|
|
292
|
+
* | `"height"` | `number` | Height dimension |
|
|
293
|
+
* | `"massType"` | `string \| null` | Mass type classification |
|
|
294
|
+
* | `"spaceType"` | `string \| null` | Space type classification (Room, Balcony, etc.) |
|
|
295
|
+
* | `"storey"` | `number \| null` | Story the space belongs to |
|
|
296
|
+
* | `"departmentId"` | `string \| null` | Assigned department ID |
|
|
297
|
+
* | `"departmentName"` | `string` | Assigned department name |
|
|
298
|
+
* | `"departmentColor"` | `string` | Assigned department color (hex/CSS) |
|
|
299
|
+
*
|
|
300
|
+
* **Derived from mesh:**
|
|
301
|
+
* | Value | Return Type | Description |
|
|
302
|
+
* |---|---|---|
|
|
257
303
|
* | `"position"` | {@linkcode PVec3} | Local position relative to parent |
|
|
258
304
|
* | `"absolutePosition"` | {@linkcode PVec3} | Absolute position in the scene |
|
|
259
305
|
* | `"rotation"` | {@linkcode PVec3} | Euler rotation angles (radians) |
|
|
260
306
|
* | `"rotationQuaternion"` | {@linkcode PQuat} \| `null` | Quaternion rotation, or `null` if unset |
|
|
307
|
+
*
|
|
308
|
+
* **Derived from brep:**
|
|
309
|
+
* | Value | Return Type | Description |
|
|
310
|
+
* |---|---|---|
|
|
311
|
+
* | `"planPoints"` | {@linkcode PVec3}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |
|
|
261
312
|
*/
|
|
262
313
|
export declare const PluginSpaceGetProperty: z.ZodEnum<{
|
|
263
|
-
|
|
314
|
+
name: "name";
|
|
315
|
+
departmentId: "departmentId";
|
|
264
316
|
id: "id";
|
|
317
|
+
position: "position";
|
|
318
|
+
height: "height";
|
|
319
|
+
depth: "depth";
|
|
265
320
|
type: "type";
|
|
266
321
|
room_type: "room_type";
|
|
267
|
-
name: "name";
|
|
268
322
|
area: "area";
|
|
269
|
-
|
|
323
|
+
breadth: "breadth";
|
|
324
|
+
massType: "massType";
|
|
325
|
+
spaceType: "spaceType";
|
|
326
|
+
storey: "storey";
|
|
327
|
+
departmentName: "departmentName";
|
|
328
|
+
departmentColor: "departmentColor";
|
|
270
329
|
absolutePosition: "absolutePosition";
|
|
271
330
|
rotation: "rotation";
|
|
272
331
|
rotationQuaternion: "rotationQuaternion";
|
|
332
|
+
planPoints: "planPoints";
|
|
273
333
|
}>;
|
|
274
334
|
/**
|
|
275
335
|
* Arguments for {@linkcode PluginSpaceApi.get}.
|
|
@@ -282,19 +342,54 @@ export declare const PluginSpaceGetProperty: z.ZodEnum<{
|
|
|
282
342
|
export declare const PluginSpaceGetArgs: z.ZodObject<{
|
|
283
343
|
spaceId: z.ZodString;
|
|
284
344
|
properties: z.ZodArray<z.ZodEnum<{
|
|
285
|
-
|
|
345
|
+
name: "name";
|
|
346
|
+
departmentId: "departmentId";
|
|
286
347
|
id: "id";
|
|
348
|
+
position: "position";
|
|
349
|
+
height: "height";
|
|
350
|
+
depth: "depth";
|
|
287
351
|
type: "type";
|
|
288
352
|
room_type: "room_type";
|
|
289
|
-
name: "name";
|
|
290
353
|
area: "area";
|
|
291
|
-
|
|
354
|
+
breadth: "breadth";
|
|
355
|
+
massType: "massType";
|
|
356
|
+
spaceType: "spaceType";
|
|
357
|
+
storey: "storey";
|
|
358
|
+
departmentName: "departmentName";
|
|
359
|
+
departmentColor: "departmentColor";
|
|
292
360
|
absolutePosition: "absolutePosition";
|
|
293
361
|
rotation: "rotation";
|
|
294
362
|
rotationQuaternion: "rotationQuaternion";
|
|
363
|
+
planPoints: "planPoints";
|
|
295
364
|
}>>;
|
|
296
365
|
}, z.core.$strip>;
|
|
297
366
|
export type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>;
|
|
367
|
+
/**
|
|
368
|
+
* Supported space type values.
|
|
369
|
+
*
|
|
370
|
+
* Mirrors the internal `SpaceType` enum from `spaceType.types.ts`.
|
|
371
|
+
*
|
|
372
|
+
* | Value | Description |
|
|
373
|
+
* |---|---|
|
|
374
|
+
* | `"Room"` | Standard room |
|
|
375
|
+
* | `"Program Block"` | Program/department block |
|
|
376
|
+
* | `"Balcony"` | Balcony space |
|
|
377
|
+
* | `"Road"` | Road |
|
|
378
|
+
* | `"Garden"` | Garden area |
|
|
379
|
+
* | `"Deck"` | Deck |
|
|
380
|
+
* | `"Pool"` | Pool |
|
|
381
|
+
* | `"Walkway"` | Walkway |
|
|
382
|
+
*/
|
|
383
|
+
export declare const PluginSpaceType: z.ZodEnum<{
|
|
384
|
+
Room: "Room";
|
|
385
|
+
"Program Block": "Program Block";
|
|
386
|
+
Balcony: "Balcony";
|
|
387
|
+
Road: "Road";
|
|
388
|
+
Garden: "Garden";
|
|
389
|
+
Deck: "Deck";
|
|
390
|
+
Pool: "Pool";
|
|
391
|
+
Walkway: "Walkway";
|
|
392
|
+
}>;
|
|
298
393
|
/**
|
|
299
394
|
* Result of {@linkcode PluginSpaceApi.get}.
|
|
300
395
|
*
|
|
@@ -307,7 +402,24 @@ export declare const PluginSpaceGetResult: z.ZodObject<{
|
|
|
307
402
|
room_type: z.ZodOptional<z.ZodString>;
|
|
308
403
|
name: z.ZodOptional<z.ZodString>;
|
|
309
404
|
area: z.ZodOptional<z.ZodNumber>;
|
|
310
|
-
|
|
405
|
+
breadth: z.ZodOptional<z.ZodNumber>;
|
|
406
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
407
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
408
|
+
massType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
409
|
+
spaceType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
410
|
+
Room: "Room";
|
|
411
|
+
"Program Block": "Program Block";
|
|
412
|
+
Balcony: "Balcony";
|
|
413
|
+
Road: "Road";
|
|
414
|
+
Garden: "Garden";
|
|
415
|
+
Deck: "Deck";
|
|
416
|
+
Pool: "Pool";
|
|
417
|
+
Walkway: "Walkway";
|
|
418
|
+
}>>>;
|
|
419
|
+
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
420
|
+
departmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
421
|
+
departmentName: z.ZodOptional<z.ZodString>;
|
|
422
|
+
departmentColor: z.ZodOptional<z.ZodString>;
|
|
311
423
|
position: z.ZodOptional<z.ZodObject<{
|
|
312
424
|
x: z.ZodNumber;
|
|
313
425
|
y: z.ZodNumber;
|
|
@@ -329,6 +441,11 @@ export declare const PluginSpaceGetResult: z.ZodObject<{
|
|
|
329
441
|
z: z.ZodNumber;
|
|
330
442
|
w: z.ZodNumber;
|
|
331
443
|
}, z.core.$strip>>>;
|
|
444
|
+
planPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
445
|
+
x: z.ZodNumber;
|
|
446
|
+
y: z.ZodNumber;
|
|
447
|
+
z: z.ZodNumber;
|
|
448
|
+
}, z.core.$strip>>>;
|
|
332
449
|
}, z.core.$strip>;
|
|
333
450
|
export type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>;
|
|
334
451
|
/**
|
|
@@ -355,4 +472,134 @@ export declare const PluginSpaceDeleteArgs: z.ZodObject<{
|
|
|
355
472
|
export type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>;
|
|
356
473
|
/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */
|
|
357
474
|
export type PluginSpaceDeleteResult = void;
|
|
475
|
+
/**
|
|
476
|
+
* Supported mass type values for {@linkcode PluginSpaceUpdateArgs.properties.massType}.
|
|
477
|
+
*
|
|
478
|
+
* Mirrors the internal `MASS_TYPES` enum.
|
|
479
|
+
*
|
|
480
|
+
* | Value | Description |
|
|
481
|
+
* |---|---|
|
|
482
|
+
* | `"Plinth"` | Plinth mass |
|
|
483
|
+
* | `"Void"` | Void/cut-out |
|
|
484
|
+
* | `"Pergola"` | Pergola structure |
|
|
485
|
+
* | `"Furniture"` | Furniture element |
|
|
486
|
+
* | `"Facade element"` | Facade element |
|
|
487
|
+
* | `"Generic mass"` | Generic mass |
|
|
488
|
+
* | `"Room"` | Room (default for spaces) |
|
|
489
|
+
* | `"Department"` | Department block |
|
|
490
|
+
* | `"Building"` | Building envelope |
|
|
491
|
+
* | `"Revit Import"` | Imported from Revit |
|
|
492
|
+
* | `"Mass"` | Generic mass type |
|
|
493
|
+
* | `"Site"` | Site object |
|
|
494
|
+
*/
|
|
495
|
+
export declare const PluginMassType: z.ZodEnum<{
|
|
496
|
+
Room: "Room";
|
|
497
|
+
Plinth: "Plinth";
|
|
498
|
+
Void: "Void";
|
|
499
|
+
Pergola: "Pergola";
|
|
500
|
+
Furniture: "Furniture";
|
|
501
|
+
"Facade element": "Facade element";
|
|
502
|
+
"Generic mass": "Generic mass";
|
|
503
|
+
Department: "Department";
|
|
504
|
+
Building: "Building";
|
|
505
|
+
"Revit Import": "Revit Import";
|
|
506
|
+
Mass: "Mass";
|
|
507
|
+
Site: "Site";
|
|
508
|
+
}>;
|
|
509
|
+
/**
|
|
510
|
+
* Well-known (built-in) department IDs.
|
|
511
|
+
*
|
|
512
|
+
* | Value | Department |
|
|
513
|
+
* |---|---|
|
|
514
|
+
* | `"DEFAULT"` | Default department |
|
|
515
|
+
* | `"SITE"` | Site department |
|
|
516
|
+
* | `"ENVELOPE"` | Envelope department |
|
|
517
|
+
* | `"CORE"` | Core department |
|
|
518
|
+
*/
|
|
519
|
+
export declare const PluginWellKnownDepartmentId: z.ZodEnum<{
|
|
520
|
+
DEFAULT: "DEFAULT";
|
|
521
|
+
SITE: "SITE";
|
|
522
|
+
ENVELOPE: "ENVELOPE";
|
|
523
|
+
CORE: "CORE";
|
|
524
|
+
}>;
|
|
525
|
+
/**
|
|
526
|
+
* Accepted department ID values — either a {@linkcode PluginWellKnownDepartmentId}
|
|
527
|
+
* or a UUID string for custom (user-created) departments.
|
|
528
|
+
*/
|
|
529
|
+
export declare const PluginDepartmentId: z.ZodUnion<readonly [z.ZodEnum<{
|
|
530
|
+
DEFAULT: "DEFAULT";
|
|
531
|
+
SITE: "SITE";
|
|
532
|
+
ENVELOPE: "ENVELOPE";
|
|
533
|
+
CORE: "CORE";
|
|
534
|
+
}>, z.ZodUUID]>;
|
|
535
|
+
/**
|
|
536
|
+
* Arguments for {@linkcode PluginSpaceApi.update}.
|
|
537
|
+
*
|
|
538
|
+
* | Property | Type | Description |
|
|
539
|
+
* |---|---|---|
|
|
540
|
+
* | `spaceId` | `string` | The space ID to update |
|
|
541
|
+
* | `properties` | `object` | Key/value pairs of properties to update (all optional) |
|
|
542
|
+
* | `properties.room_type` | `string?` | New room type label |
|
|
543
|
+
* | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |
|
|
544
|
+
* | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |
|
|
545
|
+
*/
|
|
546
|
+
export declare const PluginSpaceUpdateArgs: z.ZodObject<{
|
|
547
|
+
spaceId: z.ZodString;
|
|
548
|
+
properties: z.ZodObject<{
|
|
549
|
+
room_type: z.ZodOptional<z.ZodString>;
|
|
550
|
+
massType: z.ZodOptional<z.ZodEnum<{
|
|
551
|
+
Room: "Room";
|
|
552
|
+
Plinth: "Plinth";
|
|
553
|
+
Void: "Void";
|
|
554
|
+
Pergola: "Pergola";
|
|
555
|
+
Furniture: "Furniture";
|
|
556
|
+
"Facade element": "Facade element";
|
|
557
|
+
"Generic mass": "Generic mass";
|
|
558
|
+
Department: "Department";
|
|
559
|
+
Building: "Building";
|
|
560
|
+
"Revit Import": "Revit Import";
|
|
561
|
+
Mass: "Mass";
|
|
562
|
+
Site: "Site";
|
|
563
|
+
}>>;
|
|
564
|
+
spaceType: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
Room: "Room";
|
|
566
|
+
"Program Block": "Program Block";
|
|
567
|
+
Balcony: "Balcony";
|
|
568
|
+
Road: "Road";
|
|
569
|
+
Garden: "Garden";
|
|
570
|
+
Deck: "Deck";
|
|
571
|
+
Pool: "Pool";
|
|
572
|
+
Walkway: "Walkway";
|
|
573
|
+
}>>;
|
|
574
|
+
departmentId: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
575
|
+
DEFAULT: "DEFAULT";
|
|
576
|
+
SITE: "SITE";
|
|
577
|
+
ENVELOPE: "ENVELOPE";
|
|
578
|
+
CORE: "CORE";
|
|
579
|
+
}>, z.ZodUUID]>>;
|
|
580
|
+
}, z.core.$strip>;
|
|
581
|
+
}, z.core.$strip>;
|
|
582
|
+
export type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>;
|
|
583
|
+
/**
|
|
584
|
+
* Result of {@linkcode PluginSpaceApi.update}.
|
|
585
|
+
*
|
|
586
|
+
* Echoes back the `spaceId` and the values of properties that were updated.
|
|
587
|
+
* Properties that were not included in the update request will be `undefined`.
|
|
588
|
+
*
|
|
589
|
+
* | Property | Type | Description |
|
|
590
|
+
* |---|---|---|
|
|
591
|
+
* | `spaceId` | `string` | The space ID that was updated |
|
|
592
|
+
* | `room_type` | `string?` | Updated room type (if changed) |
|
|
593
|
+
* | `massType` | `string?` | Updated mass type (if changed) |
|
|
594
|
+
* | `spaceType` | `string?` | Updated space type (if changed) |
|
|
595
|
+
* | `departmentId` | `string \| null?` | Updated department ID (if changed) |
|
|
596
|
+
*/
|
|
597
|
+
export declare const PluginSpaceUpdateResult: z.ZodObject<{
|
|
598
|
+
spaceId: z.ZodString;
|
|
599
|
+
room_type: z.ZodOptional<z.ZodString>;
|
|
600
|
+
massType: z.ZodOptional<z.ZodString>;
|
|
601
|
+
spaceType: z.ZodOptional<z.ZodString>;
|
|
602
|
+
departmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
603
|
+
}, z.core.$strip>;
|
|
604
|
+
export type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>;
|
|
358
605
|
//# sourceMappingURL=space.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAK7C;;;;;;;;;;;GAWG;AACH,8BAAsB,cAAc;;IAGlC;;;;;;;;;;;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StoryApi {
|
|
|
121
121
|
* | `"totalArea"` | `number` | Total floor area of this story |
|
|
122
122
|
*/
|
|
123
123
|
export declare const PluginStoryGetProperty: z.ZodEnum<{
|
|
124
|
-
height: "height";
|
|
125
|
-
id: "id";
|
|
126
124
|
name: "name";
|
|
125
|
+
id: "id";
|
|
126
|
+
height: "height";
|
|
127
127
|
value: "value";
|
|
128
128
|
base: "base";
|
|
129
129
|
hidden: "hidden";
|
|
@@ -141,9 +141,9 @@ export declare const PluginStoryGetProperty: z.ZodEnum<{
|
|
|
141
141
|
export declare const PluginStoryGetArgs: z.ZodObject<{
|
|
142
142
|
storyValue: z.ZodNumber;
|
|
143
143
|
properties: z.ZodArray<z.ZodEnum<{
|
|
144
|
-
height: "height";
|
|
145
|
-
id: "id";
|
|
146
144
|
name: "name";
|
|
145
|
+
id: "id";
|
|
146
|
+
height: "height";
|
|
147
147
|
value: "value";
|
|
148
148
|
base: "base";
|
|
149
149
|
hidden: "hidden";
|
|
@@ -23,6 +23,8 @@ export declare abstract class PluginUnitsApi {
|
|
|
23
23
|
* to convert from. See {@linkcode PUnitType} for supported values.
|
|
24
24
|
* - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric
|
|
25
25
|
* value in the source unit
|
|
26
|
+
* - {@linkcode PluginUnitsConvertFromArgs.degree args.degree} — (Optional)
|
|
27
|
+
* Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1
|
|
26
28
|
* @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted
|
|
27
29
|
* `value` in Babylon units
|
|
28
30
|
*
|
|
@@ -48,6 +50,8 @@ export declare abstract class PluginUnitsApi {
|
|
|
48
50
|
* to convert to. See {@linkcode PUnitType} for supported values.
|
|
49
51
|
* - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric
|
|
50
52
|
* value in Babylon units
|
|
53
|
+
* - {@linkcode PluginUnitsConvertToArgs.degree args.degree} — (Optional)
|
|
54
|
+
* Degree of the unit: 1 for length, 2 for area, 3 for volume. Defaults to 1
|
|
51
55
|
* @returns A {@linkcode PluginUnitsConvertToResult} containing the converted
|
|
52
56
|
* `value` in the target unit
|
|
53
57
|
*
|
|
@@ -61,6 +65,7 @@ export declare abstract class PluginUnitsApi {
|
|
|
61
65
|
* const areaInMeters = await snaptrude.units.convertTo({
|
|
62
66
|
* unit: "meters",
|
|
63
67
|
* value: info.area!,
|
|
68
|
+
* degree: 2,
|
|
64
69
|
* })
|
|
65
70
|
* ```
|
|
66
71
|
*/
|
|
@@ -94,6 +99,7 @@ export type PUnitType = z.infer<typeof PUnitType>;
|
|
|
94
99
|
* |---|---|---|
|
|
95
100
|
* | `unit` | {@linkcode PUnitType} | Source real-world unit |
|
|
96
101
|
* | `value` | `number` | Numeric value in the source unit |
|
|
102
|
+
* | `degree` | `1 \| 2 \| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |
|
|
97
103
|
*/
|
|
98
104
|
export declare const PluginUnitsConvertFromArgs: z.ZodObject<{
|
|
99
105
|
unit: z.ZodEnum<{
|
|
@@ -106,6 +112,7 @@ export declare const PluginUnitsConvertFromArgs: z.ZodObject<{
|
|
|
106
112
|
miles: "miles";
|
|
107
113
|
}>;
|
|
108
114
|
value: z.ZodNumber;
|
|
115
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
109
116
|
}, z.core.$strip>;
|
|
110
117
|
export type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>;
|
|
111
118
|
/**
|
|
@@ -126,6 +133,7 @@ export type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFrom
|
|
|
126
133
|
* |---|---|---|
|
|
127
134
|
* | `unit` | {@linkcode PUnitType} | Target real-world unit |
|
|
128
135
|
* | `value` | `number` | Numeric value in Babylon units |
|
|
136
|
+
* | `degree` | `1 \| 2 \| 3` | (Optional) Degree of the unit (e.g. 1 for length, 2 for area, 3 for volume). Defaults to 1 |
|
|
129
137
|
*/
|
|
130
138
|
export declare const PluginUnitsConvertToArgs: z.ZodObject<{
|
|
131
139
|
unit: z.ZodEnum<{
|
|
@@ -138,6 +146,7 @@ export declare const PluginUnitsConvertToArgs: z.ZodObject<{
|
|
|
138
146
|
miles: "miles";
|
|
139
147
|
}>;
|
|
140
148
|
value: z.ZodNumber;
|
|
149
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
141
150
|
}, z.core.$strip>;
|
|
142
151
|
export type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>;
|
|
143
152
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/units/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;GASG;AACH,8BAAsB,cAAc;;IAGlC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/units/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;GASG;AACH,8BAAsB,cAAc;;IAGlC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,WAAW,CACzB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,4BAA4B,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;aACa,SAAS,CACvB,IAAI,EAAE,wBAAwB,GAC7B,eAAe,CAAC,0BAA0B,CAAC;CAC/C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;;;;;;;;EAQpB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;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