@snaptrude/plugin-core 0.9.5 → 0.9.7
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/CHANGELOG.md +25 -0
- package/api-manifest.full.json +8442 -0
- package/api-manifest.json +221 -7
- package/dist/api/core/camera/index.d.ts +16 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +14 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/design/create/bulk-items.d.ts +177 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +273 -8
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +29 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +4 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +33 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +5 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +28 -0
- package/dist/api/design/visibility.d.ts.map +1 -1
- package/dist/api/presentation/annotate.d.ts +2 -2
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/handles.d.ts +19 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2019 -1865
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1994 -1865
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/camera/index.ts +17 -0
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/storeys/index.ts +15 -0
- package/src/api/design/create/bulk-items.ts +182 -0
- package/src/api/design/create/index.ts +296 -18
- package/src/api/design/create/opening-fields.ts +29 -0
- package/src/api/design/delete/index.ts +4 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/furniture/index.ts +34 -0
- package/src/api/design/index.ts +5 -0
- package/src/api/design/visibility.ts +34 -0
- package/src/handles.ts +24 -0
package/api-manifest.json
CHANGED
|
@@ -483,6 +483,17 @@
|
|
|
483
483
|
"argsType": "string",
|
|
484
484
|
"resultType": "PluginCoreBuildingsUpdateResult"
|
|
485
485
|
},
|
|
486
|
+
{
|
|
487
|
+
"path": "core.camera.getMode",
|
|
488
|
+
"namespace": "core.camera",
|
|
489
|
+
"summary": "Get the current camera mode. Paired with {@linkcode PluginCameraApi.setMode}.",
|
|
490
|
+
"examplePrompts": [
|
|
491
|
+
"Am I in 2D or 3D?",
|
|
492
|
+
"What view mode is the editor in?\n\n# Example\n```ts\nif ((await snaptrude.core.camera.getMode()) === \"2d\") {\nawait snaptrude.core.camera.setMode(\"3d\")\n}\n```"
|
|
493
|
+
],
|
|
494
|
+
"argsType": null,
|
|
495
|
+
"resultType": "PluginCameraMode"
|
|
496
|
+
},
|
|
486
497
|
{
|
|
487
498
|
"path": "core.camera.getProjection",
|
|
488
499
|
"namespace": "core.camera",
|
|
@@ -3397,6 +3408,19 @@
|
|
|
3397
3408
|
"argsType": "PluginAppMode",
|
|
3398
3409
|
"resultType": "PluginCoreModeSetResult"
|
|
3399
3410
|
},
|
|
3411
|
+
{
|
|
3412
|
+
"path": "core.project.getInfo",
|
|
3413
|
+
"namespace": "core.project",
|
|
3414
|
+
"summary": "Read identity and headline facts about the currently open project — id, display name, unit type, storey count, active storey, and site location when the project is geo-located.",
|
|
3415
|
+
"examplePrompts": [
|
|
3416
|
+
"What is this project called?",
|
|
3417
|
+
"Where is this project located?",
|
|
3418
|
+
"Give me a summary of this project",
|
|
3419
|
+
"How many storeys does this project have?\n\n# Example\n```ts\nconst info = await snaptrude.core.project.getInfo()\nconsole.log(info.name, info.units, info.storeyCount)\n```"
|
|
3420
|
+
],
|
|
3421
|
+
"argsType": null,
|
|
3422
|
+
"resultType": "PluginProjectInfo"
|
|
3423
|
+
},
|
|
3400
3424
|
{
|
|
3401
3425
|
"path": "core.project.settings.getTolerance",
|
|
3402
3426
|
"namespace": "core.project.settings",
|
|
@@ -3819,6 +3843,17 @@
|
|
|
3819
3843
|
"argsType": "number",
|
|
3820
3844
|
"resultType": "PluginStoryGetResult"
|
|
3821
3845
|
},
|
|
3846
|
+
{
|
|
3847
|
+
"path": "core.storeys.getActive",
|
|
3848
|
+
"namespace": "core.storeys",
|
|
3849
|
+
"summary": "Get the active storey's value. Paired with {@linkcode PluginCoreStoreysApi.setActive}.",
|
|
3850
|
+
"examplePrompts": [
|
|
3851
|
+
"Which storey am I on?",
|
|
3852
|
+
"What is the current storey?\n\n# Example\n```ts\nconst storey = await snaptrude.core.storeys.getActive()\n```"
|
|
3853
|
+
],
|
|
3854
|
+
"argsType": null,
|
|
3855
|
+
"resultType": "number"
|
|
3856
|
+
},
|
|
3822
3857
|
{
|
|
3823
3858
|
"path": "core.storeys.list",
|
|
3824
3859
|
"namespace": "core.storeys",
|
|
@@ -4267,7 +4302,23 @@
|
|
|
4267
4302
|
"Add a door that opens into the living room\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.doors.listCatalog()\nconst door = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Entry-01\" },\n)\n// …facing a specific side of the wall (pass a point inside that room):\nconst intoKitchen = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n```"
|
|
4268
4303
|
],
|
|
4269
4304
|
"argsType": "string",
|
|
4270
|
-
"resultType": "ComponentHandle"
|
|
4305
|
+
"resultType": "ComponentHandle",
|
|
4306
|
+
"performance": "For MORE THAN ONE door, call `design.create.doors(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-door creator is N round-trips."
|
|
4307
|
+
},
|
|
4308
|
+
{
|
|
4309
|
+
"path": "design.create.doors",
|
|
4310
|
+
"namespace": "design.create",
|
|
4311
|
+
"summary": "Place **many doors** into host walls in one undoable operation (bulk plural of {@linkcode door}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width` and `height` — the same fields as a `\"door\"` {@linkcode PluginDesignCreateOpeningOptions}. Validate-all-or-throw; one command.",
|
|
4312
|
+
"examplePrompts": [
|
|
4313
|
+
"Add doors to all of these walls at once",
|
|
4314
|
+
"Place a door in every room in one operation",
|
|
4315
|
+
"Bulk add the entrance doors from this schedule",
|
|
4316
|
+
"Put three doors on this wall in a single undo step",
|
|
4317
|
+
"Add all the doors for this floor plan together"
|
|
4318
|
+
],
|
|
4319
|
+
"argsType": "PluginCreateDoorItem[]",
|
|
4320
|
+
"resultType": "ComponentHandle[]",
|
|
4321
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.door` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [entry] = await snaptrude.design.doors.listCatalog() const [front, side] = await snaptrude.design.create.doors([ { catalogId: entry.id, hostWall: wall, position: await v.new(2, 0, 5), label: \"D-01\" }, { catalogId: entry.id, hostWall: wall, position: await v.new(6, 0, 5), width: 1.2 }, ]) // `wall` was re-cut twice and no longer resolves — ask the opening for its host: const currentWall = await snaptrude.design.query.getHost(front) ```"
|
|
4271
4322
|
},
|
|
4272
4323
|
{
|
|
4273
4324
|
"path": "design.create.floor",
|
|
@@ -4280,7 +4331,23 @@
|
|
|
4280
4331
|
"Put a floor at this position with 150mm thickness\n\n# Example\n```ts\nconst rect = await snaptrude.core.geom.create.profileRect(5, 4)\nconst contour = await snaptrude.core.geom.create.contourFromProfile(rect)\nconst floor = await snaptrude.design.create.floor(contour, 0.1)\n```"
|
|
4281
4332
|
],
|
|
4282
4333
|
"argsType": "ContourHandle",
|
|
4283
|
-
"resultType": "ComponentHandle"
|
|
4334
|
+
"resultType": "ComponentHandle",
|
|
4335
|
+
"performance": "For MORE THAN ONE floor, call `design.create.floors(items[])` — one host round-trip and ONE undo entry for the whole batch. Looping this single-floor creator is N round-trips and N undo entries."
|
|
4336
|
+
},
|
|
4337
|
+
{
|
|
4338
|
+
"path": "design.create.floors",
|
|
4339
|
+
"namespace": "design.create",
|
|
4340
|
+
"summary": "Create **many floors** in one undoable operation (bulk plural of {@linkcode floor}). Each item extrudes its own footprint contour (outer profile + holes) upward by its own `thickness`, at its own optional position offset. Validate-all-or-throw; one command.",
|
|
4341
|
+
"examplePrompts": [
|
|
4342
|
+
"Create floors for all these room outlines at once",
|
|
4343
|
+
"Add a floor to every space in one operation",
|
|
4344
|
+
"Bulk create the floor plates for this building",
|
|
4345
|
+
"Lay 100mm floors across these five footprints in one undo step",
|
|
4346
|
+
"Create the ground and first floor slabs together"
|
|
4347
|
+
],
|
|
4348
|
+
"argsType": "PluginCreateFloorItem[]",
|
|
4349
|
+
"resultType": "ComponentHandle[]",
|
|
4350
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.floor` in a loop: build the full `items[]` array first (all contours and offsets up front), then make one call. # Example ```ts const rect = await snaptrude.core.geom.create.profileRect(5, 4) const contour = await snaptrude.core.geom.create.contourFromProfile(rect) const [ground, upper] = await snaptrude.design.create.floors([ { contour, thickness: 0.1 }, { contour, thickness: 0.1, position: await snaptrude.core.math.vec3.new(0, 3, 0) }, ]) ```"
|
|
4284
4351
|
},
|
|
4285
4352
|
{
|
|
4286
4353
|
"path": "design.create.furniture",
|
|
@@ -4295,7 +4362,23 @@
|
|
|
4295
4362
|
"Place a chair here rotated 90 degrees\n\n# Example\n```ts\nconst chair = await snaptrude.design.create.furniture(\n\"6620f1a…\", // from design.furniture.listCatalog()\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Chair-01\" },\n)\n// …placed already turned 90° about the vertical axis:\nconst turned = await snaptrude.design.create.furniture(\n\"6620f1a…\",\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\n90,\n)\n```"
|
|
4296
4363
|
],
|
|
4297
4364
|
"argsType": "string",
|
|
4298
|
-
"resultType": "ComponentHandle"
|
|
4365
|
+
"resultType": "ComponentHandle",
|
|
4366
|
+
"performance": "For MORE THAN ONE item, call `design.create.furnitureItems(items[])` — one host round-trip and ONE undo entry, and a catalog source shared by several items is fetched once. Looping this single-item creator is N round-trips."
|
|
4367
|
+
},
|
|
4368
|
+
{
|
|
4369
|
+
"path": "design.create.furnitureItems",
|
|
4370
|
+
"namespace": "design.create",
|
|
4371
|
+
"summary": "Place **many furniture items** in one undoable operation (bulk plural of {@linkcode furniture}). Each item names a catalog id and an absolute world position (`position.y` is the REST elevation — the same grounding contract as the singular creator), with optional label and rotation. A catalog source shared by several items is fetched and recorded once for the whole batch, so the host — not the caller — owns source persistence (there is no per-item `createNewSourceMesh`). Validate-all-or-throw; one command.",
|
|
4372
|
+
"examplePrompts": [
|
|
4373
|
+
"Place all the desks for this office at once",
|
|
4374
|
+
"Furnish every bedroom in one operation",
|
|
4375
|
+
"Bulk place these chairs around the table",
|
|
4376
|
+
"Add the whole furniture layout in a single undo step",
|
|
4377
|
+
"Drop twenty copies of this chair at these positions"
|
|
4378
|
+
],
|
|
4379
|
+
"argsType": "PluginCreateFurnitureItem[]",
|
|
4380
|
+
"resultType": "ComponentHandle[]",
|
|
4381
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.furniture` in a loop: build the full `items[]` array first (all positions and angles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [chair] = await snaptrude.design.furniture.listCatalog() const placed = await snaptrude.design.create.furnitureItems([ { catalogId: chair.id, position: await v.new(3, 0, 5), label: \"Chair-01\" }, { catalogId: chair.id, position: await v.new(4, 0, 5), angleInDegrees: 90 }, { catalogId: chair.id, position: await v.new(5, 0, 5), angleInDegrees: 180 }, ]) ```"
|
|
4299
4382
|
},
|
|
4300
4383
|
{
|
|
4301
4384
|
"path": "design.create.mass",
|
|
@@ -4332,7 +4415,7 @@
|
|
|
4332
4415
|
],
|
|
4333
4416
|
"argsType": "PluginDesignCreateOpeningOptions",
|
|
4334
4417
|
"resultType": "ComponentHandle",
|
|
4335
|
-
"performance": "Single-opening creator — use it for one hosted opening.
|
|
4418
|
+
"performance": "Single-opening creator — use it for one hosted opening. For MORE THAN ONE, call `design.create.doors(items[])` / `design.create.windows(items[])`: the same per-item fields, one host round-trip, ONE undo entry. # Example ```ts const opening = await snaptrude.design.create.opening({ kind: \"window\", catalogId: windowType.id, hostWall: wall, position: await snaptrude.core.math.vec3.new(3, 0, 5), width: 1.2, height: 1.5, sillHeight: 0.9, }) ```"
|
|
4336
4419
|
},
|
|
4337
4420
|
{
|
|
4338
4421
|
"path": "design.create.referenceLines",
|
|
@@ -4434,6 +4517,21 @@
|
|
|
4434
4517
|
"argsType": "PluginStaircasePreset",
|
|
4435
4518
|
"resultType": "ComponentHandle"
|
|
4436
4519
|
},
|
|
4520
|
+
{
|
|
4521
|
+
"path": "design.create.wallRuns",
|
|
4522
|
+
"namespace": "design.create",
|
|
4523
|
+
"summary": "Create **many wall runs** in one undoable operation (bulk plural of {@linkcode walls}). Each item is one full run — a wall per curve in that item's profile chain, mitred at shared endpoints. Junctions resolve within a run, not between runs. Each item carries its own dimensions, `wallType` and `storey`, so a single call can build a whole floor plate or several storeys at once. Validate-all-or-throw; one command.",
|
|
4524
|
+
"examplePrompts": [
|
|
4525
|
+
"Draw all the walls of this floor plan at once",
|
|
4526
|
+
"Build every room's perimeter in one operation",
|
|
4527
|
+
"Bulk create wall runs from these centerlines",
|
|
4528
|
+
"Create the walls for both storeys in a single undo step",
|
|
4529
|
+
"Turn these polylines into 200mm brick walls together"
|
|
4530
|
+
],
|
|
4531
|
+
"argsType": "PluginCreateWallRunItem[]",
|
|
4532
|
+
"resultType": "ComponentHandle[][]",
|
|
4533
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.walls` in a loop: build the full `items[]` array first (all profiles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const ground = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), await v.new(8, 0, 6), ]) const upper = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), ]) const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([ { profile: ground, height: 3, thickness: 0.2 }, { profile: upper, height: 3, storey: 2 }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
|
|
4534
|
+
},
|
|
4437
4535
|
{
|
|
4438
4536
|
"path": "design.create.walls",
|
|
4439
4537
|
"namespace": "design.create",
|
|
@@ -4448,7 +4546,8 @@
|
|
|
4448
4546
|
"Build the perimeter in exposed concrete walls\n\n# Example\n```ts\nconst v = snaptrude.core.math.vec3\nconst centerlines = await snaptrude.core.geom.create.profileFromLinePoints([\nawait v.new(0, 0, 0),\nawait v.new(8, 0, 0),\nawait v.new(8, 0, 6),\n])\nconst walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)\n// …built as a specific wall type (layers/material/thickness from the type):\nconst [brick] = await snaptrude.design.types.list(\"wall\")\nconst brickWalls = await snaptrude.design.create.walls(\ncenterlines, 3, undefined, brick.label,\n)\n```"
|
|
4449
4547
|
],
|
|
4450
4548
|
"argsType": "ProfileHandle",
|
|
4451
|
-
"resultType": "ComponentHandle[]"
|
|
4549
|
+
"resultType": "ComponentHandle[]",
|
|
4550
|
+
"performance": "For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one host round-trip and ONE undo entry for every run in the batch. Looping this single-run creator is N round-trips and N undo entries."
|
|
4452
4551
|
},
|
|
4453
4552
|
{
|
|
4454
4553
|
"path": "design.create.window",
|
|
@@ -4463,7 +4562,23 @@
|
|
|
4463
4562
|
"Add a casement window opening toward the garden side\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.windows.listCatalog()\nconst window = await snaptrude.design.create.window(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Win-01\" },\n)\n```"
|
|
4464
4563
|
],
|
|
4465
4564
|
"argsType": "string",
|
|
4466
|
-
"resultType": "ComponentHandle"
|
|
4565
|
+
"resultType": "ComponentHandle",
|
|
4566
|
+
"performance": "For MORE THAN ONE window, call `design.create.windows(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-window creator is N round-trips."
|
|
4567
|
+
},
|
|
4568
|
+
{
|
|
4569
|
+
"path": "design.create.windows",
|
|
4570
|
+
"namespace": "design.create",
|
|
4571
|
+
"summary": "Place **many windows** into host walls in one undoable operation (bulk plural of {@linkcode window}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width`, `height` and `sillHeight` — the same fields as a `\"window\"` {@linkcode PluginDesignCreateOpeningOptions}. `sillHeight` is measured from the host wall base to the BOTTOM of the window. Validate-all-or-throw; one command.",
|
|
4572
|
+
"examplePrompts": [
|
|
4573
|
+
"Add windows along this whole facade at once",
|
|
4574
|
+
"Place a window in every bedroom in one operation",
|
|
4575
|
+
"Bulk add the windows from this schedule",
|
|
4576
|
+
"Put four windows on this wall in a single undo step",
|
|
4577
|
+
"Add all the windows with a 0.9m sill height together"
|
|
4578
|
+
],
|
|
4579
|
+
"argsType": "PluginCreateWindowItem[]",
|
|
4580
|
+
"resultType": "ComponentHandle[]",
|
|
4581
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.window` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [casement] = await snaptrude.design.windows.listCatalog() const placed = await snaptrude.design.create.windows([ { catalogId: casement.id, hostWall: wall, position: await v.new(2, 0, 5), sillHeight: 0.9 }, { catalogId: casement.id, hostWall: wall, position: await v.new(5, 0, 5), sillHeight: 0.9 }, ]) const currentWall = await snaptrude.design.query.getHost(placed[0]) ```"
|
|
4467
4582
|
},
|
|
4468
4583
|
{
|
|
4469
4584
|
"path": "design.delete.entities",
|
|
@@ -4480,6 +4595,82 @@
|
|
|
4480
4595
|
"resultType": "PluginDesignChangeResult",
|
|
4481
4596
|
"performance": "Array delete — pass every target in one call (one host round-trip). There is no per-item delete; collect the whole set and never loop this per entity. # Example ```ts // Hard-delete every furniture item on storey 2 (a single undo entry) const furniture = await snaptrude.design.query.listFurniture({ storeys: [2] }) if (furniture.length > 0) { const { affected } = await snaptrude.design.delete.entities(furniture) } ```"
|
|
4482
4597
|
},
|
|
4598
|
+
{
|
|
4599
|
+
"path": "design.dimensions.create",
|
|
4600
|
+
"namespace": "design.dimensions",
|
|
4601
|
+
"summary": "Draw one dimension line between two world points, anchored to a component.",
|
|
4602
|
+
"examplePrompts": [
|
|
4603
|
+
"Dimension every wall on level 2",
|
|
4604
|
+
"Add a dimension line along this wall",
|
|
4605
|
+
"Measure the width of this room and label it on the plan\n\n# Example\n```ts\nconst { design, core } = snaptrude\nconst v = core.math.vec3\nconst curve = core.geom.query.curve\nfor (const wall of await design.query.listWalls({ storeys: [2] })) {\nconst cl = await design.query.geometry.getCenterline(wall)\nif (!cl) continue\nconst a = await curve.getStartPoint(cl)\nconst b = await curve.getEndPoint(cl)\nawait design.dimensions.create(\nawait v.new(a.x, a.y, a.z),\nawait v.new(b.x, b.y, b.z),\nwall,\n)\n}\n```"
|
|
4606
|
+
],
|
|
4607
|
+
"argsType": "Vec3Handle",
|
|
4608
|
+
"resultType": "DimensionHandle"
|
|
4609
|
+
},
|
|
4610
|
+
{
|
|
4611
|
+
"path": "design.dimensions.delete",
|
|
4612
|
+
"namespace": "design.dimensions",
|
|
4613
|
+
"summary": "Delete dimension lines — the same hard removal as selecting them and pressing Delete. Undoable as a **single** entry for the whole batch.",
|
|
4614
|
+
"examplePrompts": [
|
|
4615
|
+
"Remove all dimension lines",
|
|
4616
|
+
"Delete the dimensions on this wall",
|
|
4617
|
+
"Clear the measurements I added to level 2"
|
|
4618
|
+
],
|
|
4619
|
+
"argsType": "DimensionHandle[]",
|
|
4620
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4621
|
+
"performance": "Array API — pass the whole set in one call (one host round-trip, one undo entry). Never loop this per dimension. # Example ```ts const dims = snaptrude.design.dimensions const onWall = await dims.list({ anchors: [wall] }) if (onWall.length > 0) await dims.delete(onWall.map((d) => d.id)) ```"
|
|
4622
|
+
},
|
|
4623
|
+
{
|
|
4624
|
+
"path": "design.dimensions.get",
|
|
4625
|
+
"namespace": "design.dimensions",
|
|
4626
|
+
"summary": "Read one dimension line by handle.",
|
|
4627
|
+
"examplePrompts": [
|
|
4628
|
+
"Read the dimension line I just created",
|
|
4629
|
+
"How long is this dimension and what does its label say?",
|
|
4630
|
+
"Check whether that dimension line still exists\n\n# Example\n```ts\nconst dim = await snaptrude.design.dimensions.get(handle)\nif (dim) console.log(dim.label, dim.length, dim.storey)\n```"
|
|
4631
|
+
],
|
|
4632
|
+
"argsType": "DimensionHandle",
|
|
4633
|
+
"resultType": "PluginDimensionLine | null"
|
|
4634
|
+
},
|
|
4635
|
+
{
|
|
4636
|
+
"path": "design.dimensions.hide",
|
|
4637
|
+
"namespace": "design.dimensions",
|
|
4638
|
+
"summary": "Hide dimension lines from the viewport — the same as the right-click \"Hide\" action (it sets the user Hide flag, `isHidden`). Undoable. Already-hidden dimensions are skipped and are not reported in `affected`.",
|
|
4639
|
+
"examplePrompts": [
|
|
4640
|
+
"Hide the dimensions on this storey",
|
|
4641
|
+
"Hide every dimension line while I present",
|
|
4642
|
+
"Temporarily hide the measurements on level 3"
|
|
4643
|
+
],
|
|
4644
|
+
"argsType": "DimensionHandle[]",
|
|
4645
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4646
|
+
"performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const onLevel3 = await dims.list({ storeys: [3] }) const { affected } = await dims.hide(onLevel3.map((d) => d.id)) ```"
|
|
4647
|
+
},
|
|
4648
|
+
{
|
|
4649
|
+
"path": "design.dimensions.list",
|
|
4650
|
+
"namespace": "design.dimensions",
|
|
4651
|
+
"summary": "List the dimension lines in the project as full records.",
|
|
4652
|
+
"examplePrompts": [
|
|
4653
|
+
"List all the dimension lines in this model",
|
|
4654
|
+
"Which dimensions are on level 3?",
|
|
4655
|
+
"Flag any dimension line shorter than 600 mm"
|
|
4656
|
+
],
|
|
4657
|
+
"argsType": "{\n storeys?: number[]\n anchors?: ComponentHandle[]\n isHidden?: boolean\n }",
|
|
4658
|
+
"resultType": "PluginDimensionLine[]",
|
|
4659
|
+
"performance": "Array read — one host round-trip returns every record. Filter in one call rather than calling `get` per dimension. # Example ```ts const units = snaptrude.core.units const min = await units.convert(600, \"millimeters\", await units.getBabylonType()) const short = (await snaptrude.design.dimensions.list()).filter( (d) => d.length < min, ) console.log(short.map((d) => `${d.label} on storey ${d.storey}`)) ```"
|
|
4660
|
+
},
|
|
4661
|
+
{
|
|
4662
|
+
"path": "design.dimensions.show",
|
|
4663
|
+
"namespace": "design.dimensions",
|
|
4664
|
+
"summary": "Reveal hidden dimension lines — clear the user Hide flag, the inverse of {@linkcode PluginDesignDimensionsApi.hide}. Undoable. Already-visible dimensions are skipped and are not reported in `affected`.",
|
|
4665
|
+
"examplePrompts": [
|
|
4666
|
+
"Show the dimension lines again",
|
|
4667
|
+
"Unhide all the hidden dimensions",
|
|
4668
|
+
"Bring back the measurements I hid on this storey"
|
|
4669
|
+
],
|
|
4670
|
+
"argsType": "DimensionHandle[]",
|
|
4671
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4672
|
+
"performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const hidden = await dims.list({ isHidden: true }) await dims.show(hidden.map((d) => d.id)) ```"
|
|
4673
|
+
},
|
|
4483
4674
|
{
|
|
4484
4675
|
"path": "design.doors.exists",
|
|
4485
4676
|
"namespace": "design.doors",
|
|
@@ -4757,6 +4948,17 @@
|
|
|
4757
4948
|
"argsType": "\"team\" | \"general\"",
|
|
4758
4949
|
"resultType": "PluginFurnitureCatalogItem[]"
|
|
4759
4950
|
},
|
|
4951
|
+
{
|
|
4952
|
+
"path": "design.furniture.listCatalogGroups",
|
|
4953
|
+
"namespace": "design.furniture",
|
|
4954
|
+
"summary": "List the furniture catalog's groups. Matches {@linkcode PluginDesignDoorsApi.listCatalogGroups} and {@linkcode PluginDesignWindowsApi.listCatalogGroups}, so all three catalog surfaces are named alike.",
|
|
4955
|
+
"examplePrompts": [
|
|
4956
|
+
"What furniture groups are available?",
|
|
4957
|
+
"List the furniture categories in this project\n\n# Example\n```ts\nconst groups = await snaptrude.design.furniture.listCatalogGroups()\nfor (const g of groups) console.log(g.dbType, g.label, g.source)\n```"
|
|
4958
|
+
],
|
|
4959
|
+
"argsType": null,
|
|
4960
|
+
"resultType": "PluginObjectCatalogGroup[]"
|
|
4961
|
+
},
|
|
4760
4962
|
{
|
|
4761
4963
|
"path": "design.furniture.listCategories",
|
|
4762
4964
|
"namespace": "design.furniture",
|
|
@@ -4768,7 +4970,8 @@
|
|
|
4768
4970
|
"Which furniture categories can I filter by?\n\n# Example\n```ts\nconst categories = await snaptrude.design.furniture.listCategories()\nconst [first] = categories\nconst items = await snaptrude.design.furniture.listCatalog(undefined, first)\nconsole.log(first, \"→\", items.length, \"items\")\n```"
|
|
4769
4971
|
],
|
|
4770
4972
|
"argsType": null,
|
|
4771
|
-
"resultType": "string[]"
|
|
4973
|
+
"resultType": "string[]",
|
|
4974
|
+
"deprecated": "design.furniture.listCatalogGroups"
|
|
4772
4975
|
},
|
|
4773
4976
|
{
|
|
4774
4977
|
"path": "design.furniture.setDimensions",
|
|
@@ -5936,6 +6139,17 @@
|
|
|
5936
6139
|
"argsType": "ComponentHandle[]",
|
|
5937
6140
|
"resultType": "PluginDesignChangeResult"
|
|
5938
6141
|
},
|
|
6142
|
+
{
|
|
6143
|
+
"path": "design.visibility.show",
|
|
6144
|
+
"namespace": "design.visibility",
|
|
6145
|
+
"summary": "Reveal specific hidden components — the inverse of {@linkcode PluginDesignVisibilityApi.hide}. Use {@linkcode PluginDesignVisibilityApi.showAll} to reveal everything.",
|
|
6146
|
+
"examplePrompts": [
|
|
6147
|
+
"Show these walls again",
|
|
6148
|
+
"Unhide the selected furniture\n\n# Example\n```ts\nawait snaptrude.design.visibility.show([wall])\n```"
|
|
6149
|
+
],
|
|
6150
|
+
"argsType": "ComponentHandle[]",
|
|
6151
|
+
"resultType": "PluginDesignChangeResult"
|
|
6152
|
+
},
|
|
5939
6153
|
{
|
|
5940
6154
|
"path": "design.visibility.showAll",
|
|
5941
6155
|
"namespace": "design.visibility",
|
|
@@ -53,6 +53,22 @@ export declare abstract class PluginCameraApi {
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
abstract setStandardView(view: PluginStandardView): PluginApiReturn<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Get the current camera mode. Paired with {@linkcode PluginCameraApi.setMode}.
|
|
58
|
+
*
|
|
59
|
+
* @returns `"2d"` when the editor is in plan view, `"3d"` otherwise.
|
|
60
|
+
*
|
|
61
|
+
* @examplePrompt Am I in 2D or 3D?
|
|
62
|
+
* @examplePrompt What view mode is the editor in?
|
|
63
|
+
*
|
|
64
|
+
* # Example
|
|
65
|
+
* ```ts
|
|
66
|
+
* if ((await snaptrude.core.camera.getMode()) === "2d") {
|
|
67
|
+
* await snaptrude.core.camera.setMode("3d")
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
abstract getMode(): PluginApiReturn<PluginCameraMode>;
|
|
56
72
|
/**
|
|
57
73
|
* Toggle the modelling mode between `2d` (plan) and `3d`. Mirrors the canvas
|
|
58
74
|
* 2D/3D toggle: `3d` enters the isometric perspective view, `2d` drops to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/camera/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;GAQG;AACH,8BAAsB,eAAe;;IAGnC;;;;;;;;;;;;;;;;;;OAkBG;aACa,QAAQ,CACtB,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,UAAU,GACjB,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;OAmBG;aACa,eAAe,CAC7B,IAAI,EAAE,kBAAkB,GACvB,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;OAiBG;aACa,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CAAC,OAAO,CAAC;IAEzE;;;;;;;;;;;;;;;;OAgBG;aACa,aAAa,IAAI,eAAe,CAAC,sBAAsB,CAAC;IAExE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,aAAa,CAC3B,UAAU,EAAE,sBAAsB,GACjC,eAAe,CAAC,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;OAgBG;aACa,WAAW,IAAI,eAAe,CAAC,OAAO,CAAC;IAEvD;;;;;;;;;;;;;;;;;OAiBG;aACa,aAAa,IAAI,eAAe,CAAC,OAAO,CAAC;CAC1D;AAED;;;GAGG;AACH,eAAO,MAAM,kBA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ACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;iBAE1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,+BAA+B,CACvC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;;iBAElC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;;;;iBAExC,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,6BAA6B,CACrC,CAAA"}
|
|
@@ -209,7 +209,9 @@ export declare abstract class PluginCoreIoImportApi {
|
|
|
209
209
|
* @returns the placed {@linkcode ComponentHandle}.
|
|
210
210
|
* @throws if writes are disabled, the source can't be loaded, the format is
|
|
211
211
|
* unsupported, conversion/placement fails, or the converted model cannot be
|
|
212
|
-
* found in the library after upload
|
|
212
|
+
* found in the library after upload; `PRECONDITION_FAILED`
|
|
213
|
+
* (`details.engineCode: "TOOL_ACTIVE"`) while the interactive furniture tool is
|
|
214
|
+
* active — finish or cancel it first.
|
|
213
215
|
*
|
|
214
216
|
* @examplePrompt Import this SketchUp model onto storey 1
|
|
215
217
|
* @examplePrompt Bring in this OBJ file and place it at the origin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/import/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAKrB,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;aACa,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,CAAC,cAAc,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;aACa,GAAG,CACjB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,eAAe,CAAC,cAAc,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;aACa,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/import/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAKrB,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;aACa,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC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G;AACH,eAAO,MAAM,mBAAmB;;iBAE9B,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
|
@@ -3,11 +3,41 @@ import { PluginApiReturn } from "../../../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Project-level settings and info.
|
|
5
5
|
*
|
|
6
|
-
* Accessed via `snaptrude.core.project`.
|
|
6
|
+
* Accessed via `snaptrude.core.project`. Exposes
|
|
7
|
+
* {@linkcode PluginProjectApi.getInfo} (project identity) and
|
|
7
8
|
* {@linkcode PluginProjectApi.settings} (snap + grid controls).
|
|
8
9
|
*/
|
|
9
10
|
export declare abstract class PluginProjectApi {
|
|
10
11
|
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Read identity and headline facts about the currently open project — id,
|
|
14
|
+
* display name, unit type, storey count, active storey, and site location
|
|
15
|
+
* when the project is geo-located.
|
|
16
|
+
*
|
|
17
|
+
* `activeStorey` and `storeyCount` are both scoped to the ACTIVE BUILDING, so
|
|
18
|
+
* they always describe the same building. In a multi-building project
|
|
19
|
+
* `storeyCount` is therefore NOT the total across every building — use
|
|
20
|
+
* `core.storeys.list()`, which spans all buildings, for that.
|
|
21
|
+
*
|
|
22
|
+
* @returns A {@linkcode PluginProjectInfo}. `name` is `null` only when the
|
|
23
|
+
* project genuinely has no title; `location` is `null` only when the project
|
|
24
|
+
* is not geo-located. Neither is used to signal a failure.
|
|
25
|
+
* @throws PRECONDITION_FAILED when no project is open.
|
|
26
|
+
* @throws OPERATION_FAILED when the project lookup or the site-location read
|
|
27
|
+
* fails. A failed read is never reported as `null`.
|
|
28
|
+
*
|
|
29
|
+
* @examplePrompt What is this project called?
|
|
30
|
+
* @examplePrompt Where is this project located?
|
|
31
|
+
* @examplePrompt Give me a summary of this project
|
|
32
|
+
* @examplePrompt How many storeys does this project have?
|
|
33
|
+
*
|
|
34
|
+
* # Example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const info = await snaptrude.core.project.getInfo()
|
|
37
|
+
* console.log(info.name, info.units, info.storeyCount)
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
abstract getInfo(): PluginApiReturn<PluginProjectInfo>;
|
|
11
41
|
/** Project settings — snaps and grid. See {@linkcode PluginProjectSettingsApi}. */
|
|
12
42
|
abstract settings: PluginProjectSettingsApi;
|
|
13
43
|
}
|
|
@@ -396,4 +426,41 @@ export declare const PluginToleranceArgs: z.ZodObject<{
|
|
|
396
426
|
value: z.ZodNumber;
|
|
397
427
|
}, z.core.$strip>;
|
|
398
428
|
export type PluginToleranceArgs = z.infer<typeof PluginToleranceArgs>;
|
|
429
|
+
/**
|
|
430
|
+
* Identity and headline facts about the currently open project.
|
|
431
|
+
*
|
|
432
|
+
* `location` is a read-only projection of {@linkcode PluginProgramSiteApi.getLocation}
|
|
433
|
+
* — `program.site.*` remains the full site surface (context, weather, polygons).
|
|
434
|
+
* It is mirrored here because "what and where is this project" is one question.
|
|
435
|
+
*
|
|
436
|
+
* | Property | Type | Description |
|
|
437
|
+
* |---|---|---|
|
|
438
|
+
* | `projectId` | `string` | The open project's id (floorkey) |
|
|
439
|
+
* | `name` | `string \| null` | Display name; `null` only when the project has no title (a failed lookup throws) |
|
|
440
|
+
* | `units` | {@linkcode PUnitType} | The project's unit type |
|
|
441
|
+
* | `activeStorey` | `number` | The active storey value, in the active building |
|
|
442
|
+
* | `storeyCount` | `number` | How many storeys the ACTIVE BUILDING has (not the project-wide total — `core.storeys.list()` spans all buildings) |
|
|
443
|
+
* | `location` | `{ latitude, longitude } \| null` | Site location; `null` only when not geo-located (a failed read throws) |
|
|
444
|
+
*/
|
|
445
|
+
export declare const PluginProjectInfo: z.ZodObject<{
|
|
446
|
+
projectId: z.ZodString;
|
|
447
|
+
name: z.ZodNullable<z.ZodString>;
|
|
448
|
+
units: z.ZodEnum<{
|
|
449
|
+
meters: "meters";
|
|
450
|
+
"feet-inches": "feet-inches";
|
|
451
|
+
inches: "inches";
|
|
452
|
+
centimeters: "centimeters";
|
|
453
|
+
millimeters: "millimeters";
|
|
454
|
+
kilometers: "kilometers";
|
|
455
|
+
miles: "miles";
|
|
456
|
+
babylon: "babylon";
|
|
457
|
+
}>;
|
|
458
|
+
activeStorey: z.ZodNumber;
|
|
459
|
+
storeyCount: z.ZodNumber;
|
|
460
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
461
|
+
latitude: z.ZodNumber;
|
|
462
|
+
longitude: z.ZodNumber;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
export type PluginProjectInfo = z.infer<typeof PluginProjectInfo>;
|
|
399
466
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;;GAMG;AACH,8BAAsB,gBAAgB;;IAGpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;aACa,OAAO,IAAI,eAAe,CAAC,iBAAiB,CAAC;IAE7D,mFAAmF;IACnF,SAAgB,QAAQ,EAAE,wBAAwB,CAAA;CACnD;AAED;;;;GAIG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;OAiBG;aAC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AC;IAC1D;;;;;;;;;;;;;OAaG;aACa,eAAe,IAAI,eAAe,CAAC,OAAO,CAAC;CAC5D;AAED;;;;GAIG;AACH,8BAAsB,aAAa;;IAGjC;;;;;;;;;;;;OAYG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAClD;;;;;;;;;;;;OAYG;aACa,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC;IACnD;;;;;;;;;;;;;;;;OAgBG;aACa,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC;IACjE;;;;;;;;;;;;;;OAcG;aACa,QAAQ,IAAI,eAAe,CAAC,MAAM,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;iBAE9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;iBAE9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;iBAE9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;iBAS5B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -137,6 +137,20 @@ export declare abstract class PluginCoreStoreysApi {
|
|
|
137
137
|
abstract update(storyValue: number, height?: number, options?: {
|
|
138
138
|
name?: string;
|
|
139
139
|
}): PluginApiReturn<PluginStoryUpdateResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Get the active storey's value. Paired with {@linkcode PluginCoreStoreysApi.setActive}.
|
|
142
|
+
*
|
|
143
|
+
* @returns The active storey value, in the same numbering `list` and `get` use.
|
|
144
|
+
*
|
|
145
|
+
* @examplePrompt Which storey am I on?
|
|
146
|
+
* @examplePrompt What is the current storey?
|
|
147
|
+
*
|
|
148
|
+
* # Example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const storey = await snaptrude.core.storeys.getActive()
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
abstract getActive(): PluginApiReturn<number>;
|
|
140
154
|
/**
|
|
141
155
|
* Make a storey the active storey — the same as clicking it in the storey/layer
|
|
142
156
|
* panel. Subsequent draws and creates target this storey, and in 2D the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/storeys/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EAEpB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;GAaG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,GAAG,CACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,sBAAsB,EAAE,GACnC,eAAe,CAAC,oBAAoB,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,IAAI,IAAI,eAAe,CAAC,2BAA2B,CAAC;IAEpE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,MAAM,CACpB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,eAAe,CAAC,uBAAuB,CAAC;IAE3C;;;;;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