@snaptrude/plugin-core 0.3.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +130 -48
- package/CHANGELOG.md +163 -0
- package/api-manifest.full.json +5600 -0
- package/api-manifest.json +5502 -0
- package/dist/api/analysis/heatmaps.d.ts +234 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +44 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +230 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +247 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +72 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +24 -23
- package/dist/api/core/geom/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +402 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +51 -1
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +392 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +35 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +206 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +286 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +111 -128
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +120 -102
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +399 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +755 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +45 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +837 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +63 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +268 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +123 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +153 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +41 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +297 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +140 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +1011 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +221 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +282 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +87 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +178 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +189 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +261 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
- package/dist/api/entity/department.d.ts +0 -98
- package/dist/api/entity/department.d.ts.map +1 -1
- package/dist/api/entity/index.d.ts +9 -9
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +49 -106
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +484 -251
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +49 -39
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +22 -12
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +440 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +81 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +113 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +46 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +176 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +296 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +360 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +174 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +431 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +69 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +63 -0
- package/dist/api/program/layout.d.ts.map +1 -0
- package/dist/api/program/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +451 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2041 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/handles.d.ts +171 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +7 -5
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4344 -899
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3682 -865
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/scripts/generate-manifest.mjs +193 -0
- package/scripts/generate-manifest.test.mjs +215 -0
- package/src/api/analysis/heatmaps.ts +256 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +46 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/comment/index.ts +258 -0
- package/src/api/core/geom/create/index.ts +293 -0
- package/src/api/core/geom/delete/index.ts +78 -0
- package/src/api/core/geom/index.ts +24 -23
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +444 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +51 -1
- package/src/api/core/io/import/index.ts +432 -0
- package/src/api/core/io/index.ts +37 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +214 -0
- package/src/api/core/io/underlay/index.ts +295 -0
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/quat.ts +112 -235
- package/src/api/core/math/vec3.ts +124 -159
- package/src/api/core/project/index.ts +418 -0
- package/src/api/core/tags.ts +808 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/zoom/index.ts +47 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/index.ts +895 -0
- package/src/api/design/delete/index.ts +67 -0
- package/src/api/design/doors/index.ts +285 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/furniture/index.ts +130 -0
- package/src/api/design/index.ts +162 -0
- package/src/api/design/lock.ts +42 -0
- package/src/api/design/materials/index.ts +301 -0
- package/src/api/design/query/geometry/index.ts +166 -0
- package/src/api/design/query/index.ts +937 -0
- package/src/api/design/query/spaces.ts +132 -0
- package/src/api/design/selection/index.ts +273 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +93 -0
- package/src/api/design/update/index.ts +117 -0
- package/src/api/design/windows/index.ts +207 -0
- package/src/api/entity/buildableEnvelope.ts +318 -0
- package/src/api/entity/department.ts +0 -113
- package/src/api/entity/index.ts +9 -9
- package/src/api/entity/referenceLine.ts +50 -38
- package/src/api/entity/space.ts +285 -226
- package/src/api/entity/story.ts +53 -42
- package/src/api/index.ts +22 -12
- package/src/api/presentation/aiInspiration.ts +362 -0
- package/src/api/presentation/diagrams.ts +84 -0
- package/src/api/presentation/import.ts +112 -0
- package/src/api/presentation/index.ts +48 -0
- package/src/api/presentation/sheets.ts +198 -0
- package/src/api/presentation/views.ts +303 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +335 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +171 -0
- package/src/api/program/departments.ts +465 -0
- package/src/api/program/index.ts +71 -0
- package/src/api/program/layout.ts +68 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +419 -0
- package/src/api/program/spreadsheet.ts +2075 -0
- package/src/handles.ts +194 -0
- package/src/host-utils.ts +10 -6
- package/src/index.ts +1 -0
- package/dist/api/core/geom/arc.d.ts +0 -81
- package/dist/api/core/geom/arc.d.ts.map +0 -1
- package/dist/api/core/geom/curve.d.ts +0 -70
- package/dist/api/core/geom/curve.d.ts.map +0 -1
- package/dist/api/core/geom/line.d.ts +0 -56
- package/dist/api/core/geom/line.d.ts.map +0 -1
- package/dist/api/core/geom/profile.d.ts +0 -121
- package/dist/api/core/geom/profile.d.ts.map +0 -1
- package/dist/api/tools/copy.d.ts +0 -59
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -33
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/material.d.ts +0 -51
- package/dist/api/tools/material.d.ts.map +0 -1
- package/dist/api/tools/offset.d.ts +0 -43
- package/dist/api/tools/offset.d.ts.map +0 -1
- package/dist/api/tools/selection.d.ts +0 -48
- package/dist/api/tools/selection.d.ts.map +0 -1
- package/dist/api/tools/transform.d.ts +0 -114
- package/dist/api/tools/transform.d.ts.map +0 -1
- package/dist/api/units/index.d.ts +0 -163
- package/dist/api/units/index.d.ts.map +0 -1
- package/src/api/core/geom/arc.ts +0 -70
- package/src/api/core/geom/curve.ts +0 -41
- package/src/api/core/geom/line.ts +0 -53
- package/src/api/core/geom/profile.ts +0 -94
- package/src/api/tools/copy.ts +0 -55
- package/src/api/tools/index.ts +0 -39
- package/src/api/tools/material.ts +0 -49
- package/src/api/tools/offset.ts +0 -43
- package/src/api/tools/selection.ts +0 -51
- package/src/api/tools/transform.ts +0 -117
- package/src/api/units/index.ts +0 -163
|
@@ -0,0 +1,2041 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Program spreadsheet — read a building's program/takeoff data and render, build,
|
|
5
|
+
* and export report sheets from it. The surface spans two levels:
|
|
6
|
+
*
|
|
7
|
+
* - **High-level renders** — {@linkcode PluginProgramSpreadsheetApi.render} (rows +
|
|
8
|
+
* columns → a formatted, titled table) and its dataset specializations
|
|
9
|
+
* {@linkcode PluginProgramSpreadsheetApi.renderTakeoff} /
|
|
10
|
+
* {@linkcode PluginProgramSpreadsheetApi.renderProgram} (the host pulls the
|
|
11
|
+
* dataset). Authors think "render my takeoff to a sheet".
|
|
12
|
+
* - **Low-level construction** — for authors who need fine control:
|
|
13
|
+
* {@linkcode PluginProgramSpreadsheetApi.createSheet},
|
|
14
|
+
* {@linkcode PluginProgramSpreadsheetApi.setValues},
|
|
15
|
+
* {@linkcode PluginProgramSpreadsheetApi.setFormulas},
|
|
16
|
+
* {@linkcode PluginProgramSpreadsheetApi.setStyles},
|
|
17
|
+
* {@linkcode PluginProgramSpreadsheetApi.mergeCells},
|
|
18
|
+
* {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting},
|
|
19
|
+
* {@linkcode PluginProgramSpreadsheetApi.recalculate}, and
|
|
20
|
+
* {@linkcode PluginProgramSpreadsheetApi.transaction} (atomic, undoable batch).
|
|
21
|
+
*
|
|
22
|
+
* Plus dataset reads ({@linkcode PluginProgramSpreadsheetApi.getProgram} /
|
|
23
|
+
* {@linkcode PluginProgramSpreadsheetApi.getTakeoff} — the data the render* methods
|
|
24
|
+
* draw), sheet reads ({@linkcode PluginProgramSpreadsheetApi.listSheets} /
|
|
25
|
+
* {@linkcode PluginProgramSpreadsheetApi.getSheetData}), charts + emphasis
|
|
26
|
+
* ({@linkcode PluginProgramSpreadsheetApi.addChart} /
|
|
27
|
+
* {@linkcode PluginProgramSpreadsheetApi.highlightCells}), workbook file export
|
|
28
|
+
* ({@linkcode PluginProgramSpreadsheetApi.export}), reusable
|
|
29
|
+
* {@linkcode PluginProgramSpreadsheetApi.templates}, live
|
|
30
|
+
* {@linkcode PluginProgramSpreadsheetApi.bindings}, a sandboxed script escape hatch
|
|
31
|
+
* ({@linkcode PluginProgramSpreadsheetApi.runScript}), an audit log
|
|
32
|
+
* ({@linkcode PluginProgramSpreadsheetApi.getAuditLog}), and a liveness
|
|
33
|
+
* {@linkcode PluginProgramSpreadsheetApi.ping}. `addTable` is intentionally not
|
|
34
|
+
* exposed — `render` composes header + rows + table in one call.
|
|
35
|
+
*
|
|
36
|
+
* **Verb note (naming authority; rows pending merge into constitution §4 by its owner).**
|
|
37
|
+
* Existing §4 verbs used as-is: `get`, `list`, `set` (bulk cell/format writes;
|
|
38
|
+
* read back via {@linkcode PluginProgramSpreadsheetApi.getSheetData}), `create`,
|
|
39
|
+
* `add` (charts, conditional formats), `apply` (templates), `export`, and
|
|
40
|
+
* `transaction` (the sanctioned atomic-batch verb), plus the ratified `render` and
|
|
41
|
+
* `highlight` program domain verbs ◆. New program-domain verbs ratified here ◆:
|
|
42
|
+
* `recalculate` (recompute the workbook's formula results — distinct from
|
|
43
|
+
* `refresh`), `merge` ({@linkcode PluginProgramSpreadsheetApi.mergeCells} spans a
|
|
44
|
+
* cell range — a spreadsheet-domain verb, explicitly NOT the CSG-solid `union`
|
|
45
|
+
* fold), `refresh` ({@linkcode PluginProgramSpreadsheetBindingsApi.refresh}
|
|
46
|
+
* re-pulls a binding's live source — distinct from `recalculate`), `run`
|
|
47
|
+
* ({@linkcode PluginProgramSpreadsheetApi.runScript} executes a sandboxed script),
|
|
48
|
+
* and `ping` (a meta liveness probe). Renames for compliance: the host's `save` →
|
|
49
|
+
* `templates.create`; `getRecentEntries` → `getAuditLog`.
|
|
50
|
+
*
|
|
51
|
+
* Accessed via `snaptrude.program.spreadsheet`.
|
|
52
|
+
*/
|
|
53
|
+
export declare abstract class PluginProgramSpreadsheetApi {
|
|
54
|
+
constructor();
|
|
55
|
+
/**
|
|
56
|
+
* Reusable sheet templates — capture a sheet's layout as a named template and
|
|
57
|
+
* re-apply it to another sheet. See {@linkcode PluginProgramSpreadsheetTemplatesApi}.
|
|
58
|
+
*/
|
|
59
|
+
abstract templates: PluginProgramSpreadsheetTemplatesApi;
|
|
60
|
+
/**
|
|
61
|
+
* Live data bindings — bind a program dataset to a sheet range and refresh it
|
|
62
|
+
* on demand. See {@linkcode PluginProgramSpreadsheetBindingsApi}.
|
|
63
|
+
*/
|
|
64
|
+
abstract bindings: PluginProgramSpreadsheetBindingsApi;
|
|
65
|
+
/**
|
|
66
|
+
* Render a titled, formatted table onto a named sheet (create-or-replace).
|
|
67
|
+
*
|
|
68
|
+
* The intent-level replacement for the raw cell-write sequence: it writes the
|
|
69
|
+
* header + rows, applies per-column format/alignment, optionally wraps the
|
|
70
|
+
* block in a table, freezes the header, and appends a totals row. This is the
|
|
71
|
+
* generic table render; the `render*` family is reserved to also carry
|
|
72
|
+
* dataset-specific renders (`renderTakeoff`, `renderProgram`) once their
|
|
73
|
+
* argument shapes are ratified.
|
|
74
|
+
*
|
|
75
|
+
* @param sheetName - Target sheet name.
|
|
76
|
+
* @param columns - Column definitions, at least one (see
|
|
77
|
+
* {@linkcode PluginSpreadsheetColumn}).
|
|
78
|
+
* @param rows - Row objects keyed by column `key`.
|
|
79
|
+
* @param options - Optional `title`, `startCell` (default `"A1"`), `whenExists`
|
|
80
|
+
* (default `"replace"`), `asTable` (default `true`), `freezeHeader` (default
|
|
81
|
+
* `true`), and `totals` row.
|
|
82
|
+
* @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
|
|
83
|
+
* ranges and counts.
|
|
84
|
+
* @throws If `columns` is empty, the target sheet exists and `whenExists` is
|
|
85
|
+
* `"error"`, or a cell address is invalid.
|
|
86
|
+
*
|
|
87
|
+
* @examplePrompt Render my takeoff as a table on a sheet
|
|
88
|
+
* @examplePrompt Write the area schedule to a spreadsheet with totals
|
|
89
|
+
* @examplePrompt Put the department breakdown on a sheet called "Program"
|
|
90
|
+
* @examplePrompt Output this data as a formatted table with a header
|
|
91
|
+
* @examplePrompt Create a report sheet from these rows and columns
|
|
92
|
+
*
|
|
93
|
+
* # Example
|
|
94
|
+
* ```ts
|
|
95
|
+
* await snaptrude.program.spreadsheet.render(
|
|
96
|
+
* "Program",
|
|
97
|
+
* [
|
|
98
|
+
* { key: "name", header: "Department" },
|
|
99
|
+
* { key: "area", header: "Area", format: "0.00", align: "right" },
|
|
100
|
+
* ],
|
|
101
|
+
* [{ name: "FOH", area: 120.5 }],
|
|
102
|
+
* { totals: [{ column: "area", fn: "sum", label: "Total" }] },
|
|
103
|
+
* )
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
abstract render(sheetName: string, columns: PluginSpreadsheetColumn[], rows: Record<string, PluginSpreadsheetCell>[], options?: {
|
|
107
|
+
title?: string;
|
|
108
|
+
startCell?: string;
|
|
109
|
+
whenExists?: "replace" | "error";
|
|
110
|
+
asTable?: boolean;
|
|
111
|
+
freezeHeader?: boolean;
|
|
112
|
+
totals?: PluginSpreadsheetTotal[];
|
|
113
|
+
}): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
|
|
114
|
+
/**
|
|
115
|
+
* Render the quantity/material takeoff onto a sheet.
|
|
116
|
+
*
|
|
117
|
+
* A specialization of the render* family: the **host pulls and projects the
|
|
118
|
+
* current takeoff dataset itself** — the plugin supplies only the target
|
|
119
|
+
* `sheetName`, an optional `title`, and an optional `filter`; there is **no
|
|
120
|
+
* data argument**. Returns the same rendered-artifact record as
|
|
121
|
+
* {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
122
|
+
* _(Authored ahead — optional via the `spreadsheet?` mount until the host
|
|
123
|
+
* round-trip is live.)_
|
|
124
|
+
*
|
|
125
|
+
* @param options - Optional `sheetName`, `title`, and `filter` (a
|
|
126
|
+
* {@linkcode PluginProgramSpreadsheetRenderDatasetArgs}).
|
|
127
|
+
* @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
|
|
128
|
+
* ranges and counts.
|
|
129
|
+
* @throws If the takeoff cannot be rendered.
|
|
130
|
+
*
|
|
131
|
+
* @examplePrompt Render the takeoff onto a sheet
|
|
132
|
+
* @examplePrompt Put the quantity takeoff on a spreadsheet
|
|
133
|
+
* @examplePrompt Generate the takeoff schedule sheet titled Takeoff
|
|
134
|
+
* @examplePrompt Render the material takeoff filtered to the walls
|
|
135
|
+
*
|
|
136
|
+
* # Example
|
|
137
|
+
* ```ts
|
|
138
|
+
* await snaptrude.program.spreadsheet.renderTakeoff({ sheetName: "Takeoff" })
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
abstract renderTakeoff(options?: {
|
|
142
|
+
sheetName?: string;
|
|
143
|
+
title?: string;
|
|
144
|
+
filter?: string;
|
|
145
|
+
}): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
|
|
146
|
+
/**
|
|
147
|
+
* Render the area program onto a sheet.
|
|
148
|
+
*
|
|
149
|
+
* A specialization of the render* family: the **host pulls and projects the
|
|
150
|
+
* current program dataset itself** (departments with area targets vs allocated)
|
|
151
|
+
* — the plugin supplies only the target `sheetName`, an optional `title`, and an
|
|
152
|
+
* optional `filter`; there is **no data argument**. Returns the same
|
|
153
|
+
* rendered-artifact record as {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
154
|
+
* _(Authored ahead — optional via the `spreadsheet?` mount until the host
|
|
155
|
+
* round-trip is live.)_
|
|
156
|
+
*
|
|
157
|
+
* @param options - Optional `sheetName`, `title`, and `filter` (a
|
|
158
|
+
* {@linkcode PluginProgramSpreadsheetRenderDatasetArgs}).
|
|
159
|
+
* @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
|
|
160
|
+
* ranges and counts.
|
|
161
|
+
* @throws If the program cannot be rendered.
|
|
162
|
+
*
|
|
163
|
+
* @examplePrompt Render the area program onto a sheet
|
|
164
|
+
* @examplePrompt Put the department program on a spreadsheet
|
|
165
|
+
* @examplePrompt Generate the program schedule sheet titled Program
|
|
166
|
+
* @examplePrompt Render the program filtered to the residential departments
|
|
167
|
+
*
|
|
168
|
+
* # Example
|
|
169
|
+
* ```ts
|
|
170
|
+
* await snaptrude.program.spreadsheet.renderProgram({ sheetName: "Program" })
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
abstract renderProgram(options?: {
|
|
174
|
+
sheetName?: string;
|
|
175
|
+
title?: string;
|
|
176
|
+
filter?: string;
|
|
177
|
+
}): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
|
|
178
|
+
/**
|
|
179
|
+
* Export the whole report workbook to a file (xlsx, pdf, or csv).
|
|
180
|
+
*
|
|
181
|
+
* Returns the file content as base64 so the plugin can download, upload, or
|
|
182
|
+
* attach it. This is the workbook **file** export; to read cell **values** back
|
|
183
|
+
* as data, use {@linkcode PluginProgramSpreadsheetApi.getSheetData} instead.
|
|
184
|
+
*
|
|
185
|
+
* @param format - The file format to export the workbook to.
|
|
186
|
+
* @param options - Optional `fileName` (without extension); a default is used
|
|
187
|
+
* when omitted.
|
|
188
|
+
* @returns A {@linkcode PluginProgramSpreadsheetExportResult} with the file's
|
|
189
|
+
* `fileName`, `mimeType`, and base64 `dataBase64`.
|
|
190
|
+
* @throws If the workbook cannot be serialized to the requested format.
|
|
191
|
+
*
|
|
192
|
+
* @examplePrompt Export the report as an Excel file
|
|
193
|
+
* @examplePrompt Download the whole workbook as a PDF
|
|
194
|
+
* @examplePrompt Export the program workbook to xlsx
|
|
195
|
+
* @examplePrompt Save the report as a csv file
|
|
196
|
+
*
|
|
197
|
+
* # Example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const file = await snaptrude.program.spreadsheet.export("xlsx")
|
|
200
|
+
* // file.fileName, file.mimeType, file.dataBase64
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
abstract export(format: PluginSpreadsheetExportFormat, options?: {
|
|
204
|
+
fileName?: string;
|
|
205
|
+
}): PluginApiReturn<PluginProgramSpreadsheetExportResult>;
|
|
206
|
+
/**
|
|
207
|
+
* List the sheets in the report workbook.
|
|
208
|
+
*
|
|
209
|
+
* @returns A {@linkcode PluginProgramSpreadsheetListSheetsResult} with each sheet's
|
|
210
|
+
* name/index/visibility/size, plus the active sheet name.
|
|
211
|
+
*
|
|
212
|
+
* @examplePrompt List the sheets in the spreadsheet
|
|
213
|
+
* @examplePrompt What sheets are in the report workbook?
|
|
214
|
+
* @examplePrompt Which sheet is currently active?
|
|
215
|
+
* @examplePrompt How many sheets does the report have?
|
|
216
|
+
*
|
|
217
|
+
* # Example
|
|
218
|
+
* ```ts
|
|
219
|
+
* const { sheets, activeSheet } = await snaptrude.program.spreadsheet.listSheets()
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
abstract listSheets(): PluginApiReturn<PluginProgramSpreadsheetListSheetsResult>;
|
|
223
|
+
/**
|
|
224
|
+
* Read a sheet's data back as a matrix (and optionally as header-keyed records).
|
|
225
|
+
*
|
|
226
|
+
* @param sheetName - Sheet to read.
|
|
227
|
+
* @param options - Optional `range` (A1; omit to read the sheet's used range)
|
|
228
|
+
* and `header` (`true` to also get records keyed by the header row).
|
|
229
|
+
* @returns A {@linkcode PluginProgramSpreadsheetGetSheetDataResult} with the read
|
|
230
|
+
* `range`, `values` matrix, and optional `records`.
|
|
231
|
+
* @throws If the sheet does not exist or the range is invalid.
|
|
232
|
+
*
|
|
233
|
+
* @examplePrompt Read the data back from the Program sheet
|
|
234
|
+
* @examplePrompt Get the values in range A1:D20 of a sheet
|
|
235
|
+
* @examplePrompt Read a sheet as rows of records keyed by header
|
|
236
|
+
* @examplePrompt What's in the takeoff sheet right now?
|
|
237
|
+
*
|
|
238
|
+
* # Example
|
|
239
|
+
* ```ts
|
|
240
|
+
* const { values, records } = await snaptrude.program.spreadsheet.getSheetData(
|
|
241
|
+
* "Program",
|
|
242
|
+
* { header: true },
|
|
243
|
+
* )
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
abstract getSheetData(sheetName: string, options?: {
|
|
247
|
+
range?: string;
|
|
248
|
+
header?: boolean;
|
|
249
|
+
}): PluginApiReturn<PluginProgramSpreadsheetGetSheetDataResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Add a chart to a sheet, driven by a cell range.
|
|
252
|
+
*
|
|
253
|
+
* @param sheetName - Sheet to add the chart to.
|
|
254
|
+
* @param chartType - Chart type (see {@linkcode PluginSpreadsheetChartType}).
|
|
255
|
+
* @param dataRange - A1 range driving the chart.
|
|
256
|
+
* @param options - Optional `title`, `position` (sheet coords), and `size` (px).
|
|
257
|
+
* @returns A {@linkcode PluginProgramSpreadsheetAddChartResult} with the new
|
|
258
|
+
* chart's id.
|
|
259
|
+
* @throws If the sheet or data range is invalid.
|
|
260
|
+
*
|
|
261
|
+
* @examplePrompt Add a bar chart of the department areas
|
|
262
|
+
* @examplePrompt Insert a pie chart from range B2:C10
|
|
263
|
+
* @examplePrompt Put a column chart on the Program sheet
|
|
264
|
+
* @examplePrompt Chart the area breakdown by department
|
|
265
|
+
*
|
|
266
|
+
* # Example
|
|
267
|
+
* ```ts
|
|
268
|
+
* const { chartId } = await snaptrude.program.spreadsheet.addChart(
|
|
269
|
+
* "Program",
|
|
270
|
+
* "column",
|
|
271
|
+
* "A1:B10",
|
|
272
|
+
* { title: "Area by department" },
|
|
273
|
+
* )
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
abstract addChart(sheetName: string, chartType: PluginSpreadsheetChartType, dataRange: string, options?: {
|
|
277
|
+
title?: string;
|
|
278
|
+
position?: {
|
|
279
|
+
x: number;
|
|
280
|
+
y: number;
|
|
281
|
+
};
|
|
282
|
+
size?: {
|
|
283
|
+
width: number;
|
|
284
|
+
height: number;
|
|
285
|
+
};
|
|
286
|
+
}): PluginApiReturn<PluginProgramSpreadsheetAddChartResult>;
|
|
287
|
+
/**
|
|
288
|
+
* Highlight a range of cells (background color and optional emphasis).
|
|
289
|
+
*
|
|
290
|
+
* @param sheetName - Sheet containing the range.
|
|
291
|
+
* @param range - A1 range to highlight.
|
|
292
|
+
* @param options - Optional `color` (CSS hex; a default emphasis is used when
|
|
293
|
+
* omitted) and `bold`.
|
|
294
|
+
* @returns A {@linkcode PluginProgramSpreadsheetHighlightCellsResult} echoing the
|
|
295
|
+
* highlighted sheet and range.
|
|
296
|
+
* @throws If the sheet or range is invalid.
|
|
297
|
+
*
|
|
298
|
+
* @examplePrompt Highlight the cells that are over budget
|
|
299
|
+
* @examplePrompt Color range A2:A10 red
|
|
300
|
+
* @examplePrompt Highlight B2:D2 in yellow
|
|
301
|
+
* @examplePrompt Emphasize the totals row on the Program sheet
|
|
302
|
+
*
|
|
303
|
+
* # Example
|
|
304
|
+
* ```ts
|
|
305
|
+
* await snaptrude.program.spreadsheet.highlightCells("Program", "A2:A10", {
|
|
306
|
+
* color: "#ffe08a",
|
|
307
|
+
* })
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
abstract highlightCells(sheetName: string, range: string, options?: {
|
|
311
|
+
color?: string;
|
|
312
|
+
bold?: boolean;
|
|
313
|
+
}): PluginApiReturn<PluginProgramSpreadsheetHighlightCellsResult>;
|
|
314
|
+
/**
|
|
315
|
+
* Read the area-program dataset (departments with target vs allocated area).
|
|
316
|
+
*
|
|
317
|
+
* Returns the same figures {@linkcode PluginProgramSpreadsheetApi.renderProgram}
|
|
318
|
+
* projects onto a sheet, as render-ready rows — so a plugin can inspect or
|
|
319
|
+
* transform the program before rendering it (or render it itself via
|
|
320
|
+
* {@linkcode PluginProgramSpreadsheetApi.render}). For the canonical
|
|
321
|
+
* area-program summary read, see {@linkcode PluginProgramMetricsApi.get}.
|
|
322
|
+
*
|
|
323
|
+
* @returns A {@linkcode PluginProgramSpreadsheetGetProgramResult} with per-department
|
|
324
|
+
* rows (`targetArea`/`allocatedArea`/`variance`), totals, and the report `units`.
|
|
325
|
+
*
|
|
326
|
+
* @examplePrompt Get the area program data
|
|
327
|
+
* @examplePrompt Read the department program before I render it
|
|
328
|
+
* @examplePrompt Give me the program rows with target vs allocated area
|
|
329
|
+
* @examplePrompt What's the program dataset the report is built from?
|
|
330
|
+
*
|
|
331
|
+
* # Example
|
|
332
|
+
* ```ts
|
|
333
|
+
* const program = await snaptrude.program.spreadsheet.getProgram()
|
|
334
|
+
* for (const row of program.rows) console.log(row.name, row.allocatedArea, row.targetArea)
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
abstract getProgram(): PluginApiReturn<PluginProgramSpreadsheetGetProgramResult>;
|
|
338
|
+
/**
|
|
339
|
+
* Read the quantity/material takeoff dataset (per-element quantities).
|
|
340
|
+
*
|
|
341
|
+
* Returns the same rows {@linkcode PluginProgramSpreadsheetApi.renderTakeoff}
|
|
342
|
+
* projects onto a sheet — one record per counted element (category, item,
|
|
343
|
+
* level, quantity, unit) — so a plugin can inspect or transform the takeoff
|
|
344
|
+
* before rendering it (or render it itself via
|
|
345
|
+
* {@linkcode PluginProgramSpreadsheetApi.render}).
|
|
346
|
+
*
|
|
347
|
+
* @returns A {@linkcode PluginProgramSpreadsheetGetTakeoffResult} with the takeoff
|
|
348
|
+
* `rows`, a `rowCount`, and the `generatedAt` timestamp.
|
|
349
|
+
*
|
|
350
|
+
* @examplePrompt Get the takeoff data
|
|
351
|
+
* @examplePrompt Read the quantity takeoff rows
|
|
352
|
+
* @examplePrompt Give me the per-element quantities before I render them
|
|
353
|
+
* @examplePrompt What's in the material takeoff right now?
|
|
354
|
+
*
|
|
355
|
+
* # Example
|
|
356
|
+
* ```ts
|
|
357
|
+
* const takeoff = await snaptrude.program.spreadsheet.getTakeoff()
|
|
358
|
+
* console.log(takeoff.rowCount, "elements")
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
abstract getTakeoff(): PluginApiReturn<PluginProgramSpreadsheetGetTakeoffResult>;
|
|
362
|
+
/**
|
|
363
|
+
* Create (or reuse/replace) a named sheet in the report workbook.
|
|
364
|
+
*
|
|
365
|
+
* The blank-canvas complement to {@linkcode PluginProgramSpreadsheetApi.render}:
|
|
366
|
+
* use it when you want an empty sheet to write into with
|
|
367
|
+
* {@linkcode PluginProgramSpreadsheetApi.setValues} /
|
|
368
|
+
* {@linkcode PluginProgramSpreadsheetApi.setFormulas}. By default an existing
|
|
369
|
+
* sheet of the same name is reused; pass `whenExists` to replace or error.
|
|
370
|
+
*
|
|
371
|
+
* @param name - The sheet name to create.
|
|
372
|
+
* @param whenExists - Behaviour if the name exists: `"reuse"` (default),
|
|
373
|
+
* `"replace"`, or `"error"`.
|
|
374
|
+
* @returns A {@linkcode PluginProgramSpreadsheetCreateSheetResult} with the resolved
|
|
375
|
+
* `sheetName`, whether it `replaced` an existing sheet, and its `sheetIndex`.
|
|
376
|
+
* @throws If the sheet exists and `whenExists` is `"error"`.
|
|
377
|
+
*
|
|
378
|
+
* @examplePrompt Create a sheet called Summary
|
|
379
|
+
* @examplePrompt Add a new blank sheet named Takeoff
|
|
380
|
+
* @examplePrompt Make a sheet, replacing it if it already exists
|
|
381
|
+
* @examplePrompt Start a fresh sheet to write into
|
|
382
|
+
*
|
|
383
|
+
* # Example
|
|
384
|
+
* ```ts
|
|
385
|
+
* await snaptrude.program.spreadsheet.createSheet("Summary")
|
|
386
|
+
* ```
|
|
387
|
+
*/
|
|
388
|
+
abstract createSheet(name: string, whenExists?: PluginSpreadsheetWhenExists): PluginApiReturn<PluginProgramSpreadsheetCreateSheetResult>;
|
|
389
|
+
/**
|
|
390
|
+
* Write a block of raw values into a sheet, anchored at a cell.
|
|
391
|
+
*
|
|
392
|
+
* The low-level cell-write path (the high-level path is
|
|
393
|
+
* {@linkcode PluginProgramSpreadsheetApi.render}, which adds a header, format,
|
|
394
|
+
* and totals). Values are written row-major from `startCell` (default `"A1"`);
|
|
395
|
+
* columns are auto-sized to fit.
|
|
396
|
+
*
|
|
397
|
+
* @param sheetName - Sheet to write into.
|
|
398
|
+
* @param values - Row-major matrix of values to write.
|
|
399
|
+
* @param startCell - Top-left anchor in A1 notation (default `"A1"`).
|
|
400
|
+
* @returns A {@linkcode PluginProgramSpreadsheetSetValuesResult} with the written
|
|
401
|
+
* `startCell`, `rowCount`, and `colCount`.
|
|
402
|
+
* @throws If the sheet does not exist or `startCell` is invalid.
|
|
403
|
+
*
|
|
404
|
+
* @examplePrompt Write these rows to the sheet starting at A1
|
|
405
|
+
* @examplePrompt Put this data into the Summary sheet
|
|
406
|
+
* @examplePrompt Set the values in the takeoff sheet from B2
|
|
407
|
+
* @examplePrompt Drop this matrix of numbers onto a sheet
|
|
408
|
+
*
|
|
409
|
+
* # Example
|
|
410
|
+
* ```ts
|
|
411
|
+
* await snaptrude.program.spreadsheet.setValues(
|
|
412
|
+
* "Summary",
|
|
413
|
+
* [["Department", "Area"], ["FOH", 120.5]],
|
|
414
|
+
* "A1",
|
|
415
|
+
* )
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
abstract setValues(sheetName: string, values: PluginSpreadsheetCell[][], startCell?: string): PluginApiReturn<PluginProgramSpreadsheetSetValuesResult>;
|
|
419
|
+
/**
|
|
420
|
+
* Set formulas on individual cells of a sheet.
|
|
421
|
+
*
|
|
422
|
+
* Each entry targets one cell (A1 notation) with a formula expression (a
|
|
423
|
+
* leading `=` is optional). Pairs with
|
|
424
|
+
* {@linkcode PluginProgramSpreadsheetApi.recalculate} when you need to force a
|
|
425
|
+
* recompute.
|
|
426
|
+
*
|
|
427
|
+
* @param sheetName - Sheet to set formulas on.
|
|
428
|
+
* @param formulas - The cell → formula assignments (see
|
|
429
|
+
* {@linkcode PluginSpreadsheetFormula}).
|
|
430
|
+
* @returns A {@linkcode PluginProgramSpreadsheetSetFormulasResult} with the `count`
|
|
431
|
+
* of formulas set.
|
|
432
|
+
* @throws If the sheet does not exist or a cell address is invalid.
|
|
433
|
+
*
|
|
434
|
+
* @examplePrompt Put a SUM formula in cell B10
|
|
435
|
+
* @examplePrompt Set formulas totalling each column
|
|
436
|
+
* @examplePrompt Add a formula to compute the variance column
|
|
437
|
+
* @examplePrompt Write =SUM(B2:B9) into B10 on the Summary sheet
|
|
438
|
+
*
|
|
439
|
+
* # Example
|
|
440
|
+
* ```ts
|
|
441
|
+
* await snaptrude.program.spreadsheet.setFormulas("Summary", [
|
|
442
|
+
* { cell: "B10", formula: "=SUM(B2:B9)" },
|
|
443
|
+
* ])
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
abstract setFormulas(sheetName: string, formulas: PluginSpreadsheetFormula[]): PluginApiReturn<PluginProgramSpreadsheetSetFormulasResult>;
|
|
447
|
+
/**
|
|
448
|
+
* Apply cell styles to one or more ranges of a sheet.
|
|
449
|
+
*
|
|
450
|
+
* Sets fill/text color, font, alignment, and number format on each given range.
|
|
451
|
+
* For a quick single-range emphasis,
|
|
452
|
+
* {@linkcode PluginProgramSpreadsheetApi.highlightCells} is the shortcut.
|
|
453
|
+
*
|
|
454
|
+
* @param sheetName - Sheet containing the ranges.
|
|
455
|
+
* @param ranges - Range → style assignments (each a range + a
|
|
456
|
+
* {@linkcode PluginSpreadsheetCellStyle}).
|
|
457
|
+
* @returns A {@linkcode PluginProgramSpreadsheetSetStylesResult} with the `count` of
|
|
458
|
+
* ranges styled.
|
|
459
|
+
* @throws If the sheet does not exist or a range is invalid.
|
|
460
|
+
*
|
|
461
|
+
* @examplePrompt Make the header row bold with a grey fill
|
|
462
|
+
* @examplePrompt Right-align the numbers in column B
|
|
463
|
+
* @examplePrompt Format A1:D1 with a background color and bold text
|
|
464
|
+
* @examplePrompt Style the totals row
|
|
465
|
+
*
|
|
466
|
+
* # Example
|
|
467
|
+
* ```ts
|
|
468
|
+
* await snaptrude.program.spreadsheet.setStyles("Summary", [
|
|
469
|
+
* { range: "A1:D1", style: { fontWeight: "bold", backColor: "#eef" } },
|
|
470
|
+
* ])
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
abstract setStyles(sheetName: string, ranges: PluginSpreadsheetRangeStyle[]): PluginApiReturn<PluginProgramSpreadsheetSetStylesResult>;
|
|
474
|
+
/**
|
|
475
|
+
* Merge a contiguous range of cells into a single spanned cell.
|
|
476
|
+
*
|
|
477
|
+
* Optionally sets the merged cell's value. (Verb ruling: `merge` is a
|
|
478
|
+
* spreadsheet-domain verb here — spanning cells — not the CSG-solid `union`.)
|
|
479
|
+
*
|
|
480
|
+
* @param sheetName - Sheet containing the range.
|
|
481
|
+
* @param range - A1 range to merge into one spanned cell.
|
|
482
|
+
* @param value - Optional value to set in the merged (top-left) cell.
|
|
483
|
+
* @returns A {@linkcode PluginProgramSpreadsheetMergeCellsResult} echoing the merged
|
|
484
|
+
* sheet and range.
|
|
485
|
+
* @throws If the sheet does not exist or the range is invalid.
|
|
486
|
+
*
|
|
487
|
+
* @examplePrompt Merge cells A1 to D1 for the title
|
|
488
|
+
* @examplePrompt Span the header across the first four columns
|
|
489
|
+
* @examplePrompt Merge A1:D1 and set it to "Program Summary"
|
|
490
|
+
*
|
|
491
|
+
* # Example
|
|
492
|
+
* ```ts
|
|
493
|
+
* await snaptrude.program.spreadsheet.mergeCells("Summary", "A1:D1", "Program Summary")
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
abstract mergeCells(sheetName: string, range: string, value?: PluginSpreadsheetCell): PluginApiReturn<PluginProgramSpreadsheetMergeCellsResult>;
|
|
497
|
+
/**
|
|
498
|
+
* Add a conditional-formatting rule to a range.
|
|
499
|
+
*
|
|
500
|
+
* Currently supports data-bar rules (a proportional in-cell bar); more rule
|
|
501
|
+
* types are reserved. For static (non-conditional) emphasis use
|
|
502
|
+
* {@linkcode PluginProgramSpreadsheetApi.highlightCells} or
|
|
503
|
+
* {@linkcode PluginProgramSpreadsheetApi.setStyles}.
|
|
504
|
+
*
|
|
505
|
+
* @param sheetName - Sheet containing the range.
|
|
506
|
+
* @param range - A1 range to format.
|
|
507
|
+
* @param rule - The conditional-format rule (see
|
|
508
|
+
* {@linkcode PluginSpreadsheetConditionalRule}).
|
|
509
|
+
* @returns A {@linkcode PluginProgramSpreadsheetAddConditionalFormattingResult} with
|
|
510
|
+
* whether a rule was `created`.
|
|
511
|
+
* @throws If the sheet does not exist or the range is invalid.
|
|
512
|
+
*
|
|
513
|
+
* @examplePrompt Add data bars to the area column
|
|
514
|
+
* @examplePrompt Show a proportional bar inside cells B2:B10
|
|
515
|
+
* @examplePrompt Add conditional formatting data bars to the quantities
|
|
516
|
+
*
|
|
517
|
+
* # Example
|
|
518
|
+
* ```ts
|
|
519
|
+
* await snaptrude.program.spreadsheet.addConditionalFormatting("Summary", "B2:B10", {
|
|
520
|
+
* type: "dataBar",
|
|
521
|
+
* color: "#4f9cf9",
|
|
522
|
+
* })
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
525
|
+
abstract addConditionalFormatting(sheetName: string, range: string, rule: PluginSpreadsheetConditionalRule): PluginApiReturn<PluginProgramSpreadsheetAddConditionalFormattingResult>;
|
|
526
|
+
/**
|
|
527
|
+
* Recompute the workbook's formula results.
|
|
528
|
+
*
|
|
529
|
+
* Recalculates every formula (or, when `sheetName` is given, focuses that sheet
|
|
530
|
+
* before recalculating the workbook). (Verb ruling: `recalculate` recomputes
|
|
531
|
+
* formulas — distinct from {@linkcode PluginProgramSpreadsheetBindingsApi.refresh},
|
|
532
|
+
* which re-pulls a binding's source data.)
|
|
533
|
+
*
|
|
534
|
+
* @param options - Optional `sheetName` to focus before recalculating; omit for
|
|
535
|
+
* the whole workbook.
|
|
536
|
+
* @returns A {@linkcode PluginProgramSpreadsheetRecalculateResult} with the recompute
|
|
537
|
+
* `scope` and the focused `sheetName` (or `null`).
|
|
538
|
+
*
|
|
539
|
+
* @examplePrompt Recalculate the workbook
|
|
540
|
+
* @examplePrompt Recompute all the formulas
|
|
541
|
+
* @examplePrompt Recalculate the Summary sheet
|
|
542
|
+
*
|
|
543
|
+
* # Example
|
|
544
|
+
* ```ts
|
|
545
|
+
* await snaptrude.program.spreadsheet.recalculate()
|
|
546
|
+
* ```
|
|
547
|
+
*/
|
|
548
|
+
abstract recalculate(options?: {
|
|
549
|
+
sheetName?: string;
|
|
550
|
+
}): PluginApiReturn<PluginProgramSpreadsheetRecalculateResult>;
|
|
551
|
+
/**
|
|
552
|
+
* Run a sequence of sheet operations as one atomic, undoable transaction.
|
|
553
|
+
*
|
|
554
|
+
* Batches cell-construction operations (createSheet/setValues/setFormulas/
|
|
555
|
+
* setStyles/mergeCells) so they commit together and undo as a single step, with
|
|
556
|
+
* events suspended for speed. (`transaction` is the sanctioned §4 atomic-batch
|
|
557
|
+
* verb.)
|
|
558
|
+
*
|
|
559
|
+
* @param operations - The operations to run in order. Each operation's `args`
|
|
560
|
+
* stays that method's schema **object** (the wire shape), not positional.
|
|
561
|
+
* @param label - Optional undo-history label for the batch.
|
|
562
|
+
* @returns A {@linkcode PluginProgramSpreadsheetTransactionResult} with the
|
|
563
|
+
* `operationCount` and each operation's `results`.
|
|
564
|
+
* @throws If any operation names an unsupported method or fails.
|
|
565
|
+
*
|
|
566
|
+
* @examplePrompt Create a sheet and write to it in one atomic step
|
|
567
|
+
* @examplePrompt Batch these sheet edits as a single undoable action
|
|
568
|
+
* @examplePrompt Run these operations together as one transaction
|
|
569
|
+
*
|
|
570
|
+
* # Example
|
|
571
|
+
* ```ts
|
|
572
|
+
* await snaptrude.program.spreadsheet.transaction(
|
|
573
|
+
* [
|
|
574
|
+
* { method: "createSheet", args: { name: "Summary" } },
|
|
575
|
+
* { method: "setValues", args: { sheetName: "Summary", values: [["A", 1]] } },
|
|
576
|
+
* ],
|
|
577
|
+
* "Build summary",
|
|
578
|
+
* )
|
|
579
|
+
* ```
|
|
580
|
+
*/
|
|
581
|
+
abstract transaction(operations: PluginSpreadsheetTransactionOp[], label?: string): PluginApiReturn<PluginProgramSpreadsheetTransactionResult>;
|
|
582
|
+
/**
|
|
583
|
+
* Run an author-supplied script against a sandboxed workbook facade.
|
|
584
|
+
*
|
|
585
|
+
* The escape hatch for advanced automation the typed methods don't cover: the
|
|
586
|
+
* `script` runs against a restricted `workbook` object with browser/network
|
|
587
|
+
* globals blocked, and its return value is handed back as `result`. Prefer the
|
|
588
|
+
* typed methods where they exist. (Verb ruling: `run` executes a script.)
|
|
589
|
+
*
|
|
590
|
+
* @param script - Script source, run against the sandboxed `workbook` facade.
|
|
591
|
+
* @returns A {@linkcode PluginProgramSpreadsheetRunScriptResult} with the script's
|
|
592
|
+
* `result`.
|
|
593
|
+
* @throws If the script uses a blocked browser/network API or throws at runtime.
|
|
594
|
+
*
|
|
595
|
+
* @examplePrompt Run this SpreadJS script against the workbook
|
|
596
|
+
* @examplePrompt Execute a custom script on the sheets
|
|
597
|
+
* @examplePrompt Run a script to tweak the workbook
|
|
598
|
+
*
|
|
599
|
+
* # Example
|
|
600
|
+
* ```ts
|
|
601
|
+
* const { result } = await snaptrude.program.spreadsheet.runScript(
|
|
602
|
+
* "return workbook.getSheetCount();",
|
|
603
|
+
* )
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
abstract runScript(script: string): PluginApiReturn<PluginProgramSpreadsheetRunScriptResult>;
|
|
607
|
+
/**
|
|
608
|
+
* Read the recent audit log of program-spreadsheet operations.
|
|
609
|
+
*
|
|
610
|
+
* Returns the most recent operations performed through this API (method, sheet,
|
|
611
|
+
* status, summary, timestamp), newest first — useful for showing the user what
|
|
612
|
+
* a plugin changed. (Renamed from the host's `getRecentEntries` for §4 `get`
|
|
613
|
+
* compliance.)
|
|
614
|
+
*
|
|
615
|
+
* @param options - Optional `limit` on the entries returned (clamped 1–100,
|
|
616
|
+
* default 20).
|
|
617
|
+
* @returns A {@linkcode PluginProgramSpreadsheetGetAuditLogResult} with the audit
|
|
618
|
+
* `entries`, newest first.
|
|
619
|
+
*
|
|
620
|
+
* @examplePrompt Show the recent spreadsheet actions
|
|
621
|
+
* @examplePrompt What did the plugin change in the workbook?
|
|
622
|
+
* @examplePrompt Get the last 10 audit log entries
|
|
623
|
+
* @examplePrompt Read the program spreadsheet audit log
|
|
624
|
+
*
|
|
625
|
+
* # Example
|
|
626
|
+
* ```ts
|
|
627
|
+
* const { entries } = await snaptrude.program.spreadsheet.getAuditLog({ limit: 10 })
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
abstract getAuditLog(options?: {
|
|
631
|
+
limit?: number;
|
|
632
|
+
}): PluginApiReturn<PluginProgramSpreadsheetGetAuditLogResult>;
|
|
633
|
+
/**
|
|
634
|
+
* Ping the program-mode spreadsheet bridge to check it is reachable.
|
|
635
|
+
*
|
|
636
|
+
* A liveness probe: resolves with `{ pong: true }` when the program-mode
|
|
637
|
+
* workbook bridge is up. (Verb ruling: `ping` is a meta liveness verb.)
|
|
638
|
+
*
|
|
639
|
+
* @returns A {@linkcode PluginProgramSpreadsheetPingResult} — `{ pong: true }` when
|
|
640
|
+
* the bridge is reachable.
|
|
641
|
+
*
|
|
642
|
+
* @examplePrompt Ping the spreadsheet bridge
|
|
643
|
+
* @examplePrompt Is the program spreadsheet available?
|
|
644
|
+
* @examplePrompt Check the spreadsheet connection is alive
|
|
645
|
+
*
|
|
646
|
+
* # Example
|
|
647
|
+
* ```ts
|
|
648
|
+
* const { pong } = await snaptrude.program.spreadsheet.ping()
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
abstract ping(): PluginApiReturn<PluginProgramSpreadsheetPingResult>;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Program-spreadsheet templates — capture a sheet's layout as a named, reusable
|
|
655
|
+
* template and re-apply it to another sheet.
|
|
656
|
+
*
|
|
657
|
+
* Accessed via `snaptrude.program.spreadsheet.templates`.
|
|
658
|
+
*/
|
|
659
|
+
export declare abstract class PluginProgramSpreadsheetTemplatesApi {
|
|
660
|
+
constructor();
|
|
661
|
+
/**
|
|
662
|
+
* Save a sheet's current layout as a named template.
|
|
663
|
+
*
|
|
664
|
+
* (Renamed from the host's `save` to `create` for §4 compliance.)
|
|
665
|
+
*
|
|
666
|
+
* @param name - Template name (re-saving the same name overwrites it).
|
|
667
|
+
* @param sheetName - The source sheet to capture.
|
|
668
|
+
* @param scope - Template scope: `"project"` (default) or `"global"`.
|
|
669
|
+
* @returns A {@linkcode PluginProgramSpreadsheetTemplatesCreateResult} with the new
|
|
670
|
+
* template's `id`, `name`, `scope`, and source `sheetName`.
|
|
671
|
+
* @throws If the source sheet does not exist.
|
|
672
|
+
*
|
|
673
|
+
* @examplePrompt Save this sheet as a reusable template
|
|
674
|
+
* @examplePrompt Create a template from the Summary sheet
|
|
675
|
+
* @examplePrompt Save the current layout as a template called "Cover"
|
|
676
|
+
*
|
|
677
|
+
* # Example
|
|
678
|
+
* ```ts
|
|
679
|
+
* await snaptrude.program.spreadsheet.templates.create("Cover", "Summary")
|
|
680
|
+
* ```
|
|
681
|
+
*/
|
|
682
|
+
abstract create(name: string, sheetName: string, scope?: PluginSpreadsheetTemplateScope): PluginApiReturn<PluginProgramSpreadsheetTemplatesCreateResult>;
|
|
683
|
+
/**
|
|
684
|
+
* Apply a saved template to a target sheet (create-or-replace).
|
|
685
|
+
*
|
|
686
|
+
* @param name - The template to apply.
|
|
687
|
+
* @param targetSheetName - The sheet to create/replace from the template.
|
|
688
|
+
* @returns A {@linkcode PluginProgramSpreadsheetTemplatesApplyResult} echoing the
|
|
689
|
+
* applied template and target sheet.
|
|
690
|
+
* @throws If the named template does not exist.
|
|
691
|
+
*
|
|
692
|
+
* @examplePrompt Apply the Cover template to a new sheet
|
|
693
|
+
* @examplePrompt Use my saved template on the Report sheet
|
|
694
|
+
* @examplePrompt Apply template "Cover" to sheet "Report"
|
|
695
|
+
*
|
|
696
|
+
* # Example
|
|
697
|
+
* ```ts
|
|
698
|
+
* await snaptrude.program.spreadsheet.templates.apply("Cover", "Report")
|
|
699
|
+
* ```
|
|
700
|
+
*/
|
|
701
|
+
abstract apply(name: string, targetSheetName: string): PluginApiReturn<PluginProgramSpreadsheetTemplatesApplyResult>;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Program-spreadsheet data bindings — bind a live program dataset to a sheet
|
|
705
|
+
* range so it can be refreshed on demand.
|
|
706
|
+
*
|
|
707
|
+
* A binding links a dataset (e.g. the takeoff) to a target sheet range; a refresh
|
|
708
|
+
* re-pulls the current data and rewrites the range. Accessed via
|
|
709
|
+
* `snaptrude.program.spreadsheet.bindings`.
|
|
710
|
+
*/
|
|
711
|
+
export declare abstract class PluginProgramSpreadsheetBindingsApi {
|
|
712
|
+
constructor();
|
|
713
|
+
/**
|
|
714
|
+
* Create a named binding from a dataset to a sheet range (and do an initial refresh).
|
|
715
|
+
*
|
|
716
|
+
* @param name - Binding name (re-using a name overwrites it).
|
|
717
|
+
* @param source - The dataset to bind (see
|
|
718
|
+
* {@linkcode PluginSpreadsheetBindingSource}).
|
|
719
|
+
* @param target - The target sheet range (see
|
|
720
|
+
* {@linkcode PluginSpreadsheetBindingTarget}).
|
|
721
|
+
* @param mode - How a refresh writes into the target (default `"replaceRange"`).
|
|
722
|
+
* @returns A {@linkcode PluginProgramSpreadsheetBindingsCreateResult} — the stored
|
|
723
|
+
* binding plus the `refresh` result of the initial pull.
|
|
724
|
+
* @throws If the target sheet does not exist.
|
|
725
|
+
*
|
|
726
|
+
* @examplePrompt Bind the takeoff to the Data sheet
|
|
727
|
+
* @examplePrompt Create a live binding from the takeoff to A1 on Data
|
|
728
|
+
* @examplePrompt Link the takeoff dataset to a sheet range
|
|
729
|
+
*
|
|
730
|
+
* # Example
|
|
731
|
+
* ```ts
|
|
732
|
+
* await snaptrude.program.spreadsheet.bindings.create(
|
|
733
|
+
* "takeoff",
|
|
734
|
+
* { dataset: "takeoff" },
|
|
735
|
+
* { sheetName: "Data", startCell: "A1" },
|
|
736
|
+
* )
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
abstract create(name: string, source: PluginSpreadsheetBindingSource, target: PluginSpreadsheetBindingTarget, mode?: PluginSpreadsheetBindingMode): PluginApiReturn<PluginProgramSpreadsheetBindingsCreateResult>;
|
|
740
|
+
/**
|
|
741
|
+
* Refresh one binding (by name) or all bindings, re-pulling their source data.
|
|
742
|
+
*
|
|
743
|
+
* (Verb ruling: `refresh` re-pulls a binding's live source into its target
|
|
744
|
+
* range — distinct from {@linkcode PluginProgramSpreadsheetApi.recalculate},
|
|
745
|
+
* which recomputes formulas.)
|
|
746
|
+
*
|
|
747
|
+
* @param options - Optional binding `name`; omit it to refresh every binding.
|
|
748
|
+
* @returns A {@linkcode PluginProgramSpreadsheetBindingsRefreshResult} with a
|
|
749
|
+
* `refreshed` entry per binding that was updated.
|
|
750
|
+
* @throws If a `name` is given but no binding with that name exists.
|
|
751
|
+
*
|
|
752
|
+
* @examplePrompt Refresh the takeoff binding
|
|
753
|
+
* @examplePrompt Re-pull all my data bindings
|
|
754
|
+
* @examplePrompt Refresh every binding on the sheets
|
|
755
|
+
*
|
|
756
|
+
* # Example
|
|
757
|
+
* ```ts
|
|
758
|
+
* await snaptrude.program.spreadsheet.bindings.refresh({ name: "takeoff" })
|
|
759
|
+
* ```
|
|
760
|
+
*/
|
|
761
|
+
abstract refresh(options?: {
|
|
762
|
+
name?: string;
|
|
763
|
+
}): PluginApiReturn<PluginProgramSpreadsheetBindingsRefreshResult>;
|
|
764
|
+
/**
|
|
765
|
+
* List all data bindings in the workbook.
|
|
766
|
+
*
|
|
767
|
+
* @returns A {@linkcode PluginProgramSpreadsheetBindingsListResult} with every
|
|
768
|
+
* stored {@linkcode PluginSpreadsheetBinding}.
|
|
769
|
+
*
|
|
770
|
+
* @examplePrompt List the data bindings
|
|
771
|
+
* @examplePrompt What bindings are set up on the sheets?
|
|
772
|
+
* @examplePrompt Show all the live data bindings
|
|
773
|
+
*
|
|
774
|
+
* # Example
|
|
775
|
+
* ```ts
|
|
776
|
+
* const { bindings } = await snaptrude.program.spreadsheet.bindings.list()
|
|
777
|
+
* ```
|
|
778
|
+
*/
|
|
779
|
+
abstract list(): PluginApiReturn<PluginProgramSpreadsheetBindingsListResult>;
|
|
780
|
+
}
|
|
781
|
+
/** A single spreadsheet cell value. */
|
|
782
|
+
export declare const PluginSpreadsheetCell: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
783
|
+
export type PluginSpreadsheetCell = z.infer<typeof PluginSpreadsheetCell>;
|
|
784
|
+
/** Horizontal alignment for a rendered column. */
|
|
785
|
+
export declare const PluginSpreadsheetAlign: z.ZodEnum<{
|
|
786
|
+
center: "center";
|
|
787
|
+
left: "left";
|
|
788
|
+
right: "right";
|
|
789
|
+
}>;
|
|
790
|
+
export type PluginSpreadsheetAlign = z.infer<typeof PluginSpreadsheetAlign>;
|
|
791
|
+
/**
|
|
792
|
+
* A column definition for {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
793
|
+
*
|
|
794
|
+
* | Property | Type | Description |
|
|
795
|
+
* |---|---|---|
|
|
796
|
+
* | `key` | `string` | Key into each row object |
|
|
797
|
+
* | `header` | `string` | Column header text |
|
|
798
|
+
* | `width` | `number?` | Fixed column width in px; auto-fit when omitted |
|
|
799
|
+
* | `format` | `string?` | Number/date format string applied to the data cells |
|
|
800
|
+
* | `align` | `"left" \| "center" \| "right"?` | Cell alignment |
|
|
801
|
+
*/
|
|
802
|
+
export declare const PluginSpreadsheetColumn: z.ZodObject<{
|
|
803
|
+
key: z.ZodString;
|
|
804
|
+
header: z.ZodString;
|
|
805
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
806
|
+
format: z.ZodOptional<z.ZodString>;
|
|
807
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
808
|
+
center: "center";
|
|
809
|
+
left: "left";
|
|
810
|
+
right: "right";
|
|
811
|
+
}>>;
|
|
812
|
+
}, z.core.$strip>;
|
|
813
|
+
export type PluginSpreadsheetColumn = z.infer<typeof PluginSpreadsheetColumn>;
|
|
814
|
+
/**
|
|
815
|
+
* A totals-row aggregation for {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
816
|
+
*
|
|
817
|
+
* | Property | Type | Description |
|
|
818
|
+
* |---|---|---|
|
|
819
|
+
* | `column` | `string` | The {@linkcode PluginSpreadsheetColumn} `key` to aggregate |
|
|
820
|
+
* | `fn` | `"sum" \| "avg" \| "count" \| "min" \| "max"` | Aggregation function |
|
|
821
|
+
* | `label` | `string?` | Optional label printed in the first column of the totals row |
|
|
822
|
+
*/
|
|
823
|
+
export declare const PluginSpreadsheetTotal: z.ZodObject<{
|
|
824
|
+
column: z.ZodString;
|
|
825
|
+
fn: z.ZodEnum<{
|
|
826
|
+
min: "min";
|
|
827
|
+
max: "max";
|
|
828
|
+
count: "count";
|
|
829
|
+
sum: "sum";
|
|
830
|
+
avg: "avg";
|
|
831
|
+
}>;
|
|
832
|
+
label: z.ZodOptional<z.ZodString>;
|
|
833
|
+
}, z.core.$strip>;
|
|
834
|
+
export type PluginSpreadsheetTotal = z.infer<typeof PluginSpreadsheetTotal>;
|
|
835
|
+
/**
|
|
836
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
837
|
+
*
|
|
838
|
+
* | Property | Type | Description |
|
|
839
|
+
* |---|---|---|
|
|
840
|
+
* | `sheetName` | `string` | Target sheet name |
|
|
841
|
+
* | `columns` | {@linkcode PluginSpreadsheetColumn}`[]` | Column definitions (at least one) |
|
|
842
|
+
* | `rows` | `Record<string, cell>[]` | Row objects keyed by column `key` |
|
|
843
|
+
* | `title` | `string?` | Optional title rendered above the header |
|
|
844
|
+
* | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
|
|
845
|
+
* | `whenExists` | `"replace" \| "error"?` | Behaviour if the sheet exists (default `"replace"`) |
|
|
846
|
+
* | `asTable` | `boolean?` | Wrap the block in a table (default `true`) |
|
|
847
|
+
* | `freezeHeader` | `boolean?` | Freeze rows above the data (default `true`) |
|
|
848
|
+
* | `totals` | {@linkcode PluginSpreadsheetTotal}`[]?` | Optional totals row |
|
|
849
|
+
*/
|
|
850
|
+
export declare const PluginProgramSpreadsheetRenderArgs: z.ZodObject<{
|
|
851
|
+
sheetName: z.ZodString;
|
|
852
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
853
|
+
key: z.ZodString;
|
|
854
|
+
header: z.ZodString;
|
|
855
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
856
|
+
format: z.ZodOptional<z.ZodString>;
|
|
857
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
858
|
+
center: "center";
|
|
859
|
+
left: "left";
|
|
860
|
+
right: "right";
|
|
861
|
+
}>>;
|
|
862
|
+
}, z.core.$strip>>;
|
|
863
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
864
|
+
title: z.ZodOptional<z.ZodString>;
|
|
865
|
+
startCell: z.ZodOptional<z.ZodString>;
|
|
866
|
+
whenExists: z.ZodOptional<z.ZodEnum<{
|
|
867
|
+
error: "error";
|
|
868
|
+
replace: "replace";
|
|
869
|
+
}>>;
|
|
870
|
+
asTable: z.ZodOptional<z.ZodBoolean>;
|
|
871
|
+
freezeHeader: z.ZodOptional<z.ZodBoolean>;
|
|
872
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
873
|
+
column: z.ZodString;
|
|
874
|
+
fn: z.ZodEnum<{
|
|
875
|
+
min: "min";
|
|
876
|
+
max: "max";
|
|
877
|
+
count: "count";
|
|
878
|
+
sum: "sum";
|
|
879
|
+
avg: "avg";
|
|
880
|
+
}>;
|
|
881
|
+
label: z.ZodOptional<z.ZodString>;
|
|
882
|
+
}, z.core.$strip>>>;
|
|
883
|
+
}, z.core.$strip>;
|
|
884
|
+
export type PluginProgramSpreadsheetRenderArgs = z.infer<typeof PluginProgramSpreadsheetRenderArgs>;
|
|
885
|
+
/**
|
|
886
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.render}.
|
|
887
|
+
*
|
|
888
|
+
* | Property | Type | Description |
|
|
889
|
+
* |---|---|---|
|
|
890
|
+
* | `sheetName` | `string` | The sheet that was written |
|
|
891
|
+
* | `range` | `string` | A1 range covering the full written block (title + header + data + totals) |
|
|
892
|
+
* | `headerRange` | `string` | A1 range of the header row alone |
|
|
893
|
+
* | `rowCount` | `number` | Number of data rows written (excludes title/header/totals) |
|
|
894
|
+
* | `colCount` | `number` | Number of columns written |
|
|
895
|
+
* | `tableName` | `string \| null` | The created table's name, or `null` when not wrapped as a table |
|
|
896
|
+
* | `replaced` | `boolean` | Whether an existing sheet was replaced |
|
|
897
|
+
*/
|
|
898
|
+
export declare const PluginProgramSpreadsheetRenderResult: z.ZodObject<{
|
|
899
|
+
sheetName: z.ZodString;
|
|
900
|
+
range: z.ZodString;
|
|
901
|
+
headerRange: z.ZodString;
|
|
902
|
+
rowCount: z.ZodNumber;
|
|
903
|
+
colCount: z.ZodNumber;
|
|
904
|
+
tableName: z.ZodNullable<z.ZodString>;
|
|
905
|
+
replaced: z.ZodBoolean;
|
|
906
|
+
}, z.core.$strip>;
|
|
907
|
+
export type PluginProgramSpreadsheetRenderResult = z.infer<typeof PluginProgramSpreadsheetRenderResult>;
|
|
908
|
+
/**
|
|
909
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.renderTakeoff} and
|
|
910
|
+
* {@linkcode PluginProgramSpreadsheetApi.renderProgram} — the dataset render
|
|
911
|
+
* methods. There is **no data argument**: the host pulls and projects the
|
|
912
|
+
* takeoff/program dataset itself. All fields are optional. (Both methods share
|
|
913
|
+
* this args type, as `import.image`/`import.pdf` share their args.)
|
|
914
|
+
*
|
|
915
|
+
* | Property | Type | Description |
|
|
916
|
+
* |---|---|---|
|
|
917
|
+
* | `sheetName` | `string?` | Target sheet name (a default is used when omitted) |
|
|
918
|
+
* | `title` | `string?` | Optional title rendered above the table |
|
|
919
|
+
* | `filter` | `string?` | Optional dataset-filter expression to narrow the rows |
|
|
920
|
+
*/
|
|
921
|
+
export declare const PluginProgramSpreadsheetRenderDatasetArgs: z.ZodObject<{
|
|
922
|
+
sheetName: z.ZodOptional<z.ZodString>;
|
|
923
|
+
title: z.ZodOptional<z.ZodString>;
|
|
924
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
925
|
+
}, z.core.$strip>;
|
|
926
|
+
export type PluginProgramSpreadsheetRenderDatasetArgs = z.infer<typeof PluginProgramSpreadsheetRenderDatasetArgs>;
|
|
927
|
+
/** The workbook export file format. */
|
|
928
|
+
export declare const PluginSpreadsheetExportFormat: z.ZodEnum<{
|
|
929
|
+
pdf: "pdf";
|
|
930
|
+
xlsx: "xlsx";
|
|
931
|
+
csv: "csv";
|
|
932
|
+
}>;
|
|
933
|
+
export type PluginSpreadsheetExportFormat = z.infer<typeof PluginSpreadsheetExportFormat>;
|
|
934
|
+
/**
|
|
935
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.export}.
|
|
936
|
+
*
|
|
937
|
+
* | Property | Type | Description |
|
|
938
|
+
* |---|---|---|
|
|
939
|
+
* | `format` | `"xlsx" \| "pdf" \| "csv"` | The file format to export the workbook to |
|
|
940
|
+
* | `fileName` | `string?` | Desired file name (without extension); a default is used when omitted |
|
|
941
|
+
*/
|
|
942
|
+
export declare const PluginProgramSpreadsheetExportArgs: z.ZodObject<{
|
|
943
|
+
format: z.ZodEnum<{
|
|
944
|
+
pdf: "pdf";
|
|
945
|
+
xlsx: "xlsx";
|
|
946
|
+
csv: "csv";
|
|
947
|
+
}>;
|
|
948
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
949
|
+
}, z.core.$strip>;
|
|
950
|
+
export type PluginProgramSpreadsheetExportArgs = z.infer<typeof PluginProgramSpreadsheetExportArgs>;
|
|
951
|
+
/**
|
|
952
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.export} — the exported workbook file.
|
|
953
|
+
*
|
|
954
|
+
* | Property | Type | Description |
|
|
955
|
+
* |---|---|---|
|
|
956
|
+
* | `format` | `"xlsx" \| "pdf" \| "csv"` | The format the file was exported in |
|
|
957
|
+
* | `fileName` | `string` | The file name (with extension) |
|
|
958
|
+
* | `mimeType` | `string` | The file's MIME type |
|
|
959
|
+
* | `dataBase64` | `string` | The file's bytes, base64-encoded |
|
|
960
|
+
*/
|
|
961
|
+
export declare const PluginProgramSpreadsheetExportResult: z.ZodObject<{
|
|
962
|
+
format: z.ZodEnum<{
|
|
963
|
+
pdf: "pdf";
|
|
964
|
+
xlsx: "xlsx";
|
|
965
|
+
csv: "csv";
|
|
966
|
+
}>;
|
|
967
|
+
fileName: z.ZodString;
|
|
968
|
+
mimeType: z.ZodString;
|
|
969
|
+
dataBase64: z.ZodString;
|
|
970
|
+
}, z.core.$strip>;
|
|
971
|
+
export type PluginProgramSpreadsheetExportResult = z.infer<typeof PluginProgramSpreadsheetExportResult>;
|
|
972
|
+
/**
|
|
973
|
+
* Metadata for one sheet in {@linkcode PluginProgramSpreadsheetListSheetsResult}.
|
|
974
|
+
*
|
|
975
|
+
* | Property | Type | Description |
|
|
976
|
+
* |---|---|---|
|
|
977
|
+
* | `name` | `string` | Sheet name |
|
|
978
|
+
* | `index` | `number` | Zero-based sheet index |
|
|
979
|
+
* | `visible` | `boolean` | Whether the sheet is visible |
|
|
980
|
+
* | `rowCount` | `number` | Total rows in the sheet |
|
|
981
|
+
* | `colCount` | `number` | Total columns in the sheet |
|
|
982
|
+
*/
|
|
983
|
+
export declare const PluginSpreadsheetSheetInfo: z.ZodObject<{
|
|
984
|
+
name: z.ZodString;
|
|
985
|
+
index: z.ZodNumber;
|
|
986
|
+
visible: z.ZodBoolean;
|
|
987
|
+
rowCount: z.ZodNumber;
|
|
988
|
+
colCount: z.ZodNumber;
|
|
989
|
+
}, z.core.$strip>;
|
|
990
|
+
export type PluginSpreadsheetSheetInfo = z.infer<typeof PluginSpreadsheetSheetInfo>;
|
|
991
|
+
/**
|
|
992
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.listSheets}.
|
|
993
|
+
*
|
|
994
|
+
* | Property | Type | Description |
|
|
995
|
+
* |---|---|---|
|
|
996
|
+
* | `sheets` | {@linkcode PluginSpreadsheetSheetInfo}`[]` | All sheets in the workbook |
|
|
997
|
+
* | `activeSheet` | `string \| null` | The active sheet name, or `null` |
|
|
998
|
+
*/
|
|
999
|
+
export declare const PluginProgramSpreadsheetListSheetsResult: z.ZodObject<{
|
|
1000
|
+
sheets: z.ZodArray<z.ZodObject<{
|
|
1001
|
+
name: z.ZodString;
|
|
1002
|
+
index: z.ZodNumber;
|
|
1003
|
+
visible: z.ZodBoolean;
|
|
1004
|
+
rowCount: z.ZodNumber;
|
|
1005
|
+
colCount: z.ZodNumber;
|
|
1006
|
+
}, z.core.$strip>>;
|
|
1007
|
+
activeSheet: z.ZodNullable<z.ZodString>;
|
|
1008
|
+
}, z.core.$strip>;
|
|
1009
|
+
export type PluginProgramSpreadsheetListSheetsResult = z.infer<typeof PluginProgramSpreadsheetListSheetsResult>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.getSheetData}.
|
|
1012
|
+
*
|
|
1013
|
+
* | Property | Type | Description |
|
|
1014
|
+
* |---|---|---|
|
|
1015
|
+
* | `sheetName` | `string` | Sheet to read |
|
|
1016
|
+
* | `range` | `string?` | A1 range; defaults to the sheet's used range |
|
|
1017
|
+
* | `header` | `boolean?` | When `true`, also return records keyed by the first (header) row |
|
|
1018
|
+
*/
|
|
1019
|
+
export declare const PluginProgramSpreadsheetGetSheetDataArgs: z.ZodObject<{
|
|
1020
|
+
sheetName: z.ZodString;
|
|
1021
|
+
range: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
header: z.ZodOptional<z.ZodBoolean>;
|
|
1023
|
+
}, z.core.$strip>;
|
|
1024
|
+
export type PluginProgramSpreadsheetGetSheetDataArgs = z.infer<typeof PluginProgramSpreadsheetGetSheetDataArgs>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.getSheetData}.
|
|
1027
|
+
*
|
|
1028
|
+
* | Property | Type | Description |
|
|
1029
|
+
* |---|---|---|
|
|
1030
|
+
* | `sheetName` | `string` | The sheet that was read |
|
|
1031
|
+
* | `range` | `string` | A1 range that was read |
|
|
1032
|
+
* | `values` | `cell[][]` | Row-major matrix of cell values |
|
|
1033
|
+
* | `records` | `Record<string, cell>[]?` | Present only when `header` was `true`: rows keyed by header |
|
|
1034
|
+
*/
|
|
1035
|
+
export declare const PluginProgramSpreadsheetGetSheetDataResult: z.ZodObject<{
|
|
1036
|
+
sheetName: z.ZodString;
|
|
1037
|
+
range: z.ZodString;
|
|
1038
|
+
values: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
1039
|
+
records: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>;
|
|
1040
|
+
}, z.core.$strip>;
|
|
1041
|
+
export type PluginProgramSpreadsheetGetSheetDataResult = z.infer<typeof PluginProgramSpreadsheetGetSheetDataResult>;
|
|
1042
|
+
/** Chart type for {@linkcode PluginProgramSpreadsheetApi.addChart}. */
|
|
1043
|
+
export declare const PluginSpreadsheetChartType: z.ZodEnum<{
|
|
1044
|
+
line: "line";
|
|
1045
|
+
area: "area";
|
|
1046
|
+
column: "column";
|
|
1047
|
+
bar: "bar";
|
|
1048
|
+
pie: "pie";
|
|
1049
|
+
scatter: "scatter";
|
|
1050
|
+
}>;
|
|
1051
|
+
export type PluginSpreadsheetChartType = z.infer<typeof PluginSpreadsheetChartType>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.addChart}.
|
|
1054
|
+
*
|
|
1055
|
+
* | Property | Type | Description |
|
|
1056
|
+
* |---|---|---|
|
|
1057
|
+
* | `sheetName` | `string` | Sheet to add the chart to |
|
|
1058
|
+
* | `chartType` | `"column" \| "bar" \| "line" \| "pie" \| "area" \| "scatter"` | Chart type |
|
|
1059
|
+
* | `dataRange` | `string` | A1 range driving the chart |
|
|
1060
|
+
* | `title` | `string?` | Optional chart title |
|
|
1061
|
+
* | `position` | `{ x; y }?` | Top-left position (sheet coords) |
|
|
1062
|
+
* | `size` | `{ width; height }?` | Chart size in px |
|
|
1063
|
+
*/
|
|
1064
|
+
export declare const PluginProgramSpreadsheetAddChartArgs: z.ZodObject<{
|
|
1065
|
+
sheetName: z.ZodString;
|
|
1066
|
+
chartType: z.ZodEnum<{
|
|
1067
|
+
line: "line";
|
|
1068
|
+
area: "area";
|
|
1069
|
+
column: "column";
|
|
1070
|
+
bar: "bar";
|
|
1071
|
+
pie: "pie";
|
|
1072
|
+
scatter: "scatter";
|
|
1073
|
+
}>;
|
|
1074
|
+
dataRange: z.ZodString;
|
|
1075
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1076
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
1077
|
+
x: z.ZodNumber;
|
|
1078
|
+
y: z.ZodNumber;
|
|
1079
|
+
}, z.core.$strip>>;
|
|
1080
|
+
size: z.ZodOptional<z.ZodObject<{
|
|
1081
|
+
width: z.ZodNumber;
|
|
1082
|
+
height: z.ZodNumber;
|
|
1083
|
+
}, z.core.$strip>>;
|
|
1084
|
+
}, z.core.$strip>;
|
|
1085
|
+
export type PluginProgramSpreadsheetAddChartArgs = z.infer<typeof PluginProgramSpreadsheetAddChartArgs>;
|
|
1086
|
+
/**
|
|
1087
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.addChart}.
|
|
1088
|
+
*
|
|
1089
|
+
* | Property | Type | Description |
|
|
1090
|
+
* |---|---|---|
|
|
1091
|
+
* | `chartId` | `string` | Id of the created chart |
|
|
1092
|
+
*/
|
|
1093
|
+
export declare const PluginProgramSpreadsheetAddChartResult: z.ZodObject<{
|
|
1094
|
+
chartId: z.ZodString;
|
|
1095
|
+
}, z.core.$strip>;
|
|
1096
|
+
export type PluginProgramSpreadsheetAddChartResult = z.infer<typeof PluginProgramSpreadsheetAddChartResult>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.highlightCells}.
|
|
1099
|
+
*
|
|
1100
|
+
* | Property | Type | Description |
|
|
1101
|
+
* |---|---|---|
|
|
1102
|
+
* | `sheetName` | `string` | Sheet containing the range |
|
|
1103
|
+
* | `range` | `string` | A1 range to highlight |
|
|
1104
|
+
* | `color` | `string?` | CSS hex background color (a default emphasis is used when omitted) |
|
|
1105
|
+
* | `bold` | `boolean?` | Also bold the text |
|
|
1106
|
+
*/
|
|
1107
|
+
export declare const PluginProgramSpreadsheetHighlightCellsArgs: z.ZodObject<{
|
|
1108
|
+
sheetName: z.ZodString;
|
|
1109
|
+
range: z.ZodString;
|
|
1110
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
1112
|
+
}, z.core.$strip>;
|
|
1113
|
+
export type PluginProgramSpreadsheetHighlightCellsArgs = z.infer<typeof PluginProgramSpreadsheetHighlightCellsArgs>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.highlightCells}.
|
|
1116
|
+
*
|
|
1117
|
+
* | Property | Type | Description |
|
|
1118
|
+
* |---|---|---|
|
|
1119
|
+
* | `sheetName` | `string` | The sheet that was highlighted |
|
|
1120
|
+
* | `range` | `string` | The range that was highlighted |
|
|
1121
|
+
*/
|
|
1122
|
+
export declare const PluginProgramSpreadsheetHighlightCellsResult: z.ZodObject<{
|
|
1123
|
+
sheetName: z.ZodString;
|
|
1124
|
+
range: z.ZodString;
|
|
1125
|
+
}, z.core.$strip>;
|
|
1126
|
+
export type PluginProgramSpreadsheetHighlightCellsResult = z.infer<typeof PluginProgramSpreadsheetHighlightCellsResult>;
|
|
1127
|
+
/**
|
|
1128
|
+
* One department row in the area-program dataset. Areas are in the enclosing
|
|
1129
|
+
* {@linkcode PluginProgramSpreadsheetGetProgramResult}'s `units`. This mirrors
|
|
1130
|
+
* {@linkcode PluginProgramDepartmentMetric}, plus a derived `variance`.
|
|
1131
|
+
*
|
|
1132
|
+
* | Property | Type | Description |
|
|
1133
|
+
* |---|---|---|
|
|
1134
|
+
* | `departmentId` | `string` | Department id |
|
|
1135
|
+
* | `name` | `string` | Department name |
|
|
1136
|
+
* | `targetArea` | `number \| null` | Target area, or `null` if no target is set |
|
|
1137
|
+
* | `allocatedArea` | `number` | Area currently allocated to this department |
|
|
1138
|
+
* | `variance` | `number \| null` | `allocatedArea − targetArea`, or `null` when no target |
|
|
1139
|
+
*/
|
|
1140
|
+
export declare const PluginSpreadsheetProgramRow: z.ZodObject<{
|
|
1141
|
+
departmentId: z.ZodString;
|
|
1142
|
+
name: z.ZodString;
|
|
1143
|
+
targetArea: z.ZodNullable<z.ZodNumber>;
|
|
1144
|
+
allocatedArea: z.ZodNumber;
|
|
1145
|
+
variance: z.ZodNullable<z.ZodNumber>;
|
|
1146
|
+
}, z.core.$strip>;
|
|
1147
|
+
export type PluginSpreadsheetProgramRow = z.infer<typeof PluginSpreadsheetProgramRow>;
|
|
1148
|
+
/**
|
|
1149
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.getProgram} — the area-program
|
|
1150
|
+
* dataset {@linkcode PluginProgramSpreadsheetApi.renderProgram} draws. For the
|
|
1151
|
+
* canonical summary read, see {@linkcode PluginProgramMetricsApi.get}.
|
|
1152
|
+
*
|
|
1153
|
+
* | Property | Type | Description |
|
|
1154
|
+
* |---|---|---|
|
|
1155
|
+
* | `units` | `"ft2" \| "m2"` | The unit every area in this dataset is reported in |
|
|
1156
|
+
* | `rows` | {@linkcode PluginSpreadsheetProgramRow}`[]` | Per-department program rows |
|
|
1157
|
+
* | `totalTargetArea` | `number` | Sum of all department target areas |
|
|
1158
|
+
* | `totalAllocatedArea` | `number` | Total allocated area |
|
|
1159
|
+
* | `generatedAt` | `string` | ISO timestamp of when the dataset was projected |
|
|
1160
|
+
*/
|
|
1161
|
+
export declare const PluginProgramSpreadsheetGetProgramResult: z.ZodObject<{
|
|
1162
|
+
units: z.ZodEnum<{
|
|
1163
|
+
ft2: "ft2";
|
|
1164
|
+
m2: "m2";
|
|
1165
|
+
}>;
|
|
1166
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
1167
|
+
departmentId: z.ZodString;
|
|
1168
|
+
name: z.ZodString;
|
|
1169
|
+
targetArea: z.ZodNullable<z.ZodNumber>;
|
|
1170
|
+
allocatedArea: z.ZodNumber;
|
|
1171
|
+
variance: z.ZodNullable<z.ZodNumber>;
|
|
1172
|
+
}, z.core.$strip>>;
|
|
1173
|
+
totalTargetArea: z.ZodNumber;
|
|
1174
|
+
totalAllocatedArea: z.ZodNumber;
|
|
1175
|
+
generatedAt: z.ZodString;
|
|
1176
|
+
}, z.core.$strip>;
|
|
1177
|
+
export type PluginProgramSpreadsheetGetProgramResult = z.infer<typeof PluginProgramSpreadsheetGetProgramResult>;
|
|
1178
|
+
/**
|
|
1179
|
+
* One family-aggregated row in the quantity/material takeoff dataset. The takeoff
|
|
1180
|
+
* is grouped by object type + category + family (not per element), so each row is
|
|
1181
|
+
* a rolled-up quantity for that family.
|
|
1182
|
+
*
|
|
1183
|
+
* | Property | Type | Description |
|
|
1184
|
+
* |---|---|---|
|
|
1185
|
+
* | `objectType` | `string` | Element object type (e.g. `"Wall"`, `"Door"`, `"Window"`) |
|
|
1186
|
+
* | `category` | `string` | Element category |
|
|
1187
|
+
* | `family` | `string` | Element family the quantity is aggregated over |
|
|
1188
|
+
* | `quantity` | `number` | Aggregated quantity in `unit` |
|
|
1189
|
+
* | `unit` | `string` | Quantity unit (e.g. `"m"` for length, `"m2"` for area) |
|
|
1190
|
+
*/
|
|
1191
|
+
export declare const PluginSpreadsheetTakeoffRow: z.ZodObject<{
|
|
1192
|
+
objectType: z.ZodString;
|
|
1193
|
+
category: z.ZodString;
|
|
1194
|
+
family: z.ZodString;
|
|
1195
|
+
quantity: z.ZodNumber;
|
|
1196
|
+
unit: z.ZodString;
|
|
1197
|
+
}, z.core.$strip>;
|
|
1198
|
+
export type PluginSpreadsheetTakeoffRow = z.infer<typeof PluginSpreadsheetTakeoffRow>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.getTakeoff} — the takeoff dataset
|
|
1201
|
+
* {@linkcode PluginProgramSpreadsheetApi.renderTakeoff} draws.
|
|
1202
|
+
*
|
|
1203
|
+
* | Property | Type | Description |
|
|
1204
|
+
* |---|---|---|
|
|
1205
|
+
* | `rows` | {@linkcode PluginSpreadsheetTakeoffRow}`[]` | One row per aggregated object-type/category/family group |
|
|
1206
|
+
* | `rowCount` | `number` | Number of rows |
|
|
1207
|
+
* | `generatedAt` | `string` | ISO timestamp of when the dataset was read |
|
|
1208
|
+
*/
|
|
1209
|
+
export declare const PluginProgramSpreadsheetGetTakeoffResult: z.ZodObject<{
|
|
1210
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
1211
|
+
objectType: z.ZodString;
|
|
1212
|
+
category: z.ZodString;
|
|
1213
|
+
family: z.ZodString;
|
|
1214
|
+
quantity: z.ZodNumber;
|
|
1215
|
+
unit: z.ZodString;
|
|
1216
|
+
}, z.core.$strip>>;
|
|
1217
|
+
rowCount: z.ZodNumber;
|
|
1218
|
+
generatedAt: z.ZodString;
|
|
1219
|
+
}, z.core.$strip>;
|
|
1220
|
+
export type PluginProgramSpreadsheetGetTakeoffResult = z.infer<typeof PluginProgramSpreadsheetGetTakeoffResult>;
|
|
1221
|
+
/** Behaviour when {@linkcode PluginProgramSpreadsheetApi.createSheet} targets an existing sheet name. */
|
|
1222
|
+
export declare const PluginSpreadsheetWhenExists: z.ZodEnum<{
|
|
1223
|
+
error: "error";
|
|
1224
|
+
replace: "replace";
|
|
1225
|
+
reuse: "reuse";
|
|
1226
|
+
}>;
|
|
1227
|
+
export type PluginSpreadsheetWhenExists = z.infer<typeof PluginSpreadsheetWhenExists>;
|
|
1228
|
+
/**
|
|
1229
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.createSheet}.
|
|
1230
|
+
*
|
|
1231
|
+
* | Property | Type | Description |
|
|
1232
|
+
* |---|---|---|
|
|
1233
|
+
* | `name` | `string` | The sheet name to create |
|
|
1234
|
+
* | `whenExists` | `"reuse" \| "replace" \| "error"?` | Behaviour if the name exists (default `"reuse"`) |
|
|
1235
|
+
*/
|
|
1236
|
+
export declare const PluginProgramSpreadsheetCreateSheetArgs: z.ZodObject<{
|
|
1237
|
+
name: z.ZodString;
|
|
1238
|
+
whenExists: z.ZodOptional<z.ZodEnum<{
|
|
1239
|
+
error: "error";
|
|
1240
|
+
replace: "replace";
|
|
1241
|
+
reuse: "reuse";
|
|
1242
|
+
}>>;
|
|
1243
|
+
}, z.core.$strip>;
|
|
1244
|
+
export type PluginProgramSpreadsheetCreateSheetArgs = z.infer<typeof PluginProgramSpreadsheetCreateSheetArgs>;
|
|
1245
|
+
/**
|
|
1246
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.createSheet}.
|
|
1247
|
+
*
|
|
1248
|
+
* | Property | Type | Description |
|
|
1249
|
+
* |---|---|---|
|
|
1250
|
+
* | `sheetName` | `string` | The resolved sheet name |
|
|
1251
|
+
* | `replaced` | `boolean` | Whether an existing sheet was replaced/cleared |
|
|
1252
|
+
* | `sheetIndex` | `number \| null` | Zero-based index of the sheet, or `null` if unknown |
|
|
1253
|
+
*/
|
|
1254
|
+
export declare const PluginProgramSpreadsheetCreateSheetResult: z.ZodObject<{
|
|
1255
|
+
sheetName: z.ZodString;
|
|
1256
|
+
replaced: z.ZodBoolean;
|
|
1257
|
+
sheetIndex: z.ZodNullable<z.ZodNumber>;
|
|
1258
|
+
}, z.core.$strip>;
|
|
1259
|
+
export type PluginProgramSpreadsheetCreateSheetResult = z.infer<typeof PluginProgramSpreadsheetCreateSheetResult>;
|
|
1260
|
+
/**
|
|
1261
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.setValues}.
|
|
1262
|
+
*
|
|
1263
|
+
* | Property | Type | Description |
|
|
1264
|
+
* |---|---|---|
|
|
1265
|
+
* | `sheetName` | `string` | Sheet to write into |
|
|
1266
|
+
* | `values` | `cell[][]` | Row-major matrix of values to write |
|
|
1267
|
+
* | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
|
|
1268
|
+
*/
|
|
1269
|
+
export declare const PluginProgramSpreadsheetSetValuesArgs: z.ZodObject<{
|
|
1270
|
+
sheetName: z.ZodString;
|
|
1271
|
+
values: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
1272
|
+
startCell: z.ZodOptional<z.ZodString>;
|
|
1273
|
+
}, z.core.$strip>;
|
|
1274
|
+
export type PluginProgramSpreadsheetSetValuesArgs = z.infer<typeof PluginProgramSpreadsheetSetValuesArgs>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.setValues}.
|
|
1277
|
+
*
|
|
1278
|
+
* | Property | Type | Description |
|
|
1279
|
+
* |---|---|---|
|
|
1280
|
+
* | `sheetName` | `string` | The sheet that was written |
|
|
1281
|
+
* | `startCell` | `string` | The anchor cell values were written from |
|
|
1282
|
+
* | `rowCount` | `number` | Number of rows written |
|
|
1283
|
+
* | `colCount` | `number` | Widest row's column count |
|
|
1284
|
+
*/
|
|
1285
|
+
export declare const PluginProgramSpreadsheetSetValuesResult: z.ZodObject<{
|
|
1286
|
+
sheetName: z.ZodString;
|
|
1287
|
+
startCell: z.ZodString;
|
|
1288
|
+
rowCount: z.ZodNumber;
|
|
1289
|
+
colCount: z.ZodNumber;
|
|
1290
|
+
}, z.core.$strip>;
|
|
1291
|
+
export type PluginProgramSpreadsheetSetValuesResult = z.infer<typeof PluginProgramSpreadsheetSetValuesResult>;
|
|
1292
|
+
/**
|
|
1293
|
+
* A single cell formula for {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
|
|
1294
|
+
*
|
|
1295
|
+
* | Property | Type | Description |
|
|
1296
|
+
* |---|---|---|
|
|
1297
|
+
* | `cell` | `string` | Target cell in A1 notation |
|
|
1298
|
+
* | `formula` | `string` | Formula expression (a leading `=` is optional) |
|
|
1299
|
+
*/
|
|
1300
|
+
export declare const PluginSpreadsheetFormula: z.ZodObject<{
|
|
1301
|
+
cell: z.ZodString;
|
|
1302
|
+
formula: z.ZodString;
|
|
1303
|
+
}, z.core.$strip>;
|
|
1304
|
+
export type PluginSpreadsheetFormula = z.infer<typeof PluginSpreadsheetFormula>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
|
|
1307
|
+
*
|
|
1308
|
+
* | Property | Type | Description |
|
|
1309
|
+
* |---|---|---|
|
|
1310
|
+
* | `sheetName` | `string` | Sheet to set formulas on |
|
|
1311
|
+
* | `formulas` | {@linkcode PluginSpreadsheetFormula}`[]` | The cell → formula assignments |
|
|
1312
|
+
*/
|
|
1313
|
+
export declare const PluginProgramSpreadsheetSetFormulasArgs: z.ZodObject<{
|
|
1314
|
+
sheetName: z.ZodString;
|
|
1315
|
+
formulas: z.ZodArray<z.ZodObject<{
|
|
1316
|
+
cell: z.ZodString;
|
|
1317
|
+
formula: z.ZodString;
|
|
1318
|
+
}, z.core.$strip>>;
|
|
1319
|
+
}, z.core.$strip>;
|
|
1320
|
+
export type PluginProgramSpreadsheetSetFormulasArgs = z.infer<typeof PluginProgramSpreadsheetSetFormulasArgs>;
|
|
1321
|
+
/**
|
|
1322
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
|
|
1323
|
+
*
|
|
1324
|
+
* | Property | Type | Description |
|
|
1325
|
+
* |---|---|---|
|
|
1326
|
+
* | `sheetName` | `string` | The sheet that was written |
|
|
1327
|
+
* | `count` | `number` | Number of formulas set |
|
|
1328
|
+
*/
|
|
1329
|
+
export declare const PluginProgramSpreadsheetSetFormulasResult: z.ZodObject<{
|
|
1330
|
+
sheetName: z.ZodString;
|
|
1331
|
+
count: z.ZodNumber;
|
|
1332
|
+
}, z.core.$strip>;
|
|
1333
|
+
export type PluginProgramSpreadsheetSetFormulasResult = z.infer<typeof PluginProgramSpreadsheetSetFormulasResult>;
|
|
1334
|
+
/** Font weight for a {@linkcode PluginSpreadsheetCellStyle}. */
|
|
1335
|
+
export declare const PluginSpreadsheetFontWeight: z.ZodEnum<{
|
|
1336
|
+
normal: "normal";
|
|
1337
|
+
bold: "bold";
|
|
1338
|
+
}>;
|
|
1339
|
+
export type PluginSpreadsheetFontWeight = z.infer<typeof PluginSpreadsheetFontWeight>;
|
|
1340
|
+
/** Font style for a {@linkcode PluginSpreadsheetCellStyle}. */
|
|
1341
|
+
export declare const PluginSpreadsheetFontStyle: z.ZodEnum<{
|
|
1342
|
+
normal: "normal";
|
|
1343
|
+
italic: "italic";
|
|
1344
|
+
}>;
|
|
1345
|
+
export type PluginSpreadsheetFontStyle = z.infer<typeof PluginSpreadsheetFontStyle>;
|
|
1346
|
+
/** Horizontal cell alignment for a {@linkcode PluginSpreadsheetCellStyle}. */
|
|
1347
|
+
export declare const PluginSpreadsheetHorizontalAlign: z.ZodEnum<{
|
|
1348
|
+
center: "center";
|
|
1349
|
+
left: "left";
|
|
1350
|
+
right: "right";
|
|
1351
|
+
general: "general";
|
|
1352
|
+
}>;
|
|
1353
|
+
export type PluginSpreadsheetHorizontalAlign = z.infer<typeof PluginSpreadsheetHorizontalAlign>;
|
|
1354
|
+
/** Vertical cell alignment for a {@linkcode PluginSpreadsheetCellStyle}. */
|
|
1355
|
+
export declare const PluginSpreadsheetVerticalAlign: z.ZodEnum<{
|
|
1356
|
+
center: "center";
|
|
1357
|
+
top: "top";
|
|
1358
|
+
bottom: "bottom";
|
|
1359
|
+
}>;
|
|
1360
|
+
export type PluginSpreadsheetVerticalAlign = z.infer<typeof PluginSpreadsheetVerticalAlign>;
|
|
1361
|
+
/**
|
|
1362
|
+
* A cell style for {@linkcode PluginProgramSpreadsheetApi.setStyles}. All fields
|
|
1363
|
+
* are optional; only the ones provided are applied.
|
|
1364
|
+
*
|
|
1365
|
+
* | Property | Type | Description |
|
|
1366
|
+
* |---|---|---|
|
|
1367
|
+
* | `backColor` | `string?` | Background (fill) color, CSS hex |
|
|
1368
|
+
* | `foreColor` | `string?` | Text color, CSS hex |
|
|
1369
|
+
* | `font` | `string?` | Full CSS font shorthand (overrides the parts below) |
|
|
1370
|
+
* | `fontFamily` | `string?` | Font family |
|
|
1371
|
+
* | `fontSize` | `number?` | Font size in px |
|
|
1372
|
+
* | `fontWeight` | `"normal" \| "bold"?` | Font weight |
|
|
1373
|
+
* | `fontStyle` | `"normal" \| "italic"?` | Font style |
|
|
1374
|
+
* | `formatter` | `string?` | Number/date format string |
|
|
1375
|
+
* | `horizontalAlign` | `"left" \| "center" \| "right" \| "general"?` | Horizontal alignment |
|
|
1376
|
+
* | `verticalAlign` | `"top" \| "center" \| "bottom"?` | Vertical alignment |
|
|
1377
|
+
*/
|
|
1378
|
+
export declare const PluginSpreadsheetCellStyle: z.ZodObject<{
|
|
1379
|
+
backColor: z.ZodOptional<z.ZodString>;
|
|
1380
|
+
foreColor: z.ZodOptional<z.ZodString>;
|
|
1381
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1382
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1383
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
1384
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
1385
|
+
normal: "normal";
|
|
1386
|
+
bold: "bold";
|
|
1387
|
+
}>>;
|
|
1388
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
1389
|
+
normal: "normal";
|
|
1390
|
+
italic: "italic";
|
|
1391
|
+
}>>;
|
|
1392
|
+
formatter: z.ZodOptional<z.ZodString>;
|
|
1393
|
+
horizontalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1394
|
+
center: "center";
|
|
1395
|
+
left: "left";
|
|
1396
|
+
right: "right";
|
|
1397
|
+
general: "general";
|
|
1398
|
+
}>>;
|
|
1399
|
+
verticalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1400
|
+
center: "center";
|
|
1401
|
+
top: "top";
|
|
1402
|
+
bottom: "bottom";
|
|
1403
|
+
}>>;
|
|
1404
|
+
}, z.core.$strip>;
|
|
1405
|
+
export type PluginSpreadsheetCellStyle = z.infer<typeof PluginSpreadsheetCellStyle>;
|
|
1406
|
+
/**
|
|
1407
|
+
* A range + the style to apply to it, for {@linkcode PluginProgramSpreadsheetApi.setStyles}.
|
|
1408
|
+
*
|
|
1409
|
+
* | Property | Type | Description |
|
|
1410
|
+
* |---|---|---|
|
|
1411
|
+
* | `range` | `string` | A1 range to style |
|
|
1412
|
+
* | `style` | {@linkcode PluginSpreadsheetCellStyle} | The style to apply |
|
|
1413
|
+
*/
|
|
1414
|
+
export declare const PluginSpreadsheetRangeStyle: z.ZodObject<{
|
|
1415
|
+
range: z.ZodString;
|
|
1416
|
+
style: z.ZodObject<{
|
|
1417
|
+
backColor: z.ZodOptional<z.ZodString>;
|
|
1418
|
+
foreColor: z.ZodOptional<z.ZodString>;
|
|
1419
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1420
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1421
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
1422
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
1423
|
+
normal: "normal";
|
|
1424
|
+
bold: "bold";
|
|
1425
|
+
}>>;
|
|
1426
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
1427
|
+
normal: "normal";
|
|
1428
|
+
italic: "italic";
|
|
1429
|
+
}>>;
|
|
1430
|
+
formatter: z.ZodOptional<z.ZodString>;
|
|
1431
|
+
horizontalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1432
|
+
center: "center";
|
|
1433
|
+
left: "left";
|
|
1434
|
+
right: "right";
|
|
1435
|
+
general: "general";
|
|
1436
|
+
}>>;
|
|
1437
|
+
verticalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1438
|
+
center: "center";
|
|
1439
|
+
top: "top";
|
|
1440
|
+
bottom: "bottom";
|
|
1441
|
+
}>>;
|
|
1442
|
+
}, z.core.$strip>;
|
|
1443
|
+
}, z.core.$strip>;
|
|
1444
|
+
export type PluginSpreadsheetRangeStyle = z.infer<typeof PluginSpreadsheetRangeStyle>;
|
|
1445
|
+
/**
|
|
1446
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.setStyles}.
|
|
1447
|
+
*
|
|
1448
|
+
* | Property | Type | Description |
|
|
1449
|
+
* |---|---|---|
|
|
1450
|
+
* | `sheetName` | `string` | Sheet containing the ranges |
|
|
1451
|
+
* | `ranges` | {@linkcode PluginSpreadsheetRangeStyle}`[]` | Range → style assignments |
|
|
1452
|
+
*/
|
|
1453
|
+
export declare const PluginProgramSpreadsheetSetStylesArgs: z.ZodObject<{
|
|
1454
|
+
sheetName: z.ZodString;
|
|
1455
|
+
ranges: z.ZodArray<z.ZodObject<{
|
|
1456
|
+
range: z.ZodString;
|
|
1457
|
+
style: z.ZodObject<{
|
|
1458
|
+
backColor: z.ZodOptional<z.ZodString>;
|
|
1459
|
+
foreColor: z.ZodOptional<z.ZodString>;
|
|
1460
|
+
font: z.ZodOptional<z.ZodString>;
|
|
1461
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
1462
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
1463
|
+
fontWeight: z.ZodOptional<z.ZodEnum<{
|
|
1464
|
+
normal: "normal";
|
|
1465
|
+
bold: "bold";
|
|
1466
|
+
}>>;
|
|
1467
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
1468
|
+
normal: "normal";
|
|
1469
|
+
italic: "italic";
|
|
1470
|
+
}>>;
|
|
1471
|
+
formatter: z.ZodOptional<z.ZodString>;
|
|
1472
|
+
horizontalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1473
|
+
center: "center";
|
|
1474
|
+
left: "left";
|
|
1475
|
+
right: "right";
|
|
1476
|
+
general: "general";
|
|
1477
|
+
}>>;
|
|
1478
|
+
verticalAlign: z.ZodOptional<z.ZodEnum<{
|
|
1479
|
+
center: "center";
|
|
1480
|
+
top: "top";
|
|
1481
|
+
bottom: "bottom";
|
|
1482
|
+
}>>;
|
|
1483
|
+
}, z.core.$strip>;
|
|
1484
|
+
}, z.core.$strip>>;
|
|
1485
|
+
}, z.core.$strip>;
|
|
1486
|
+
export type PluginProgramSpreadsheetSetStylesArgs = z.infer<typeof PluginProgramSpreadsheetSetStylesArgs>;
|
|
1487
|
+
/**
|
|
1488
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.setStyles}.
|
|
1489
|
+
*
|
|
1490
|
+
* | Property | Type | Description |
|
|
1491
|
+
* |---|---|---|
|
|
1492
|
+
* | `sheetName` | `string` | The sheet that was styled |
|
|
1493
|
+
* | `count` | `number` | Number of ranges styled |
|
|
1494
|
+
*/
|
|
1495
|
+
export declare const PluginProgramSpreadsheetSetStylesResult: z.ZodObject<{
|
|
1496
|
+
sheetName: z.ZodString;
|
|
1497
|
+
count: z.ZodNumber;
|
|
1498
|
+
}, z.core.$strip>;
|
|
1499
|
+
export type PluginProgramSpreadsheetSetStylesResult = z.infer<typeof PluginProgramSpreadsheetSetStylesResult>;
|
|
1500
|
+
/**
|
|
1501
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.mergeCells}.
|
|
1502
|
+
*
|
|
1503
|
+
* | Property | Type | Description |
|
|
1504
|
+
* |---|---|---|
|
|
1505
|
+
* | `sheetName` | `string` | Sheet containing the range |
|
|
1506
|
+
* | `range` | `string` | A1 range to merge into one spanned cell |
|
|
1507
|
+
* | `value` | `cell?` | Optional value to set in the merged (top-left) cell |
|
|
1508
|
+
*/
|
|
1509
|
+
export declare const PluginProgramSpreadsheetMergeCellsArgs: z.ZodObject<{
|
|
1510
|
+
sheetName: z.ZodString;
|
|
1511
|
+
range: z.ZodString;
|
|
1512
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
1513
|
+
}, z.core.$strip>;
|
|
1514
|
+
export type PluginProgramSpreadsheetMergeCellsArgs = z.infer<typeof PluginProgramSpreadsheetMergeCellsArgs>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.mergeCells}.
|
|
1517
|
+
*
|
|
1518
|
+
* | Property | Type | Description |
|
|
1519
|
+
* |---|---|---|
|
|
1520
|
+
* | `sheetName` | `string` | The sheet that was merged |
|
|
1521
|
+
* | `range` | `string` | The range that was merged |
|
|
1522
|
+
*/
|
|
1523
|
+
export declare const PluginProgramSpreadsheetMergeCellsResult: z.ZodObject<{
|
|
1524
|
+
sheetName: z.ZodString;
|
|
1525
|
+
range: z.ZodString;
|
|
1526
|
+
}, z.core.$strip>;
|
|
1527
|
+
export type PluginProgramSpreadsheetMergeCellsResult = z.infer<typeof PluginProgramSpreadsheetMergeCellsResult>;
|
|
1528
|
+
/** Conditional-formatting rule type. Currently only `dataBar`; more are reserved. */
|
|
1529
|
+
export declare const PluginSpreadsheetConditionalRuleType: z.ZodEnum<{
|
|
1530
|
+
dataBar: "dataBar";
|
|
1531
|
+
}>;
|
|
1532
|
+
export type PluginSpreadsheetConditionalRuleType = z.infer<typeof PluginSpreadsheetConditionalRuleType>;
|
|
1533
|
+
/**
|
|
1534
|
+
* A conditional-formatting rule for {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
|
|
1535
|
+
*
|
|
1536
|
+
* | Property | Type | Description |
|
|
1537
|
+
* |---|---|---|
|
|
1538
|
+
* | `type` | `"dataBar"` | The rule kind (a proportional in-cell bar) |
|
|
1539
|
+
* | `color` | `string?` | Bar color, CSS hex (a default is used when omitted) |
|
|
1540
|
+
*/
|
|
1541
|
+
export declare const PluginSpreadsheetConditionalRule: z.ZodObject<{
|
|
1542
|
+
type: z.ZodEnum<{
|
|
1543
|
+
dataBar: "dataBar";
|
|
1544
|
+
}>;
|
|
1545
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1546
|
+
}, z.core.$strip>;
|
|
1547
|
+
export type PluginSpreadsheetConditionalRule = z.infer<typeof PluginSpreadsheetConditionalRule>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
|
|
1550
|
+
*
|
|
1551
|
+
* | Property | Type | Description |
|
|
1552
|
+
* |---|---|---|
|
|
1553
|
+
* | `sheetName` | `string` | Sheet containing the range |
|
|
1554
|
+
* | `range` | `string` | A1 range to format |
|
|
1555
|
+
* | `rule` | {@linkcode PluginSpreadsheetConditionalRule} | The conditional-format rule |
|
|
1556
|
+
*/
|
|
1557
|
+
export declare const PluginProgramSpreadsheetAddConditionalFormattingArgs: z.ZodObject<{
|
|
1558
|
+
sheetName: z.ZodString;
|
|
1559
|
+
range: z.ZodString;
|
|
1560
|
+
rule: z.ZodObject<{
|
|
1561
|
+
type: z.ZodEnum<{
|
|
1562
|
+
dataBar: "dataBar";
|
|
1563
|
+
}>;
|
|
1564
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1565
|
+
}, z.core.$strip>;
|
|
1566
|
+
}, z.core.$strip>;
|
|
1567
|
+
export type PluginProgramSpreadsheetAddConditionalFormattingArgs = z.infer<typeof PluginProgramSpreadsheetAddConditionalFormattingArgs>;
|
|
1568
|
+
/**
|
|
1569
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
|
|
1570
|
+
*
|
|
1571
|
+
* | Property | Type | Description |
|
|
1572
|
+
* |---|---|---|
|
|
1573
|
+
* | `sheetName` | `string` | The sheet that was formatted |
|
|
1574
|
+
* | `range` | `string` | The range the rule was applied to |
|
|
1575
|
+
* | `created` | `boolean` | Whether a data-bar rule was created (vs a fallback fill) |
|
|
1576
|
+
*/
|
|
1577
|
+
export declare const PluginProgramSpreadsheetAddConditionalFormattingResult: z.ZodObject<{
|
|
1578
|
+
sheetName: z.ZodString;
|
|
1579
|
+
range: z.ZodString;
|
|
1580
|
+
created: z.ZodBoolean;
|
|
1581
|
+
}, z.core.$strip>;
|
|
1582
|
+
export type PluginProgramSpreadsheetAddConditionalFormattingResult = z.infer<typeof PluginProgramSpreadsheetAddConditionalFormattingResult>;
|
|
1583
|
+
/**
|
|
1584
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.recalculate}.
|
|
1585
|
+
*
|
|
1586
|
+
* | Property | Type | Description |
|
|
1587
|
+
* |---|---|---|
|
|
1588
|
+
* | `sheetName` | `string?` | A sheet to focus before recalculating; omit for the whole workbook |
|
|
1589
|
+
*/
|
|
1590
|
+
export declare const PluginProgramSpreadsheetRecalculateArgs: z.ZodObject<{
|
|
1591
|
+
sheetName: z.ZodOptional<z.ZodString>;
|
|
1592
|
+
}, z.core.$strip>;
|
|
1593
|
+
export type PluginProgramSpreadsheetRecalculateArgs = z.infer<typeof PluginProgramSpreadsheetRecalculateArgs>;
|
|
1594
|
+
/**
|
|
1595
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.recalculate}.
|
|
1596
|
+
*
|
|
1597
|
+
* | Property | Type | Description |
|
|
1598
|
+
* |---|---|---|
|
|
1599
|
+
* | `scope` | `"sheet" \| "workbook"` | Whether a single sheet was focused or the whole workbook |
|
|
1600
|
+
* | `sheetName` | `string \| null` | The focused sheet, or `null` for a workbook-wide recompute |
|
|
1601
|
+
*/
|
|
1602
|
+
export declare const PluginProgramSpreadsheetRecalculateResult: z.ZodObject<{
|
|
1603
|
+
scope: z.ZodEnum<{
|
|
1604
|
+
sheet: "sheet";
|
|
1605
|
+
workbook: "workbook";
|
|
1606
|
+
}>;
|
|
1607
|
+
sheetName: z.ZodNullable<z.ZodString>;
|
|
1608
|
+
}, z.core.$strip>;
|
|
1609
|
+
export type PluginProgramSpreadsheetRecalculateResult = z.infer<typeof PluginProgramSpreadsheetRecalculateResult>;
|
|
1610
|
+
/** A batchable operation name for {@linkcode PluginProgramSpreadsheetApi.transaction}. */
|
|
1611
|
+
export declare const PluginSpreadsheetTransactionMethod: z.ZodEnum<{
|
|
1612
|
+
createSheet: "createSheet";
|
|
1613
|
+
setValues: "setValues";
|
|
1614
|
+
setFormulas: "setFormulas";
|
|
1615
|
+
setStyles: "setStyles";
|
|
1616
|
+
mergeCells: "mergeCells";
|
|
1617
|
+
}>;
|
|
1618
|
+
export type PluginSpreadsheetTransactionMethod = z.infer<typeof PluginSpreadsheetTransactionMethod>;
|
|
1619
|
+
/**
|
|
1620
|
+
* One operation within a {@linkcode PluginProgramSpreadsheetApi.transaction}.
|
|
1621
|
+
*
|
|
1622
|
+
* | Property | Type | Description |
|
|
1623
|
+
* |---|---|---|
|
|
1624
|
+
* | `method` | {@linkcode PluginSpreadsheetTransactionMethod} | The batchable method to run |
|
|
1625
|
+
* | `args` | `unknown` | The `method`'s own arguments object |
|
|
1626
|
+
*/
|
|
1627
|
+
export declare const PluginSpreadsheetTransactionOp: z.ZodObject<{
|
|
1628
|
+
method: z.ZodEnum<{
|
|
1629
|
+
createSheet: "createSheet";
|
|
1630
|
+
setValues: "setValues";
|
|
1631
|
+
setFormulas: "setFormulas";
|
|
1632
|
+
setStyles: "setStyles";
|
|
1633
|
+
mergeCells: "mergeCells";
|
|
1634
|
+
}>;
|
|
1635
|
+
args: z.ZodUnknown;
|
|
1636
|
+
}, z.core.$strip>;
|
|
1637
|
+
export type PluginSpreadsheetTransactionOp = z.infer<typeof PluginSpreadsheetTransactionOp>;
|
|
1638
|
+
/**
|
|
1639
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.transaction}.
|
|
1640
|
+
*
|
|
1641
|
+
* | Property | Type | Description |
|
|
1642
|
+
* |---|---|---|
|
|
1643
|
+
* | `operations` | {@linkcode PluginSpreadsheetTransactionOp}`[]` | The operations to run in order |
|
|
1644
|
+
* | `label` | `string?` | Undo-history label for the batch |
|
|
1645
|
+
*/
|
|
1646
|
+
export declare const PluginProgramSpreadsheetTransactionArgs: z.ZodObject<{
|
|
1647
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
1648
|
+
method: z.ZodEnum<{
|
|
1649
|
+
createSheet: "createSheet";
|
|
1650
|
+
setValues: "setValues";
|
|
1651
|
+
setFormulas: "setFormulas";
|
|
1652
|
+
setStyles: "setStyles";
|
|
1653
|
+
mergeCells: "mergeCells";
|
|
1654
|
+
}>;
|
|
1655
|
+
args: z.ZodUnknown;
|
|
1656
|
+
}, z.core.$strip>>;
|
|
1657
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1658
|
+
}, z.core.$strip>;
|
|
1659
|
+
export type PluginProgramSpreadsheetTransactionArgs = z.infer<typeof PluginProgramSpreadsheetTransactionArgs>;
|
|
1660
|
+
/**
|
|
1661
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.transaction}.
|
|
1662
|
+
*
|
|
1663
|
+
* | Property | Type | Description |
|
|
1664
|
+
* |---|---|---|
|
|
1665
|
+
* | `label` | `string` | The undo-history label used |
|
|
1666
|
+
* | `operationCount` | `number` | Number of operations run |
|
|
1667
|
+
* | `results` | `unknown[]` | Each operation's result, in order |
|
|
1668
|
+
*/
|
|
1669
|
+
export declare const PluginProgramSpreadsheetTransactionResult: z.ZodObject<{
|
|
1670
|
+
label: z.ZodString;
|
|
1671
|
+
operationCount: z.ZodNumber;
|
|
1672
|
+
results: z.ZodArray<z.ZodUnknown>;
|
|
1673
|
+
}, z.core.$strip>;
|
|
1674
|
+
export type PluginProgramSpreadsheetTransactionResult = z.infer<typeof PluginProgramSpreadsheetTransactionResult>;
|
|
1675
|
+
/**
|
|
1676
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.runScript}.
|
|
1677
|
+
*
|
|
1678
|
+
* | Property | Type | Description |
|
|
1679
|
+
* |---|---|---|
|
|
1680
|
+
* | `script` | `string` | Script source, run against a sandboxed `workbook` facade |
|
|
1681
|
+
*/
|
|
1682
|
+
export declare const PluginProgramSpreadsheetRunScriptArgs: z.ZodObject<{
|
|
1683
|
+
script: z.ZodString;
|
|
1684
|
+
}, z.core.$strip>;
|
|
1685
|
+
export type PluginProgramSpreadsheetRunScriptArgs = z.infer<typeof PluginProgramSpreadsheetRunScriptArgs>;
|
|
1686
|
+
/**
|
|
1687
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.runScript}.
|
|
1688
|
+
*
|
|
1689
|
+
* | Property | Type | Description |
|
|
1690
|
+
* |---|---|---|
|
|
1691
|
+
* | `result` | `unknown` | The script's return value (`null` when it returns nothing) |
|
|
1692
|
+
*/
|
|
1693
|
+
export declare const PluginProgramSpreadsheetRunScriptResult: z.ZodObject<{
|
|
1694
|
+
result: z.ZodUnknown;
|
|
1695
|
+
}, z.core.$strip>;
|
|
1696
|
+
export type PluginProgramSpreadsheetRunScriptResult = z.infer<typeof PluginProgramSpreadsheetRunScriptResult>;
|
|
1697
|
+
/** Status of an audit-log entry. */
|
|
1698
|
+
export declare const PluginSpreadsheetAuditStatus: z.ZodEnum<{
|
|
1699
|
+
error: "error";
|
|
1700
|
+
success: "success";
|
|
1701
|
+
}>;
|
|
1702
|
+
export type PluginSpreadsheetAuditStatus = z.infer<typeof PluginSpreadsheetAuditStatus>;
|
|
1703
|
+
/**
|
|
1704
|
+
* One entry in the program-spreadsheet audit log.
|
|
1705
|
+
*
|
|
1706
|
+
* | Property | Type | Description |
|
|
1707
|
+
* |---|---|---|
|
|
1708
|
+
* | `id` | `string` | Entry id |
|
|
1709
|
+
* | `pluginId` | `string` | Id of the plugin that performed the operation |
|
|
1710
|
+
* | `method` | `string` | The API method invoked |
|
|
1711
|
+
* | `label` | `string?` | Optional operation label |
|
|
1712
|
+
* | `sheetName` | `string?` | The sheet the operation targeted, if any |
|
|
1713
|
+
* | `timestamp` | `string` | ISO timestamp |
|
|
1714
|
+
* | `status` | `"success" \| "error"` | Whether the operation succeeded |
|
|
1715
|
+
* | `summary` | `string?` | Short human-readable summary |
|
|
1716
|
+
*/
|
|
1717
|
+
export declare const PluginSpreadsheetAuditEntry: z.ZodObject<{
|
|
1718
|
+
id: z.ZodString;
|
|
1719
|
+
pluginId: z.ZodString;
|
|
1720
|
+
method: z.ZodString;
|
|
1721
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1722
|
+
sheetName: z.ZodOptional<z.ZodString>;
|
|
1723
|
+
timestamp: z.ZodString;
|
|
1724
|
+
status: z.ZodEnum<{
|
|
1725
|
+
error: "error";
|
|
1726
|
+
success: "success";
|
|
1727
|
+
}>;
|
|
1728
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
1729
|
+
}, z.core.$strip>;
|
|
1730
|
+
export type PluginSpreadsheetAuditEntry = z.infer<typeof PluginSpreadsheetAuditEntry>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetApi.getAuditLog}.
|
|
1733
|
+
*
|
|
1734
|
+
* | Property | Type | Description |
|
|
1735
|
+
* |---|---|---|
|
|
1736
|
+
* | `limit` | `number?` | Max entries to return (clamped 1–100, default 20) |
|
|
1737
|
+
*/
|
|
1738
|
+
export declare const PluginProgramSpreadsheetGetAuditLogArgs: z.ZodObject<{
|
|
1739
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1740
|
+
}, z.core.$strip>;
|
|
1741
|
+
export type PluginProgramSpreadsheetGetAuditLogArgs = z.infer<typeof PluginProgramSpreadsheetGetAuditLogArgs>;
|
|
1742
|
+
/**
|
|
1743
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.getAuditLog}.
|
|
1744
|
+
*
|
|
1745
|
+
* | Property | Type | Description |
|
|
1746
|
+
* |---|---|---|
|
|
1747
|
+
* | `entries` | {@linkcode PluginSpreadsheetAuditEntry}`[]` | Recent audit entries, newest first |
|
|
1748
|
+
*/
|
|
1749
|
+
export declare const PluginProgramSpreadsheetGetAuditLogResult: z.ZodObject<{
|
|
1750
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
1751
|
+
id: z.ZodString;
|
|
1752
|
+
pluginId: z.ZodString;
|
|
1753
|
+
method: z.ZodString;
|
|
1754
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1755
|
+
sheetName: z.ZodOptional<z.ZodString>;
|
|
1756
|
+
timestamp: z.ZodString;
|
|
1757
|
+
status: z.ZodEnum<{
|
|
1758
|
+
error: "error";
|
|
1759
|
+
success: "success";
|
|
1760
|
+
}>;
|
|
1761
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
1762
|
+
}, z.core.$strip>>;
|
|
1763
|
+
}, z.core.$strip>;
|
|
1764
|
+
export type PluginProgramSpreadsheetGetAuditLogResult = z.infer<typeof PluginProgramSpreadsheetGetAuditLogResult>;
|
|
1765
|
+
/**
|
|
1766
|
+
* Result of {@linkcode PluginProgramSpreadsheetApi.ping}.
|
|
1767
|
+
*
|
|
1768
|
+
* | Property | Type | Description |
|
|
1769
|
+
* |---|---|---|
|
|
1770
|
+
* | `pong` | `boolean` | `true` when the program-mode spreadsheet bridge is reachable |
|
|
1771
|
+
*/
|
|
1772
|
+
export declare const PluginProgramSpreadsheetPingResult: z.ZodObject<{
|
|
1773
|
+
pong: z.ZodBoolean;
|
|
1774
|
+
}, z.core.$strip>;
|
|
1775
|
+
export type PluginProgramSpreadsheetPingResult = z.infer<typeof PluginProgramSpreadsheetPingResult>;
|
|
1776
|
+
/** The visibility scope of a saved template. */
|
|
1777
|
+
export declare const PluginSpreadsheetTemplateScope: z.ZodEnum<{
|
|
1778
|
+
project: "project";
|
|
1779
|
+
global: "global";
|
|
1780
|
+
}>;
|
|
1781
|
+
export type PluginSpreadsheetTemplateScope = z.infer<typeof PluginSpreadsheetTemplateScope>;
|
|
1782
|
+
/**
|
|
1783
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetTemplatesApi.create}.
|
|
1784
|
+
*
|
|
1785
|
+
* | Property | Type | Description |
|
|
1786
|
+
* |---|---|---|
|
|
1787
|
+
* | `name` | `string` | Template name (re-saving the same name overwrites it) |
|
|
1788
|
+
* | `sheetName` | `string` | The source sheet to capture |
|
|
1789
|
+
* | `scope` | `"project" \| "global"?` | Template scope (default `"project"`) |
|
|
1790
|
+
*/
|
|
1791
|
+
export declare const PluginProgramSpreadsheetTemplatesCreateArgs: z.ZodObject<{
|
|
1792
|
+
name: z.ZodString;
|
|
1793
|
+
sheetName: z.ZodString;
|
|
1794
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
1795
|
+
project: "project";
|
|
1796
|
+
global: "global";
|
|
1797
|
+
}>>;
|
|
1798
|
+
}, z.core.$strip>;
|
|
1799
|
+
export type PluginProgramSpreadsheetTemplatesCreateArgs = z.infer<typeof PluginProgramSpreadsheetTemplatesCreateArgs>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Result of {@linkcode PluginProgramSpreadsheetTemplatesApi.create}.
|
|
1802
|
+
*
|
|
1803
|
+
* | Property | Type | Description |
|
|
1804
|
+
* |---|---|---|
|
|
1805
|
+
* | `id` | `string` | The new template's id |
|
|
1806
|
+
* | `name` | `string` | The template name |
|
|
1807
|
+
* | `scope` | `"project" \| "global"` | The template scope |
|
|
1808
|
+
* | `sheetName` | `string` | The source sheet captured |
|
|
1809
|
+
*/
|
|
1810
|
+
export declare const PluginProgramSpreadsheetTemplatesCreateResult: z.ZodObject<{
|
|
1811
|
+
id: z.ZodString;
|
|
1812
|
+
name: z.ZodString;
|
|
1813
|
+
scope: z.ZodEnum<{
|
|
1814
|
+
project: "project";
|
|
1815
|
+
global: "global";
|
|
1816
|
+
}>;
|
|
1817
|
+
sheetName: z.ZodString;
|
|
1818
|
+
}, z.core.$strip>;
|
|
1819
|
+
export type PluginProgramSpreadsheetTemplatesCreateResult = z.infer<typeof PluginProgramSpreadsheetTemplatesCreateResult>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetTemplatesApi.apply}.
|
|
1822
|
+
*
|
|
1823
|
+
* | Property | Type | Description |
|
|
1824
|
+
* |---|---|---|
|
|
1825
|
+
* | `name` | `string` | The template to apply |
|
|
1826
|
+
* | `targetSheetName` | `string` | The sheet to create/replace from the template |
|
|
1827
|
+
*/
|
|
1828
|
+
export declare const PluginProgramSpreadsheetTemplatesApplyArgs: z.ZodObject<{
|
|
1829
|
+
name: z.ZodString;
|
|
1830
|
+
targetSheetName: z.ZodString;
|
|
1831
|
+
}, z.core.$strip>;
|
|
1832
|
+
export type PluginProgramSpreadsheetTemplatesApplyArgs = z.infer<typeof PluginProgramSpreadsheetTemplatesApplyArgs>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Result of {@linkcode PluginProgramSpreadsheetTemplatesApi.apply}.
|
|
1835
|
+
*
|
|
1836
|
+
* | Property | Type | Description |
|
|
1837
|
+
* |---|---|---|
|
|
1838
|
+
* | `name` | `string` | The template that was applied |
|
|
1839
|
+
* | `targetSheetName` | `string` | The sheet it was applied to |
|
|
1840
|
+
*/
|
|
1841
|
+
export declare const PluginProgramSpreadsheetTemplatesApplyResult: z.ZodObject<{
|
|
1842
|
+
name: z.ZodString;
|
|
1843
|
+
targetSheetName: z.ZodString;
|
|
1844
|
+
}, z.core.$strip>;
|
|
1845
|
+
export type PluginProgramSpreadsheetTemplatesApplyResult = z.infer<typeof PluginProgramSpreadsheetTemplatesApplyResult>;
|
|
1846
|
+
/**
|
|
1847
|
+
* A binding's data source. Currently only the takeoff dataset; `program` is
|
|
1848
|
+
* reserved for a future source.
|
|
1849
|
+
*
|
|
1850
|
+
* | Property | Type | Description |
|
|
1851
|
+
* |---|---|---|
|
|
1852
|
+
* | `dataset` | `"takeoff"` | The dataset the binding pulls from |
|
|
1853
|
+
*/
|
|
1854
|
+
export declare const PluginSpreadsheetBindingSource: z.ZodObject<{
|
|
1855
|
+
dataset: z.ZodEnum<{
|
|
1856
|
+
takeoff: "takeoff";
|
|
1857
|
+
}>;
|
|
1858
|
+
}, z.core.$strip>;
|
|
1859
|
+
export type PluginSpreadsheetBindingSource = z.infer<typeof PluginSpreadsheetBindingSource>;
|
|
1860
|
+
/** How a binding refresh writes into its target range. Currently only `replaceRange`. */
|
|
1861
|
+
export declare const PluginSpreadsheetBindingMode: z.ZodEnum<{
|
|
1862
|
+
replaceRange: "replaceRange";
|
|
1863
|
+
}>;
|
|
1864
|
+
export type PluginSpreadsheetBindingMode = z.infer<typeof PluginSpreadsheetBindingMode>;
|
|
1865
|
+
/**
|
|
1866
|
+
* A binding's target range, for {@linkcode PluginProgramSpreadsheetBindingsApi.create}.
|
|
1867
|
+
*
|
|
1868
|
+
* | Property | Type | Description |
|
|
1869
|
+
* |---|---|---|
|
|
1870
|
+
* | `sheetName` | `string` | The sheet to write into |
|
|
1871
|
+
* | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
|
|
1872
|
+
*/
|
|
1873
|
+
export declare const PluginSpreadsheetBindingTarget: z.ZodObject<{
|
|
1874
|
+
sheetName: z.ZodString;
|
|
1875
|
+
startCell: z.ZodOptional<z.ZodString>;
|
|
1876
|
+
}, z.core.$strip>;
|
|
1877
|
+
export type PluginSpreadsheetBindingTarget = z.infer<typeof PluginSpreadsheetBindingTarget>;
|
|
1878
|
+
/**
|
|
1879
|
+
* A stored data binding.
|
|
1880
|
+
*
|
|
1881
|
+
* | Property | Type | Description |
|
|
1882
|
+
* |---|---|---|
|
|
1883
|
+
* | `id` | `string` | Binding id |
|
|
1884
|
+
* | `name` | `string` | Binding name (unique per workbook) |
|
|
1885
|
+
* | `pluginId` | `string` | Id of the plugin that owns the binding |
|
|
1886
|
+
* | `source` | {@linkcode PluginSpreadsheetBindingSource} | The bound dataset |
|
|
1887
|
+
* | `target` | `{ sheetName: string; startCell: string }` | The resolved target range anchor |
|
|
1888
|
+
* | `mode` | {@linkcode PluginSpreadsheetBindingMode} | How a refresh writes into the target |
|
|
1889
|
+
* | `createdAt` | `string` | ISO creation timestamp |
|
|
1890
|
+
* | `updatedAt` | `string` | ISO last-refresh timestamp |
|
|
1891
|
+
*/
|
|
1892
|
+
export declare const PluginSpreadsheetBinding: z.ZodObject<{
|
|
1893
|
+
id: z.ZodString;
|
|
1894
|
+
name: z.ZodString;
|
|
1895
|
+
pluginId: z.ZodString;
|
|
1896
|
+
source: z.ZodObject<{
|
|
1897
|
+
dataset: z.ZodEnum<{
|
|
1898
|
+
takeoff: "takeoff";
|
|
1899
|
+
}>;
|
|
1900
|
+
}, z.core.$strip>;
|
|
1901
|
+
target: z.ZodObject<{
|
|
1902
|
+
sheetName: z.ZodString;
|
|
1903
|
+
startCell: z.ZodString;
|
|
1904
|
+
}, z.core.$strip>;
|
|
1905
|
+
mode: z.ZodEnum<{
|
|
1906
|
+
replaceRange: "replaceRange";
|
|
1907
|
+
}>;
|
|
1908
|
+
createdAt: z.ZodString;
|
|
1909
|
+
updatedAt: z.ZodString;
|
|
1910
|
+
}, z.core.$strip>;
|
|
1911
|
+
export type PluginSpreadsheetBinding = z.infer<typeof PluginSpreadsheetBinding>;
|
|
1912
|
+
/**
|
|
1913
|
+
* The outcome of refreshing a single binding.
|
|
1914
|
+
*
|
|
1915
|
+
* | Property | Type | Description |
|
|
1916
|
+
* |---|---|---|
|
|
1917
|
+
* | `id` | `string` | The refreshed binding's id |
|
|
1918
|
+
* | `name` | `string` | The refreshed binding's name |
|
|
1919
|
+
* | `sheetName` | `string` | The sheet that was rewritten |
|
|
1920
|
+
* | `rowCount` | `number` | Number of rows written |
|
|
1921
|
+
*/
|
|
1922
|
+
export declare const PluginSpreadsheetBindingRefresh: z.ZodObject<{
|
|
1923
|
+
id: z.ZodString;
|
|
1924
|
+
name: z.ZodString;
|
|
1925
|
+
sheetName: z.ZodString;
|
|
1926
|
+
rowCount: z.ZodNumber;
|
|
1927
|
+
}, z.core.$strip>;
|
|
1928
|
+
export type PluginSpreadsheetBindingRefresh = z.infer<typeof PluginSpreadsheetBindingRefresh>;
|
|
1929
|
+
/**
|
|
1930
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetBindingsApi.create}.
|
|
1931
|
+
*
|
|
1932
|
+
* | Property | Type | Description |
|
|
1933
|
+
* |---|---|---|
|
|
1934
|
+
* | `name` | `string` | Binding name (re-using a name overwrites it) |
|
|
1935
|
+
* | `source` | {@linkcode PluginSpreadsheetBindingSource} | The dataset to bind |
|
|
1936
|
+
* | `target` | {@linkcode PluginSpreadsheetBindingTarget} | The target sheet range |
|
|
1937
|
+
* | `mode` | {@linkcode PluginSpreadsheetBindingMode}`?` | How a refresh writes (default `"replaceRange"`) |
|
|
1938
|
+
*/
|
|
1939
|
+
export declare const PluginProgramSpreadsheetBindingsCreateArgs: z.ZodObject<{
|
|
1940
|
+
name: z.ZodString;
|
|
1941
|
+
source: z.ZodObject<{
|
|
1942
|
+
dataset: z.ZodEnum<{
|
|
1943
|
+
takeoff: "takeoff";
|
|
1944
|
+
}>;
|
|
1945
|
+
}, z.core.$strip>;
|
|
1946
|
+
target: z.ZodObject<{
|
|
1947
|
+
sheetName: z.ZodString;
|
|
1948
|
+
startCell: z.ZodOptional<z.ZodString>;
|
|
1949
|
+
}, z.core.$strip>;
|
|
1950
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
1951
|
+
replaceRange: "replaceRange";
|
|
1952
|
+
}>>;
|
|
1953
|
+
}, z.core.$strip>;
|
|
1954
|
+
export type PluginProgramSpreadsheetBindingsCreateArgs = z.infer<typeof PluginProgramSpreadsheetBindingsCreateArgs>;
|
|
1955
|
+
/**
|
|
1956
|
+
* Result of {@linkcode PluginProgramSpreadsheetBindingsApi.create} — the stored
|
|
1957
|
+
* {@linkcode PluginSpreadsheetBinding} plus the initial `refresh` outcome.
|
|
1958
|
+
*/
|
|
1959
|
+
export declare const PluginProgramSpreadsheetBindingsCreateResult: z.ZodObject<{
|
|
1960
|
+
id: z.ZodString;
|
|
1961
|
+
name: z.ZodString;
|
|
1962
|
+
pluginId: z.ZodString;
|
|
1963
|
+
source: z.ZodObject<{
|
|
1964
|
+
dataset: z.ZodEnum<{
|
|
1965
|
+
takeoff: "takeoff";
|
|
1966
|
+
}>;
|
|
1967
|
+
}, z.core.$strip>;
|
|
1968
|
+
target: z.ZodObject<{
|
|
1969
|
+
sheetName: z.ZodString;
|
|
1970
|
+
startCell: z.ZodString;
|
|
1971
|
+
}, z.core.$strip>;
|
|
1972
|
+
mode: z.ZodEnum<{
|
|
1973
|
+
replaceRange: "replaceRange";
|
|
1974
|
+
}>;
|
|
1975
|
+
createdAt: z.ZodString;
|
|
1976
|
+
updatedAt: z.ZodString;
|
|
1977
|
+
refresh: z.ZodObject<{
|
|
1978
|
+
id: z.ZodString;
|
|
1979
|
+
name: z.ZodString;
|
|
1980
|
+
sheetName: z.ZodString;
|
|
1981
|
+
rowCount: z.ZodNumber;
|
|
1982
|
+
}, z.core.$strip>;
|
|
1983
|
+
}, z.core.$strip>;
|
|
1984
|
+
export type PluginProgramSpreadsheetBindingsCreateResult = z.infer<typeof PluginProgramSpreadsheetBindingsCreateResult>;
|
|
1985
|
+
/**
|
|
1986
|
+
* Arguments for {@linkcode PluginProgramSpreadsheetBindingsApi.refresh}.
|
|
1987
|
+
*
|
|
1988
|
+
* | Property | Type | Description |
|
|
1989
|
+
* |---|---|---|
|
|
1990
|
+
* | `name` | `string?` | The binding to refresh; omit to refresh every binding |
|
|
1991
|
+
*/
|
|
1992
|
+
export declare const PluginProgramSpreadsheetBindingsRefreshArgs: z.ZodObject<{
|
|
1993
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1994
|
+
}, z.core.$strip>;
|
|
1995
|
+
export type PluginProgramSpreadsheetBindingsRefreshArgs = z.infer<typeof PluginProgramSpreadsheetBindingsRefreshArgs>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Result of {@linkcode PluginProgramSpreadsheetBindingsApi.refresh}.
|
|
1998
|
+
*
|
|
1999
|
+
* | Property | Type | Description |
|
|
2000
|
+
* |---|---|---|
|
|
2001
|
+
* | `refreshed` | {@linkcode PluginSpreadsheetBindingRefresh}`[]` | One entry per binding refreshed |
|
|
2002
|
+
*/
|
|
2003
|
+
export declare const PluginProgramSpreadsheetBindingsRefreshResult: z.ZodObject<{
|
|
2004
|
+
refreshed: z.ZodArray<z.ZodObject<{
|
|
2005
|
+
id: z.ZodString;
|
|
2006
|
+
name: z.ZodString;
|
|
2007
|
+
sheetName: z.ZodString;
|
|
2008
|
+
rowCount: z.ZodNumber;
|
|
2009
|
+
}, z.core.$strip>>;
|
|
2010
|
+
}, z.core.$strip>;
|
|
2011
|
+
export type PluginProgramSpreadsheetBindingsRefreshResult = z.infer<typeof PluginProgramSpreadsheetBindingsRefreshResult>;
|
|
2012
|
+
/**
|
|
2013
|
+
* Result of {@linkcode PluginProgramSpreadsheetBindingsApi.list}.
|
|
2014
|
+
*
|
|
2015
|
+
* | Property | Type | Description |
|
|
2016
|
+
* |---|---|---|
|
|
2017
|
+
* | `bindings` | {@linkcode PluginSpreadsheetBinding}`[]` | Every stored binding |
|
|
2018
|
+
*/
|
|
2019
|
+
export declare const PluginProgramSpreadsheetBindingsListResult: z.ZodObject<{
|
|
2020
|
+
bindings: z.ZodArray<z.ZodObject<{
|
|
2021
|
+
id: z.ZodString;
|
|
2022
|
+
name: z.ZodString;
|
|
2023
|
+
pluginId: z.ZodString;
|
|
2024
|
+
source: z.ZodObject<{
|
|
2025
|
+
dataset: z.ZodEnum<{
|
|
2026
|
+
takeoff: "takeoff";
|
|
2027
|
+
}>;
|
|
2028
|
+
}, z.core.$strip>;
|
|
2029
|
+
target: z.ZodObject<{
|
|
2030
|
+
sheetName: z.ZodString;
|
|
2031
|
+
startCell: z.ZodString;
|
|
2032
|
+
}, z.core.$strip>;
|
|
2033
|
+
mode: z.ZodEnum<{
|
|
2034
|
+
replaceRange: "replaceRange";
|
|
2035
|
+
}>;
|
|
2036
|
+
createdAt: z.ZodString;
|
|
2037
|
+
updatedAt: z.ZodString;
|
|
2038
|
+
}, z.core.$strip>>;
|
|
2039
|
+
}, z.core.$strip>;
|
|
2040
|
+
export type PluginProgramSpreadsheetBindingsListResult = z.infer<typeof PluginProgramSpreadsheetBindingsListResult>;
|
|
2041
|
+
//# sourceMappingURL=spreadsheet.d.ts.map
|