@snaptrude/plugin-core 0.0.0-bimsvg-20260928124803

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.
Files changed (383) hide show
  1. package/AGENTS.md +231 -0
  2. package/CHANGELOG.md +341 -0
  3. package/CLAUDE.md +11 -0
  4. package/api-manifest.json +9120 -0
  5. package/dist/api/analysis/daylight.d.ts +603 -0
  6. package/dist/api/analysis/daylight.d.ts.map +1 -0
  7. package/dist/api/analysis/heatmaps.d.ts +658 -0
  8. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  9. package/dist/api/analysis/illuminance.d.ts +145 -0
  10. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  11. package/dist/api/analysis/index.d.ts +59 -0
  12. package/dist/api/analysis/index.d.ts.map +1 -0
  13. package/dist/api/analysis/shadows.d.ts +165 -0
  14. package/dist/api/analysis/shadows.d.ts.map +1 -0
  15. package/dist/api/analysis/solar.d.ts +249 -0
  16. package/dist/api/analysis/solar.d.ts.map +1 -0
  17. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  18. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  19. package/dist/api/analysis/sunpath.d.ts +80 -0
  20. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  21. package/dist/api/analysis/weather.d.ts +193 -0
  22. package/dist/api/analysis/weather.d.ts.map +1 -0
  23. package/dist/api/core/buildings.d.ts +427 -0
  24. package/dist/api/core/buildings.d.ts.map +1 -0
  25. package/dist/api/core/camera/index.d.ts +261 -0
  26. package/dist/api/core/camera/index.d.ts.map +1 -0
  27. package/dist/api/core/comment/index.d.ts +333 -0
  28. package/dist/api/core/comment/index.d.ts.map +1 -0
  29. package/dist/api/core/geom/create/index.d.ts +1073 -0
  30. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  31. package/dist/api/core/geom/delete/index.d.ts +78 -0
  32. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  33. package/dist/api/core/geom/index.d.ts +33 -0
  34. package/dist/api/core/geom/index.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/arc.d.ts +169 -0
  36. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/brep.d.ts +514 -0
  38. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/circle.d.ts +378 -0
  40. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/contour.d.ts +450 -0
  42. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/curve.d.ts +918 -0
  44. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/edge.d.ts +128 -0
  46. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/face.d.ts +363 -0
  48. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  49. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  50. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  51. package/dist/api/core/geom/query/index.d.ts +61 -0
  52. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  53. package/dist/api/core/geom/query/profile.d.ts +410 -0
  54. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  55. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  56. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  57. package/dist/api/core/geom/update/contour.d.ts +272 -0
  58. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  59. package/dist/api/core/geom/update/curve.d.ts +180 -0
  60. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  61. package/dist/api/core/geom/update/index.d.ts +27 -0
  62. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  63. package/dist/api/core/geom/update/profile.d.ts +329 -0
  64. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  65. package/dist/api/core/groups.d.ts +485 -0
  66. package/dist/api/core/groups.d.ts.map +1 -0
  67. package/dist/api/core/handles/index.d.ts +210 -0
  68. package/dist/api/core/handles/index.d.ts.map +1 -0
  69. package/dist/api/core/history/index.d.ts +78 -0
  70. package/dist/api/core/history/index.d.ts.map +1 -0
  71. package/dist/api/core/index.d.ts +97 -0
  72. package/dist/api/core/index.d.ts.map +1 -0
  73. package/dist/api/core/io/export/index.d.ts +134 -0
  74. package/dist/api/core/io/export/index.d.ts.map +1 -0
  75. package/dist/api/core/io/import/index.d.ts +455 -0
  76. package/dist/api/core/io/import/index.d.ts.map +1 -0
  77. package/dist/api/core/io/index.d.ts +40 -0
  78. package/dist/api/core/io/index.d.ts.map +1 -0
  79. package/dist/api/core/io/job/index.d.ts +139 -0
  80. package/dist/api/core/io/job/index.d.ts.map +1 -0
  81. package/dist/api/core/io/query/index.d.ts +74 -0
  82. package/dist/api/core/io/query/index.d.ts.map +1 -0
  83. package/dist/api/core/io/terrain/index.d.ts +341 -0
  84. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  85. package/dist/api/core/io/underlay/index.d.ts +805 -0
  86. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  87. package/dist/api/core/layers.d.ts +402 -0
  88. package/dist/api/core/layers.d.ts.map +1 -0
  89. package/dist/api/core/math/index.d.ts +18 -0
  90. package/dist/api/core/math/index.d.ts.map +1 -0
  91. package/dist/api/core/math/quat.d.ts +170 -0
  92. package/dist/api/core/math/quat.d.ts.map +1 -0
  93. package/dist/api/core/math/vec3.d.ts +174 -0
  94. package/dist/api/core/math/vec3.d.ts.map +1 -0
  95. package/dist/api/core/mode/index.d.ts +111 -0
  96. package/dist/api/core/mode/index.d.ts.map +1 -0
  97. package/dist/api/core/project/index.d.ts +466 -0
  98. package/dist/api/core/project/index.d.ts.map +1 -0
  99. package/dist/api/core/proposals/index.d.ts +531 -0
  100. package/dist/api/core/proposals/index.d.ts.map +1 -0
  101. package/dist/api/core/storeys/index.d.ts +265 -0
  102. package/dist/api/core/storeys/index.d.ts.map +1 -0
  103. package/dist/api/core/tags.d.ts +860 -0
  104. package/dist/api/core/tags.d.ts.map +1 -0
  105. package/dist/api/core/units/index.d.ts +175 -0
  106. package/dist/api/core/units/index.d.ts.map +1 -0
  107. package/dist/api/core/user.d.ts +44 -0
  108. package/dist/api/core/user.d.ts.map +1 -0
  109. package/dist/api/core/zoom/index.d.ts +49 -0
  110. package/dist/api/core/zoom/index.d.ts.map +1 -0
  111. package/dist/api/design/boolean/index.d.ts +168 -0
  112. package/dist/api/design/boolean/index.d.ts.map +1 -0
  113. package/dist/api/design/create/bulk-items.d.ts +185 -0
  114. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  115. package/dist/api/design/create/grids.d.ts +132 -0
  116. package/dist/api/design/create/grids.d.ts.map +1 -0
  117. package/dist/api/design/create/index.d.ts +1747 -0
  118. package/dist/api/design/create/index.d.ts.map +1 -0
  119. package/dist/api/design/create/opening-fields.d.ts +37 -0
  120. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  121. package/dist/api/design/delete/index.d.ts +70 -0
  122. package/dist/api/design/delete/index.d.ts.map +1 -0
  123. package/dist/api/design/dimensions.d.ts +427 -0
  124. package/dist/api/design/dimensions.d.ts.map +1 -0
  125. package/dist/api/design/doors/index.d.ts +470 -0
  126. package/dist/api/design/doors/index.d.ts.map +1 -0
  127. package/dist/api/design/edit/index.d.ts +49 -0
  128. package/dist/api/design/edit/index.d.ts.map +1 -0
  129. package/dist/api/design/erase/index.d.ts +160 -0
  130. package/dist/api/design/erase/index.d.ts.map +1 -0
  131. package/dist/api/design/family.d.ts +611 -0
  132. package/dist/api/design/family.d.ts.map +1 -0
  133. package/dist/api/design/furniture/index.d.ts +296 -0
  134. package/dist/api/design/furniture/index.d.ts.map +1 -0
  135. package/dist/api/design/grids.d.ts +237 -0
  136. package/dist/api/design/grids.d.ts.map +1 -0
  137. package/dist/api/design/index.d.ts +260 -0
  138. package/dist/api/design/index.d.ts.map +1 -0
  139. package/dist/api/design/lock.d.ts +67 -0
  140. package/dist/api/design/lock.d.ts.map +1 -0
  141. package/dist/api/design/materials/index.d.ts +551 -0
  142. package/dist/api/design/materials/index.d.ts.map +1 -0
  143. package/dist/api/design/query/geometry/index.d.ts +252 -0
  144. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  145. package/dist/api/design/query/grids.d.ts +287 -0
  146. package/dist/api/design/query/grids.d.ts.map +1 -0
  147. package/dist/api/design/query/index.d.ts +1318 -0
  148. package/dist/api/design/query/index.d.ts.map +1 -0
  149. package/dist/api/design/query/referenceLines.d.ts +45 -0
  150. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  151. package/dist/api/design/query/spaces.d.ts +394 -0
  152. package/dist/api/design/query/spaces.d.ts.map +1 -0
  153. package/dist/api/design/selection/index.d.ts +282 -0
  154. package/dist/api/design/selection/index.d.ts.map +1 -0
  155. package/dist/api/design/shared.d.ts +38 -0
  156. package/dist/api/design/shared.d.ts.map +1 -0
  157. package/dist/api/design/transform/index.d.ts +249 -0
  158. package/dist/api/design/transform/index.d.ts.map +1 -0
  159. package/dist/api/design/types/index.d.ts +181 -0
  160. package/dist/api/design/types/index.d.ts.map +1 -0
  161. package/dist/api/design/update/index.d.ts +803 -0
  162. package/dist/api/design/update/index.d.ts.map +1 -0
  163. package/dist/api/design/visibility.d.ts +126 -0
  164. package/dist/api/design/visibility.d.ts.map +1 -0
  165. package/dist/api/design/windows/index.d.ts +300 -0
  166. package/dist/api/design/windows/index.d.ts.map +1 -0
  167. package/dist/api/entity/buildableEnvelope.d.ts +265 -0
  168. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  169. package/dist/api/entity/department.d.ts +1 -0
  170. package/dist/api/entity/department.d.ts.map +1 -0
  171. package/dist/api/entity/index.d.ts +28 -0
  172. package/dist/api/entity/index.d.ts.map +1 -0
  173. package/dist/api/entity/referenceLine.d.ts +210 -0
  174. package/dist/api/entity/referenceLine.d.ts.map +1 -0
  175. package/dist/api/entity/space.d.ts +846 -0
  176. package/dist/api/entity/space.d.ts.map +1 -0
  177. package/dist/api/entity/story.d.ts +476 -0
  178. package/dist/api/entity/story.d.ts.map +1 -0
  179. package/dist/api/index.d.ts +45 -0
  180. package/dist/api/index.d.ts.map +1 -0
  181. package/dist/api/presentation/aiInspiration.d.ts +2400 -0
  182. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  183. package/dist/api/presentation/annotate.d.ts +483 -0
  184. package/dist/api/presentation/annotate.d.ts.map +1 -0
  185. package/dist/api/presentation/diagrams.d.ts +184 -0
  186. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  187. package/dist/api/presentation/drawings.d.ts +2900 -0
  188. package/dist/api/presentation/drawings.d.ts.map +1 -0
  189. package/dist/api/presentation/export.d.ts +126 -0
  190. package/dist/api/presentation/export.d.ts.map +1 -0
  191. package/dist/api/presentation/import.d.ts +164 -0
  192. package/dist/api/presentation/import.d.ts.map +1 -0
  193. package/dist/api/presentation/index.d.ts +114 -0
  194. package/dist/api/presentation/index.d.ts.map +1 -0
  195. package/dist/api/presentation/placedViews.d.ts +1232 -0
  196. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  197. package/dist/api/presentation/shapes.d.ts +481 -0
  198. package/dist/api/presentation/shapes.d.ts.map +1 -0
  199. package/dist/api/presentation/sheets.d.ts +643 -0
  200. package/dist/api/presentation/sheets.d.ts.map +1 -0
  201. package/dist/api/presentation/slideshow.d.ts +125 -0
  202. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  203. package/dist/api/presentation/tables.d.ts +81 -0
  204. package/dist/api/presentation/tables.d.ts.map +1 -0
  205. package/dist/api/presentation/viewPresets.d.ts +70 -0
  206. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  207. package/dist/api/presentation/views.d.ts +741 -0
  208. package/dist/api/presentation/views.d.ts.map +1 -0
  209. package/dist/api/program/adjacency.d.ts +155 -0
  210. package/dist/api/program/adjacency.d.ts.map +1 -0
  211. package/dist/api/program/areas.d.ts +450 -0
  212. package/dist/api/program/areas.d.ts.map +1 -0
  213. package/dist/api/program/classification.d.ts +135 -0
  214. package/dist/api/program/classification.d.ts.map +1 -0
  215. package/dist/api/program/cores.d.ts +78 -0
  216. package/dist/api/program/cores.d.ts.map +1 -0
  217. package/dist/api/program/departments.d.ts +487 -0
  218. package/dist/api/program/departments.d.ts.map +1 -0
  219. package/dist/api/program/index.d.ts +71 -0
  220. package/dist/api/program/index.d.ts.map +1 -0
  221. package/dist/api/program/labels.d.ts +355 -0
  222. package/dist/api/program/labels.d.ts.map +1 -0
  223. package/dist/api/program/layout.d.ts +398 -0
  224. package/dist/api/program/layout.d.ts.map +1 -0
  225. package/dist/api/program/metadata.d.ts +328 -0
  226. package/dist/api/program/metadata.d.ts.map +1 -0
  227. package/dist/api/program/metrics.d.ts +108 -0
  228. package/dist/api/program/metrics.d.ts.map +1 -0
  229. package/dist/api/program/site.d.ts +823 -0
  230. package/dist/api/program/site.d.ts.map +1 -0
  231. package/dist/api/program/spreadsheet.d.ts +2628 -0
  232. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  233. package/dist/api/workspace/index.d.ts +552 -0
  234. package/dist/api/workspace/index.d.ts.map +1 -0
  235. package/dist/errors/codes.d.ts +34 -0
  236. package/dist/errors/codes.d.ts.map +1 -0
  237. package/dist/errors/envelope.d.ts +56 -0
  238. package/dist/errors/envelope.d.ts.map +1 -0
  239. package/dist/errors/index.d.ts +6 -0
  240. package/dist/errors/index.d.ts.map +1 -0
  241. package/dist/errors/plugin-error.d.ts +69 -0
  242. package/dist/errors/plugin-error.d.ts.map +1 -0
  243. package/dist/handles.d.ts +229 -0
  244. package/dist/handles.d.ts.map +1 -0
  245. package/dist/host-utils.d.ts +47 -0
  246. package/dist/host-utils.d.ts.map +1 -0
  247. package/dist/index.cjs +8836 -0
  248. package/dist/index.cjs.map +1 -0
  249. package/dist/index.d.ts +6 -0
  250. package/dist/index.d.ts.map +1 -0
  251. package/dist/index.js +7568 -0
  252. package/dist/index.js.map +1 -0
  253. package/dist/types.d.ts +16 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/package.json +41 -0
  256. package/scripts/generate-manifest.mjs +238 -0
  257. package/scripts/generate-manifest.test.mjs +292 -0
  258. package/src/api/analysis/daylight.ts +470 -0
  259. package/src/api/analysis/heatmaps.ts +683 -0
  260. package/src/api/analysis/illuminance.ts +155 -0
  261. package/src/api/analysis/index.ts +61 -0
  262. package/src/api/analysis/shadows.ts +183 -0
  263. package/src/api/analysis/solar.ts +237 -0
  264. package/src/api/analysis/sunlightHours.ts +211 -0
  265. package/src/api/analysis/sunpath.ts +83 -0
  266. package/src/api/analysis/weather.ts +179 -0
  267. package/src/api/core/buildings.ts +485 -0
  268. package/src/api/core/camera/index.ts +268 -0
  269. package/src/api/core/comment/index.ts +376 -0
  270. package/src/api/core/geom/create/index.ts +1204 -0
  271. package/src/api/core/geom/delete/index.ts +84 -0
  272. package/src/api/core/geom/index.ts +35 -0
  273. package/src/api/core/geom/query/arc.ts +169 -0
  274. package/src/api/core/geom/query/brep.ts +563 -0
  275. package/src/api/core/geom/query/circle.ts +404 -0
  276. package/src/api/core/geom/query/contour.ts +540 -0
  277. package/src/api/core/geom/query/curve.ts +1078 -0
  278. package/src/api/core/geom/query/edge.ts +130 -0
  279. package/src/api/core/geom/query/face.ts +403 -0
  280. package/src/api/core/geom/query/halfedge.ts +210 -0
  281. package/src/api/core/geom/query/index.ts +63 -0
  282. package/src/api/core/geom/query/profile.ts +473 -0
  283. package/src/api/core/geom/query/vertex.ts +205 -0
  284. package/src/api/core/geom/update/contour.ts +315 -0
  285. package/src/api/core/geom/update/curve.ts +209 -0
  286. package/src/api/core/geom/update/index.ts +29 -0
  287. package/src/api/core/geom/update/profile.ts +377 -0
  288. package/src/api/core/groups.ts +521 -0
  289. package/src/api/core/handles/index.ts +233 -0
  290. package/src/api/core/history/index.ts +84 -0
  291. package/src/api/core/index.ts +99 -0
  292. package/src/api/core/io/export/index.ts +126 -0
  293. package/src/api/core/io/import/index.ts +504 -0
  294. package/src/api/core/io/index.ts +42 -0
  295. package/src/api/core/io/job/index.ts +140 -0
  296. package/src/api/core/io/query/index.ts +71 -0
  297. package/src/api/core/io/terrain/index.ts +360 -0
  298. package/src/api/core/io/underlay/index.ts +705 -0
  299. package/src/api/core/layers.ts +333 -0
  300. package/src/api/core/math/index.ts +20 -0
  301. package/src/api/core/math/quat.ts +172 -0
  302. package/src/api/core/math/vec3.ts +179 -0
  303. package/src/api/core/mode/index.ts +108 -0
  304. package/src/api/core/project/index.ts +479 -0
  305. package/src/api/core/proposals/index.ts +569 -0
  306. package/src/api/core/storeys/index.ts +294 -0
  307. package/src/api/core/tags.ts +911 -0
  308. package/src/api/core/units/index.ts +164 -0
  309. package/src/api/core/user.ts +46 -0
  310. package/src/api/core/zoom/index.ts +51 -0
  311. package/src/api/design/boolean/index.ts +179 -0
  312. package/src/api/design/create/bulk-items.ts +186 -0
  313. package/src/api/design/create/grids.ts +137 -0
  314. package/src/api/design/create/index.ts +1954 -0
  315. package/src/api/design/create/opening-fields.ts +37 -0
  316. package/src/api/design/delete/index.ts +74 -0
  317. package/src/api/design/dimensions.ts +453 -0
  318. package/src/api/design/doors/index.ts +500 -0
  319. package/src/api/design/edit/index.ts +54 -0
  320. package/src/api/design/erase/index.ts +151 -0
  321. package/src/api/design/family.ts +646 -0
  322. package/src/api/design/furniture/index.ts +319 -0
  323. package/src/api/design/grids.ts +237 -0
  324. package/src/api/design/index.ts +274 -0
  325. package/src/api/design/lock.ts +69 -0
  326. package/src/api/design/materials/index.ts +608 -0
  327. package/src/api/design/query/geometry/index.ts +288 -0
  328. package/src/api/design/query/grids.ts +197 -0
  329. package/src/api/design/query/index.ts +1176 -0
  330. package/src/api/design/query/referenceLines.ts +52 -0
  331. package/src/api/design/query/spaces.ts +275 -0
  332. package/src/api/design/selection/index.ts +273 -0
  333. package/src/api/design/shared.ts +40 -0
  334. package/src/api/design/transform/index.ts +254 -0
  335. package/src/api/design/types/index.ts +156 -0
  336. package/src/api/design/update/index.ts +798 -0
  337. package/src/api/design/visibility.ts +143 -0
  338. package/src/api/design/windows/index.ts +333 -0
  339. package/src/api/entity/buildableEnvelope.ts +322 -0
  340. package/src/api/entity/department.ts +0 -0
  341. package/src/api/entity/index.ts +30 -0
  342. package/src/api/entity/referenceLine.ts +235 -0
  343. package/src/api/entity/space.ts +612 -0
  344. package/src/api/entity/story.ts +517 -0
  345. package/src/api/index.ts +47 -0
  346. package/src/api/presentation/aiInspiration.ts +1116 -0
  347. package/src/api/presentation/annotate.ts +417 -0
  348. package/src/api/presentation/diagrams.ts +194 -0
  349. package/src/api/presentation/drawings.ts +529 -0
  350. package/src/api/presentation/export.ts +133 -0
  351. package/src/api/presentation/import.ts +159 -0
  352. package/src/api/presentation/index.ts +129 -0
  353. package/src/api/presentation/placedViews.ts +1203 -0
  354. package/src/api/presentation/shapes.ts +274 -0
  355. package/src/api/presentation/sheets.ts +616 -0
  356. package/src/api/presentation/slideshow.ts +134 -0
  357. package/src/api/presentation/tables.ts +84 -0
  358. package/src/api/presentation/viewPresets.ts +83 -0
  359. package/src/api/presentation/views.ts +698 -0
  360. package/src/api/program/adjacency.ts +164 -0
  361. package/src/api/program/areas.ts +408 -0
  362. package/src/api/program/classification.ts +138 -0
  363. package/src/api/program/cores.ts +83 -0
  364. package/src/api/program/departments.ts +517 -0
  365. package/src/api/program/index.ts +73 -0
  366. package/src/api/program/labels.ts +332 -0
  367. package/src/api/program/layout.ts +422 -0
  368. package/src/api/program/metadata.ts +364 -0
  369. package/src/api/program/metrics.ts +120 -0
  370. package/src/api/program/site.ts +748 -0
  371. package/src/api/program/spreadsheet.ts +2698 -0
  372. package/src/api/workspace/index.ts +612 -0
  373. package/src/errors/codes.ts +136 -0
  374. package/src/errors/envelope.ts +75 -0
  375. package/src/errors/index.ts +21 -0
  376. package/src/errors/plugin-error.ts +134 -0
  377. package/src/handles.ts +282 -0
  378. package/src/host-utils.ts +68 -0
  379. package/src/index.ts +5 -0
  380. package/src/types.ts +16 -0
  381. package/test/errors.test.mjs +184 -0
  382. package/tsconfig.json +22 -0
  383. package/tsup.config.ts +12 -0
@@ -0,0 +1,2628 @@
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 — and {@linkcode PluginProgramSpreadsheetApi.getMaterialTakeoff}, surface area
25
+ * per material), sheet reads ({@linkcode PluginProgramSpreadsheetApi.listSheets} /
26
+ * {@linkcode PluginProgramSpreadsheetApi.getSheetData}), charts + emphasis
27
+ * ({@linkcode PluginProgramSpreadsheetApi.addChart} /
28
+ * {@linkcode PluginProgramSpreadsheetApi.highlightCells}), workbook file export
29
+ * ({@linkcode PluginProgramSpreadsheetApi.export}), reusable
30
+ * {@linkcode PluginProgramSpreadsheetApi.templates}, live
31
+ * {@linkcode PluginProgramSpreadsheetApi.bindings}, a sandboxed script escape hatch
32
+ * ({@linkcode PluginProgramSpreadsheetApi.runScript}), an audit log
33
+ * ({@linkcode PluginProgramSpreadsheetApi.getAuditLog}), and a liveness
34
+ * {@linkcode PluginProgramSpreadsheetApi.ping}. `addTable` is intentionally not
35
+ * exposed — `render` composes header + rows + table in one call.
36
+ *
37
+ * **Verb note (naming authority; rows pending merge into constitution §4 by its owner).**
38
+ * Existing §4 verbs used as-is: `get`, `list`, `set` (bulk cell/format writes;
39
+ * read back via {@linkcode PluginProgramSpreadsheetApi.getSheetData}), `create`,
40
+ * `add` (charts, conditional formats), `apply` (templates), `export`, and
41
+ * `transaction` (the sanctioned atomic-batch verb), plus the ratified `render` and
42
+ * `highlight` program domain verbs ◆. New program-domain verbs ratified here ◆:
43
+ * `recalculate` (recompute the workbook's formula results — distinct from
44
+ * `refresh`), `merge` ({@linkcode PluginProgramSpreadsheetApi.mergeCells} spans a
45
+ * cell range — a spreadsheet-domain verb, explicitly NOT the CSG-solid `union`
46
+ * fold), `refresh` ({@linkcode PluginProgramSpreadsheetBindingsApi.refresh}
47
+ * re-pulls a binding's live source — distinct from `recalculate`), `run`
48
+ * ({@linkcode PluginProgramSpreadsheetApi.runScript} executes a sandboxed script),
49
+ * and `ping` (a meta liveness probe). Renames for compliance: the host's `save` →
50
+ * `templates.create`; `getRecentEntries` → `getAuditLog`.
51
+ *
52
+ * Accessed via `snaptrude.program.spreadsheet`.
53
+ */
54
+ export declare abstract class PluginProgramSpreadsheetApi {
55
+ constructor();
56
+ /**
57
+ * Reusable sheet templates — capture a sheet's layout as a named template and
58
+ * re-apply it to another sheet. See {@linkcode PluginProgramSpreadsheetTemplatesApi}.
59
+ */
60
+ abstract templates: PluginProgramSpreadsheetTemplatesApi;
61
+ /**
62
+ * Live data bindings — bind a program dataset to a sheet range and refresh it
63
+ * on demand. See {@linkcode PluginProgramSpreadsheetBindingsApi}.
64
+ */
65
+ abstract bindings: PluginProgramSpreadsheetBindingsApi;
66
+ /**
67
+ * Plugin datasets — named, plugin-supplied row sets that bindings can render
68
+ * and auto-refresh on rerun. See {@linkcode PluginProgramSpreadsheetDatasetsApi}.
69
+ */
70
+ abstract datasets: PluginProgramSpreadsheetDatasetsApi;
71
+ /**
72
+ * Render a titled, formatted table onto a named sheet (create-or-replace).
73
+ *
74
+ * The intent-level replacement for the raw cell-write sequence: it writes the
75
+ * header + rows, applies per-column format/alignment, optionally wraps the
76
+ * block in a table, freezes the header, and appends a totals row. This is the
77
+ * generic table render; the `render*` family is reserved to also carry
78
+ * dataset-specific renders (`renderTakeoff`, `renderProgram`) once their
79
+ * argument shapes are ratified.
80
+ *
81
+ * @param sheetName - Target sheet name.
82
+ * @param columns - Column definitions, at least one (see
83
+ * {@linkcode PluginSpreadsheetColumn}).
84
+ * @param rows - Row objects keyed by column `key`.
85
+ * @param options - Optional `title`, `startCell` (default `"A1"`), `whenExists`
86
+ * (default `"replace"`), `asTable` (default `true`), `freezeHeader` (default
87
+ * `true`), and `totals` row.
88
+ * @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
89
+ * ranges and counts.
90
+ * @throws If `columns` is empty, the target sheet exists and `whenExists` is
91
+ * `"error"`, or a cell address is invalid.
92
+ *
93
+ * @examplePrompt Render my takeoff as a table on a sheet
94
+ * @examplePrompt Write the area schedule to a spreadsheet with totals
95
+ * @examplePrompt Put the department breakdown on a sheet called "Program"
96
+ * @examplePrompt Output this data as a formatted table with a header
97
+ * @examplePrompt Create a report sheet from these rows and columns
98
+ *
99
+ * # Example
100
+ * ```ts
101
+ * await snaptrude.program.spreadsheet.render(
102
+ * "Program",
103
+ * [
104
+ * { key: "name", header: "Department" },
105
+ * { key: "area", header: "Area", format: "0.00", align: "right" },
106
+ * ],
107
+ * [{ name: "FOH", area: 120.5 }],
108
+ * { totals: [{ column: "area", fn: "sum", label: "Total" }] },
109
+ * )
110
+ * ```
111
+ */
112
+ abstract render(sheetName: string, columns: PluginSpreadsheetColumn[], rows: Record<string, PluginSpreadsheetCell>[], options?: {
113
+ title?: string;
114
+ startCell?: string;
115
+ whenExists?: "replace" | "error";
116
+ asTable?: boolean;
117
+ freezeHeader?: boolean;
118
+ totals?: PluginSpreadsheetTotal[];
119
+ }): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
120
+ /**
121
+ * Render the quantity/material takeoff onto a sheet.
122
+ *
123
+ * A specialization of the render* family: the **host pulls and projects the
124
+ * current takeoff dataset itself** — the plugin supplies only the target
125
+ * `sheetName`, an optional `title`, and an optional `filter`; there is **no
126
+ * data argument**. The `filter` is applied host-side to the projected rows
127
+ * before rendering. Returns the same rendered-artifact record as
128
+ * {@linkcode PluginProgramSpreadsheetApi.render}.
129
+ * _(Authored ahead — optional via the `spreadsheet?` mount until the host
130
+ * round-trip is live.)_
131
+ *
132
+ * @param options - Optional `sheetName`, `title`, and `filter` — a
133
+ * case-insensitive substring kept when any of a row's cell values contains
134
+ * it (a {@linkcode PluginProgramSpreadsheetRenderDatasetArgs}).
135
+ * @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
136
+ * ranges and counts.
137
+ * @throws If the takeoff cannot be rendered.
138
+ *
139
+ * @examplePrompt Render the takeoff onto a sheet
140
+ * @examplePrompt Put the quantity takeoff on a spreadsheet
141
+ * @examplePrompt Generate the takeoff schedule sheet titled Takeoff
142
+ * @examplePrompt Render the material takeoff filtered to the walls
143
+ *
144
+ * # Example
145
+ * ```ts
146
+ * await snaptrude.program.spreadsheet.renderTakeoff({ sheetName: "Takeoff" })
147
+ * ```
148
+ */
149
+ abstract renderTakeoff(options?: {
150
+ sheetName?: string;
151
+ title?: string;
152
+ filter?: string;
153
+ }): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
154
+ /**
155
+ * Render the area program onto a sheet.
156
+ *
157
+ * A specialization of the render* family: the **host pulls and projects the
158
+ * current program dataset itself** (departments with area targets vs allocated)
159
+ * — the plugin supplies only the target `sheetName`, an optional `title`, and an
160
+ * optional `filter`; there is **no data argument**. The `filter` is applied
161
+ * host-side to the projected rows before rendering. Returns the same
162
+ * rendered-artifact record as {@linkcode PluginProgramSpreadsheetApi.render}.
163
+ * _(Authored ahead — optional via the `spreadsheet?` mount until the host
164
+ * round-trip is live.)_
165
+ *
166
+ * @param options - Optional `sheetName`, `title`, and `filter` — a
167
+ * case-insensitive substring kept when any of a row's cell values contains
168
+ * it (a {@linkcode PluginProgramSpreadsheetRenderDatasetArgs}).
169
+ * @returns A {@linkcode PluginProgramSpreadsheetRenderResult} with the written
170
+ * ranges and counts.
171
+ * @throws If the program cannot be rendered.
172
+ *
173
+ * @examplePrompt Render the area program onto a sheet
174
+ * @examplePrompt Put the department program on a spreadsheet
175
+ * @examplePrompt Generate the program schedule sheet titled Program
176
+ * @examplePrompt Render the program filtered to the residential departments
177
+ *
178
+ * # Example
179
+ * ```ts
180
+ * await snaptrude.program.spreadsheet.renderProgram({ sheetName: "Program" })
181
+ * ```
182
+ */
183
+ abstract renderProgram(options?: {
184
+ sheetName?: string;
185
+ title?: string;
186
+ filter?: string;
187
+ }): PluginApiReturn<PluginProgramSpreadsheetRenderResult>;
188
+ /**
189
+ * Export the report workbook to a file (xlsx, pdf, or csv).
190
+ *
191
+ * Returns the file content as base64 so the plugin can download, upload, or
192
+ * attach it. This is the workbook **file** export; to read cell **values** back
193
+ * as data, use {@linkcode PluginProgramSpreadsheetApi.getSheetData} instead.
194
+ *
195
+ * `xlsx` and `pdf` export the **whole** workbook. `csv` is inherently
196
+ * single-sheet: it serializes one sheet's used range — pass `options.sheetName`
197
+ * to choose which sheet, or omit it to serialize the active sheet.
198
+ *
199
+ * For a different export intent, see `core.io.export.model` (the 3D model
200
+ * file) and `presentation.export` (Present-mode layout sheets to PDF/PNG/JPG).
201
+ *
202
+ * @param format - The file format to export to.
203
+ * @param options - Optional `fileName` (without extension; a default is used
204
+ * when omitted) and `sheetName` — the sheet to serialize for `csv`
205
+ * (ignored by `xlsx`/`pdf`, which always export the whole workbook).
206
+ * @returns A {@linkcode PluginProgramSpreadsheetExportResult} with the file's
207
+ * `fileName`, `mimeType`, and base64 `dataBase64`.
208
+ * @throws If the workbook cannot be serialized to the requested format.
209
+ *
210
+ * @examplePrompt Export the report as an Excel file
211
+ * @examplePrompt Download the whole workbook as a PDF
212
+ * @examplePrompt Export the program workbook to xlsx
213
+ * @examplePrompt Save the report as a csv file
214
+ * @examplePrompt Export the Takeoff sheet as CSV
215
+ *
216
+ * # Example
217
+ * ```ts
218
+ * const file = await snaptrude.program.spreadsheet.export("xlsx")
219
+ * // file.fileName, file.mimeType, file.dataBase64
220
+ *
221
+ * // CSV of a specific sheet:
222
+ * const csv = await snaptrude.program.spreadsheet.export("csv", { sheetName: "Takeoff" })
223
+ * ```
224
+ */
225
+ abstract export(format: PluginSpreadsheetExportFormat, options?: {
226
+ fileName?: string;
227
+ sheetName?: string;
228
+ }): PluginApiReturn<PluginProgramSpreadsheetExportResult>;
229
+ /**
230
+ * List the sheets in the report workbook.
231
+ *
232
+ * @returns A {@linkcode PluginProgramSpreadsheetListSheetsResult} with each sheet's
233
+ * name/index/visibility/size, plus the active sheet name.
234
+ *
235
+ * @examplePrompt List the sheets in the spreadsheet
236
+ * @examplePrompt What sheets are in the report workbook?
237
+ * @examplePrompt Which sheet is currently active?
238
+ * @examplePrompt How many sheets does the report have?
239
+ *
240
+ * # Example
241
+ * ```ts
242
+ * const { sheets, activeSheet } = await snaptrude.program.spreadsheet.listSheets()
243
+ * ```
244
+ */
245
+ abstract listSheets(): PluginApiReturn<PluginProgramSpreadsheetListSheetsResult>;
246
+ /**
247
+ * Read a sheet's data back as a matrix (and optionally as header-keyed records).
248
+ *
249
+ * @param sheetName - Sheet to read.
250
+ * @param options - Optional `range` (A1; omit to read the sheet's used range)
251
+ * and `header` (`true` to also get records keyed by the header row).
252
+ * @returns A {@linkcode PluginProgramSpreadsheetGetSheetDataResult} with the read
253
+ * `range`, `values` matrix, and optional `records`.
254
+ * @throws If the sheet does not exist or the range is invalid.
255
+ *
256
+ * @examplePrompt Read the data back from the Program sheet
257
+ * @examplePrompt Get the values in range A1:D20 of a sheet
258
+ * @examplePrompt Read a sheet as rows of records keyed by header
259
+ * @examplePrompt What's in the takeoff sheet right now?
260
+ *
261
+ * # Example
262
+ * ```ts
263
+ * const { values, records } = await snaptrude.program.spreadsheet.getSheetData(
264
+ * "Program",
265
+ * { header: true },
266
+ * )
267
+ * ```
268
+ */
269
+ abstract getSheetData(sheetName: string, options?: {
270
+ range?: string;
271
+ header?: boolean;
272
+ }): PluginApiReturn<PluginProgramSpreadsheetGetSheetDataResult>;
273
+ /**
274
+ * Add a chart to a sheet, driven by a cell range.
275
+ *
276
+ * @param sheetName - Sheet to add the chart to.
277
+ * @param chartType - Chart type (see {@linkcode PluginSpreadsheetChartType}).
278
+ * @param dataRange - A1 range driving the chart.
279
+ * @param options - Optional `title`, `position` (sheet coords), and `size` (px).
280
+ * @returns A {@linkcode PluginProgramSpreadsheetAddChartResult} with the new
281
+ * chart's id.
282
+ * @throws If the sheet or data range is invalid.
283
+ *
284
+ * @examplePrompt Add a bar chart of the department areas
285
+ * @examplePrompt Insert a pie chart from range B2:C10
286
+ * @examplePrompt Put a column chart on the Program sheet
287
+ * @examplePrompt Chart the area breakdown by department
288
+ *
289
+ * # Example
290
+ * ```ts
291
+ * const { chartId } = await snaptrude.program.spreadsheet.addChart(
292
+ * "Program",
293
+ * "column",
294
+ * "A1:B10",
295
+ * { title: "Area by department" },
296
+ * )
297
+ * ```
298
+ */
299
+ abstract addChart(sheetName: string, chartType: PluginSpreadsheetChartType, dataRange: string, options?: {
300
+ title?: string;
301
+ position?: {
302
+ x: number;
303
+ y: number;
304
+ };
305
+ size?: {
306
+ width: number;
307
+ height: number;
308
+ };
309
+ }): PluginApiReturn<PluginProgramSpreadsheetAddChartResult>;
310
+ /**
311
+ * Place a floating image on a workbook sheet from a base64 data URI.
312
+ *
313
+ * The image is anchored at a cell's top-left corner (default `"A1"`) and
314
+ * floats over the grid (a SpreadJS floating picture — it does not occupy
315
+ * cells). Only base64 `data:image/png|jpeg|svg+xml` URIs are accepted —
316
+ * never URLs — and the URI is capped at 2 MB. Passing a `name` gives the
317
+ * picture a stable id: re-running with the same `name` replaces the previous
318
+ * picture (rerun-friendly); when omitted a name is generated.
319
+ *
320
+ * For images on Present-mode sheets (the tldraw canvas), use
321
+ * `presentation.shapes` instead — this verb places floating pictures in the
322
+ * SpreadJS workbook.
323
+ *
324
+ * @param sheetName - Sheet to place the image on.
325
+ * @param image - The image payload: a base64 `dataUri`
326
+ * (`data:image/png|jpeg|svg+xml;base64,…`, max 2 MB).
327
+ * @param options - Optional `anchorCell` (A1 notation, default `"A1"`),
328
+ * `size` in px (intrinsic size when omitted), and stable `name`
329
+ * (replace-on-rerun).
330
+ * @returns A {@linkcode PluginProgramSpreadsheetAddImageResult} with the sheet
331
+ * and the picture's name.
332
+ * @throws If the sheet does not exist, or the data URI is not an accepted
333
+ * image type or exceeds 2 MB.
334
+ *
335
+ * @examplePrompt Add my logo image to the report sheet
336
+ * @examplePrompt Place a PNG at cell B2 on the Takeoff sheet
337
+ * @examplePrompt Put an SVG diagram on a spreadsheet sheet
338
+ * @examplePrompt Insert an image into the workbook
339
+ *
340
+ * # Example
341
+ * ```ts
342
+ * const { name } = await snaptrude.program.spreadsheet.addImage(
343
+ * "Report",
344
+ * { dataUri: "data:image/png;base64,iVBORw0..." },
345
+ * { anchorCell: "B2", size: { width: 240, height: 120 }, name: "logo" },
346
+ * )
347
+ * ```
348
+ */
349
+ abstract addImage(sheetName: string, image: {
350
+ dataUri: string;
351
+ }, options?: {
352
+ anchorCell?: string;
353
+ size?: {
354
+ width: number;
355
+ height: number;
356
+ };
357
+ name?: string;
358
+ }): PluginApiReturn<PluginProgramSpreadsheetAddImageResult>;
359
+ /**
360
+ * Highlight a range of cells (background color and optional emphasis).
361
+ *
362
+ * @param sheetName - Sheet containing the range.
363
+ * @param range - A1 range to highlight.
364
+ * @param options - Optional `color` (CSS hex; a default emphasis is used when
365
+ * omitted) and `bold`.
366
+ * @returns A {@linkcode PluginProgramSpreadsheetHighlightCellsResult} echoing the
367
+ * highlighted sheet and range.
368
+ * @throws If the sheet or range is invalid.
369
+ *
370
+ * @examplePrompt Highlight the cells that are over budget
371
+ * @examplePrompt Color range A2:A10 red
372
+ * @examplePrompt Highlight B2:D2 in yellow
373
+ * @examplePrompt Emphasize the totals row on the Program sheet
374
+ *
375
+ * # Example
376
+ * ```ts
377
+ * await snaptrude.program.spreadsheet.highlightCells("Program", "A2:A10", {
378
+ * color: "#ffe08a",
379
+ * })
380
+ * ```
381
+ */
382
+ abstract highlightCells(sheetName: string, range: string, options?: {
383
+ color?: string;
384
+ bold?: boolean;
385
+ }): PluginApiReturn<PluginProgramSpreadsheetHighlightCellsResult>;
386
+ /**
387
+ * Read the area-program dataset (departments with target vs allocated area).
388
+ *
389
+ * Returns the same figures {@linkcode PluginProgramSpreadsheetApi.renderProgram}
390
+ * projects onto a sheet, as render-ready rows — so a plugin can inspect or
391
+ * transform the program before rendering it (or render it itself via
392
+ * {@linkcode PluginProgramSpreadsheetApi.render}). For the canonical
393
+ * area-program summary read, see {@linkcode PluginProgramMetricsApi.get}.
394
+ *
395
+ * @returns A {@linkcode PluginProgramSpreadsheetGetProgramResult} with per-department
396
+ * rows (`targetArea`/`allocatedArea`/`variance`), totals, and the report `units`.
397
+ *
398
+ * @examplePrompt Get the area program data
399
+ * @examplePrompt Read the department program before I render it
400
+ * @examplePrompt Give me the program rows with target vs allocated area
401
+ * @examplePrompt What's the program dataset the report is built from?
402
+ *
403
+ * # Example
404
+ * ```ts
405
+ * const program = await snaptrude.program.spreadsheet.getProgram()
406
+ * for (const row of program.rows) console.log(row.name, row.allocatedArea, row.targetArea)
407
+ * ```
408
+ */
409
+ abstract getProgram(): PluginApiReturn<PluginProgramSpreadsheetGetProgramResult>;
410
+ /**
411
+ * Read the quantity/material takeoff dataset (per-element quantities).
412
+ *
413
+ * Returns the same rows {@linkcode PluginProgramSpreadsheetApi.renderTakeoff}
414
+ * projects onto a sheet — one record per counted element (category, item,
415
+ * level, quantity, unit) — so a plugin can inspect or transform the takeoff
416
+ * before rendering it (or render it itself via
417
+ * {@linkcode PluginProgramSpreadsheetApi.render}).
418
+ *
419
+ * @returns A {@linkcode PluginProgramSpreadsheetGetTakeoffResult} with the takeoff
420
+ * `rows`, a `rowCount`, and the `generatedAt` timestamp.
421
+ *
422
+ * @examplePrompt Get the takeoff data
423
+ * @examplePrompt Read the quantity takeoff rows
424
+ * @examplePrompt Give me the per-element quantities before I render them
425
+ * @examplePrompt What's in the material takeoff right now?
426
+ *
427
+ * # Example
428
+ * ```ts
429
+ * const takeoff = await snaptrude.program.spreadsheet.getTakeoff()
430
+ * console.log(takeoff.rowCount, "elements")
431
+ * ```
432
+ */
433
+ abstract getTakeoff(): PluginApiReturn<PluginProgramSpreadsheetGetTakeoffResult>;
434
+ /**
435
+ * Read the material take-off dataset (surface area per material, per element type).
436
+ *
437
+ * The native "Material Take-Off" quantities — the same figures the BIM Take-Off's
438
+ * *Material Take-Off* sheet lists — as render-ready rows: for each material applied
439
+ * to a wall/floor/ceiling/slab/roof family, its rolled-up **surface area** in the
440
+ * project's display units. This is the material-centric complement to
441
+ * {@linkcode PluginProgramSpreadsheetApi.getTakeoff} (which rolls up by element
442
+ * family). A read only — nothing is written and no file is downloaded.
443
+ *
444
+ * When no materials are applied (or the model is empty) the result is simply an
445
+ * empty `rows` array — not an error.
446
+ *
447
+ * @returns A {@linkcode PluginProgramSpreadsheetGetMaterialTakeoffResult} with the
448
+ * material take-off `rows`, a `rowCount`, and the `generatedAt` timestamp.
449
+ *
450
+ * @examplePrompt Get the material take-off
451
+ * @examplePrompt How much of each material is used?
452
+ * @examplePrompt Read the surface area by material
453
+ * @examplePrompt Give me the material quantities before I render them
454
+ * @examplePrompt What's in the material take-off right now?
455
+ *
456
+ * # Example
457
+ * ```ts
458
+ * const mto = await snaptrude.program.spreadsheet.getMaterialTakeoff()
459
+ * for (const row of mto.rows) {
460
+ * console.log(row.objectType, row.family, row.material, row.quantity, row.unit)
461
+ * }
462
+ * ```
463
+ */
464
+ abstract getMaterialTakeoff(): PluginApiReturn<PluginProgramSpreadsheetGetMaterialTakeoffResult>;
465
+ /**
466
+ * Create (or reuse/replace) a named sheet in the report workbook.
467
+ *
468
+ * The blank-canvas complement to {@linkcode PluginProgramSpreadsheetApi.render}:
469
+ * use it when you want an empty sheet to write into with
470
+ * {@linkcode PluginProgramSpreadsheetApi.setValues} /
471
+ * {@linkcode PluginProgramSpreadsheetApi.setFormulas}. By default an existing
472
+ * sheet of the same name is reused; pass `whenExists` to replace or error.
473
+ *
474
+ * @param name - The sheet name to create.
475
+ * @param whenExists - Behaviour if the name exists: `"reuse"` (default),
476
+ * `"replace"`, or `"error"`.
477
+ * @returns A {@linkcode PluginProgramSpreadsheetCreateSheetResult} with the resolved
478
+ * `sheetName`, whether it `replaced` an existing sheet, and its `sheetIndex`.
479
+ * @throws If the sheet exists and `whenExists` is `"error"`.
480
+ *
481
+ * @examplePrompt Create a sheet called Summary
482
+ * @examplePrompt Add a new blank sheet named Takeoff
483
+ * @examplePrompt Make a sheet, replacing it if it already exists
484
+ * @examplePrompt Start a fresh sheet to write into
485
+ *
486
+ * # Example
487
+ * ```ts
488
+ * await snaptrude.program.spreadsheet.createSheet("Summary")
489
+ * ```
490
+ */
491
+ abstract createSheet(name: string, whenExists?: PluginSpreadsheetWhenExists): PluginApiReturn<PluginProgramSpreadsheetCreateSheetResult>;
492
+ /**
493
+ * Write a block of raw values into a sheet, anchored at a cell.
494
+ *
495
+ * The low-level cell-write path (the high-level path is
496
+ * {@linkcode PluginProgramSpreadsheetApi.render}, which adds a header, format,
497
+ * and totals). Values are written row-major from `startCell` (default `"A1"`);
498
+ * columns are auto-sized to fit.
499
+ *
500
+ * @param sheetName - Sheet to write into.
501
+ * @param values - Row-major matrix of values to write.
502
+ * @param startCell - Top-left anchor in A1 notation (default `"A1"`).
503
+ * @returns A {@linkcode PluginProgramSpreadsheetSetValuesResult} with the written
504
+ * `startCell`, `rowCount`, and `colCount`.
505
+ * @throws If the sheet does not exist or `startCell` is invalid.
506
+ *
507
+ * @examplePrompt Write these rows to the sheet starting at A1
508
+ * @examplePrompt Put this data into the Summary sheet
509
+ * @examplePrompt Set the values in the takeoff sheet from B2
510
+ * @examplePrompt Drop this matrix of numbers onto a sheet
511
+ *
512
+ * # Example
513
+ * ```ts
514
+ * await snaptrude.program.spreadsheet.setValues(
515
+ * "Summary",
516
+ * [["Department", "Area"], ["FOH", 120.5]],
517
+ * "A1",
518
+ * )
519
+ * ```
520
+ */
521
+ abstract setValues(sheetName: string, values: PluginSpreadsheetCell[][], startCell?: string): PluginApiReturn<PluginProgramSpreadsheetSetValuesResult>;
522
+ /**
523
+ * Set formulas on individual cells of a sheet.
524
+ *
525
+ * Each entry targets one cell (A1 notation) with a formula expression (a
526
+ * leading `=` is optional). Pairs with
527
+ * {@linkcode PluginProgramSpreadsheetApi.recalculate} when you need to force a
528
+ * recompute.
529
+ *
530
+ * @param sheetName - Sheet to set formulas on.
531
+ * @param formulas - The cell → formula assignments (see
532
+ * {@linkcode PluginSpreadsheetFormula}).
533
+ * @returns A {@linkcode PluginProgramSpreadsheetSetFormulasResult} with the `count`
534
+ * of formulas set.
535
+ * @throws If the sheet does not exist or a cell address is invalid.
536
+ *
537
+ * @examplePrompt Put a SUM formula in cell B10
538
+ * @examplePrompt Set formulas totalling each column
539
+ * @examplePrompt Add a formula to compute the variance column
540
+ * @examplePrompt Write =SUM(B2:B9) into B10 on the Summary sheet
541
+ *
542
+ * # Example
543
+ * ```ts
544
+ * await snaptrude.program.spreadsheet.setFormulas("Summary", [
545
+ * { cell: "B10", formula: "=SUM(B2:B9)" },
546
+ * ])
547
+ * ```
548
+ */
549
+ abstract setFormulas(sheetName: string, formulas: PluginSpreadsheetFormula[]): PluginApiReturn<PluginProgramSpreadsheetSetFormulasResult>;
550
+ /**
551
+ * Apply cell styles to one or more ranges of a sheet.
552
+ *
553
+ * Sets fill/text color, font, alignment, and number format on each given range.
554
+ * For a quick single-range emphasis,
555
+ * {@linkcode PluginProgramSpreadsheetApi.highlightCells} is the shortcut.
556
+ *
557
+ * @param sheetName - Sheet containing the ranges.
558
+ * @param ranges - Range → style assignments (each a range + a
559
+ * {@linkcode PluginSpreadsheetCellStyle}).
560
+ * @returns A {@linkcode PluginProgramSpreadsheetSetStylesResult} with the `count` of
561
+ * ranges styled.
562
+ * @throws If the sheet does not exist or a range is invalid.
563
+ *
564
+ * @examplePrompt Make the header row bold with a grey fill
565
+ * @examplePrompt Right-align the numbers in column B
566
+ * @examplePrompt Format A1:D1 with a background color and bold text
567
+ * @examplePrompt Style the totals row
568
+ *
569
+ * # Example
570
+ * ```ts
571
+ * await snaptrude.program.spreadsheet.setStyles("Summary", [
572
+ * { range: "A1:D1", style: { fontWeight: "bold", backColor: "#eef" } },
573
+ * ])
574
+ * ```
575
+ */
576
+ abstract setStyles(sheetName: string, ranges: PluginSpreadsheetRangeStyle[]): PluginApiReturn<PluginProgramSpreadsheetSetStylesResult>;
577
+ /**
578
+ * Merge a contiguous range of cells into a single spanned cell.
579
+ *
580
+ * Optionally sets the merged cell's value. (Verb ruling: `merge` is a
581
+ * spreadsheet-domain verb here — spanning cells — not the CSG-solid `union`.)
582
+ *
583
+ * @param sheetName - Sheet containing the range.
584
+ * @param range - A1 range to merge into one spanned cell.
585
+ * @param value - Optional value to set in the merged (top-left) cell.
586
+ * @returns A {@linkcode PluginProgramSpreadsheetMergeCellsResult} echoing the merged
587
+ * sheet and range.
588
+ * @throws If the sheet does not exist or the range is invalid.
589
+ *
590
+ * @examplePrompt Merge cells A1 to D1 for the title
591
+ * @examplePrompt Span the header across the first four columns
592
+ * @examplePrompt Merge A1:D1 and set it to "Program Summary"
593
+ *
594
+ * # Example
595
+ * ```ts
596
+ * await snaptrude.program.spreadsheet.mergeCells("Summary", "A1:D1", "Program Summary")
597
+ * ```
598
+ */
599
+ abstract mergeCells(sheetName: string, range: string, value?: PluginSpreadsheetCell): PluginApiReturn<PluginProgramSpreadsheetMergeCellsResult>;
600
+ /**
601
+ * Add a conditional-formatting rule to a range.
602
+ *
603
+ * Currently supports data-bar rules (a proportional in-cell bar); more rule
604
+ * types are reserved. For static (non-conditional) emphasis use
605
+ * {@linkcode PluginProgramSpreadsheetApi.highlightCells} or
606
+ * {@linkcode PluginProgramSpreadsheetApi.setStyles}.
607
+ *
608
+ * @param sheetName - Sheet containing the range.
609
+ * @param range - A1 range to format.
610
+ * @param rule - The conditional-format rule (see
611
+ * {@linkcode PluginSpreadsheetConditionalRule}).
612
+ * @returns A {@linkcode PluginProgramSpreadsheetAddConditionalFormattingResult} with
613
+ * whether a rule was `created`.
614
+ * @throws If the sheet does not exist or the range is invalid.
615
+ *
616
+ * @examplePrompt Add data bars to the area column
617
+ * @examplePrompt Show a proportional bar inside cells B2:B10
618
+ * @examplePrompt Add conditional formatting data bars to the quantities
619
+ *
620
+ * # Example
621
+ * ```ts
622
+ * await snaptrude.program.spreadsheet.addConditionalFormatting("Summary", "B2:B10", {
623
+ * type: "dataBar",
624
+ * color: "#4f9cf9",
625
+ * })
626
+ * ```
627
+ */
628
+ abstract addConditionalFormatting(sheetName: string, range: string, rule: PluginSpreadsheetConditionalRule): PluginApiReturn<PluginProgramSpreadsheetAddConditionalFormattingResult>;
629
+ /**
630
+ * Recompute the workbook's formula results.
631
+ *
632
+ * Recalculates every formula (or, when `sheetName` is given, focuses that sheet
633
+ * before recalculating the workbook). (Verb ruling: `recalculate` recomputes
634
+ * formulas — distinct from {@linkcode PluginProgramSpreadsheetBindingsApi.refresh},
635
+ * which re-pulls a binding's source data.)
636
+ *
637
+ * @param options - Optional `sheetName` to focus before recalculating; omit for
638
+ * the whole workbook.
639
+ * @returns A {@linkcode PluginProgramSpreadsheetRecalculateResult} with the recompute
640
+ * `scope` and the focused `sheetName` (or `null`).
641
+ *
642
+ * @examplePrompt Recalculate the workbook
643
+ * @examplePrompt Recompute all the formulas
644
+ * @examplePrompt Recalculate the Summary sheet
645
+ *
646
+ * # Example
647
+ * ```ts
648
+ * await snaptrude.program.spreadsheet.recalculate()
649
+ * ```
650
+ */
651
+ abstract recalculate(options?: {
652
+ sheetName?: string;
653
+ }): PluginApiReturn<PluginProgramSpreadsheetRecalculateResult>;
654
+ /**
655
+ * Run a sequence of sheet operations as one atomic, undoable transaction.
656
+ *
657
+ * Batches cell-construction operations (createSheet/setValues/setFormulas/
658
+ * setStyles/mergeCells) so they commit together and undo as a single step, with
659
+ * events suspended for speed. (`transaction` is the sanctioned §4 atomic-batch
660
+ * verb.)
661
+ *
662
+ * @param operations - The operations to run in order. Each operation's `args`
663
+ * stays that method's schema **object** (the wire shape), not positional.
664
+ * @param label - Optional undo-history label for the batch.
665
+ * @returns A {@linkcode PluginProgramSpreadsheetTransactionResult} with the
666
+ * `operationCount` and each operation's `results`.
667
+ * @throws If any operation names an unsupported method or fails.
668
+ *
669
+ * @examplePrompt Create a sheet and write to it in one atomic step
670
+ * @examplePrompt Batch these sheet edits as a single undoable action
671
+ * @examplePrompt Run these operations together as one transaction
672
+ *
673
+ * # Example
674
+ * ```ts
675
+ * await snaptrude.program.spreadsheet.transaction(
676
+ * [
677
+ * { method: "createSheet", args: { name: "Summary" } },
678
+ * { method: "setValues", args: { sheetName: "Summary", values: [["A", 1]] } },
679
+ * ],
680
+ * "Build summary",
681
+ * )
682
+ * ```
683
+ */
684
+ abstract transaction(operations: PluginSpreadsheetTransactionOp[], label?: string): PluginApiReturn<PluginProgramSpreadsheetTransactionResult>;
685
+ /**
686
+ * Run an author-supplied script against a sandboxed workbook facade.
687
+ *
688
+ * The escape hatch for advanced automation the typed methods don't cover: the
689
+ * `script` runs against a restricted `workbook` object with browser/network
690
+ * globals blocked, and its return value is handed back as `result`. Prefer the
691
+ * typed methods where they exist. (Verb ruling: `run` executes a script.)
692
+ *
693
+ * @param script - Script source, run against the sandboxed `workbook` facade.
694
+ * @returns A {@linkcode PluginProgramSpreadsheetRunScriptResult} with the script's
695
+ * `result`.
696
+ * @throws If the script uses a blocked browser/network API or throws at runtime.
697
+ *
698
+ * @examplePrompt Run this SpreadJS script against the workbook
699
+ * @examplePrompt Execute a custom script on the sheets
700
+ * @examplePrompt Run a script to tweak the workbook
701
+ *
702
+ * # Example
703
+ * ```ts
704
+ * const { result } = await snaptrude.program.spreadsheet.runScript(
705
+ * "return workbook.getSheetCount();",
706
+ * )
707
+ * ```
708
+ */
709
+ abstract runScript(script: string): PluginApiReturn<PluginProgramSpreadsheetRunScriptResult>;
710
+ /**
711
+ * Read the recent audit log of program-spreadsheet operations.
712
+ *
713
+ * Returns the most recent operations performed through this API (method, sheet,
714
+ * status, summary, timestamp), newest first — useful for showing the user what
715
+ * a plugin changed. (Renamed from the host's `getRecentEntries` for §4 `get`
716
+ * compliance.)
717
+ *
718
+ * @param options - Optional `limit` on the entries returned (clamped 1–100,
719
+ * default 20).
720
+ * @returns A {@linkcode PluginProgramSpreadsheetGetAuditLogResult} with the audit
721
+ * `entries`, newest first.
722
+ *
723
+ * @examplePrompt Show the recent spreadsheet actions
724
+ * @examplePrompt What did the plugin change in the workbook?
725
+ * @examplePrompt Get the last 10 audit log entries
726
+ * @examplePrompt Read the program spreadsheet audit log
727
+ *
728
+ * # Example
729
+ * ```ts
730
+ * const { entries } = await snaptrude.program.spreadsheet.getAuditLog({ limit: 10 })
731
+ * ```
732
+ */
733
+ abstract getAuditLog(options?: {
734
+ limit?: number;
735
+ }): PluginApiReturn<PluginProgramSpreadsheetGetAuditLogResult>;
736
+ /**
737
+ * Ping the program-mode spreadsheet bridge to check it is reachable.
738
+ *
739
+ * A liveness probe: resolves with `{ pong: true }` when the program-mode
740
+ * workbook bridge is up. (Verb ruling: `ping` is a meta liveness verb.)
741
+ *
742
+ * @returns A {@linkcode PluginProgramSpreadsheetPingResult} — `{ pong: true }` when
743
+ * the bridge is reachable.
744
+ *
745
+ * @examplePrompt Ping the spreadsheet bridge
746
+ * @examplePrompt Is the program spreadsheet available?
747
+ * @examplePrompt Check the spreadsheet connection is alive
748
+ *
749
+ * # Example
750
+ * ```ts
751
+ * const { pong } = await snaptrude.program.spreadsheet.ping()
752
+ * ```
753
+ */
754
+ abstract ping(): PluginApiReturn<PluginProgramSpreadsheetPingResult>;
755
+ /**
756
+ * Create a **custom program sheet** — a live view of the program grouped by a
757
+ * configurable hierarchy (the Program tab's "Custom" sheet with *Organize →
758
+ * Group by*).
759
+ *
760
+ * Unlike {@linkcode PluginProgramSpreadsheetApi.createSheet} (a blank sheet you
761
+ * write cells into), a custom sheet is data-bound: its rows are the project's
762
+ * spaces, re-rendered from the model, grouped by `groupBy` in order (e.g.
763
+ * `["departmentName", "<metadataHeaderId>", "label"]` for a healthcare
764
+ * department → sub-department → room hierarchy) and showing the `properties`
765
+ * columns. Valid property ids come from
766
+ * {@linkcode PluginProgramSpreadsheetApi.listCustomSheetProperties} — built-in
767
+ * properties plus every program metadata header id. The configuration is
768
+ * saved with the sheet.
769
+ *
770
+ * @param name - The sheet name to create (must not already exist).
771
+ * @param options - Optional `groupBy` (property ids, outermost first; default
772
+ * none), `properties` (column property ids, in order; default
773
+ * `["label", "areas"]`), and `groupColors` (property id → CSS hex fill for
774
+ * that level's group headers).
775
+ * @returns The sheet's {@linkcode PluginSpreadsheetCustomSheet} configuration.
776
+ * @throws If a sheet named `name` already exists, or a property id is unknown.
777
+ *
778
+ * @examplePrompt Create a custom sheet grouped by department then sub-department
779
+ * @examplePrompt Make a program view grouped by storey and label
780
+ * @examplePrompt Build a grouped program sheet for the healthcare hierarchy
781
+ * @examplePrompt Add a custom sheet with a department → room type group-by
782
+ *
783
+ * # Example
784
+ * ```ts
785
+ * const { headers } = await snaptrude.program.metadata.listHeaders()
786
+ * const subDept = headers.find((h) => h.name === "Sub-department")
787
+ * await snaptrude.program.spreadsheet.createCustomSheet("Clinical Program", {
788
+ * groupBy: ["departmentName", subDept.headerId, "label"],
789
+ * properties: ["label", "count", "areas", "netAreaAchieved"],
790
+ * })
791
+ * ```
792
+ */
793
+ abstract createCustomSheet(name: string, options?: {
794
+ groupBy?: string[];
795
+ properties?: string[];
796
+ groupColors?: Record<string, string>;
797
+ }): PluginApiReturn<PluginProgramSpreadsheetCustomSheetResult>;
798
+ /**
799
+ * Update a custom program sheet's group-by hierarchy, columns, or group colors.
800
+ *
801
+ * A **sparse** update: omitted fields are left unchanged. The sheet is
802
+ * re-rendered once and the configuration saved.
803
+ *
804
+ * @param sheetName - The custom sheet to update.
805
+ * @param options - Any of `groupBy`, `properties`, `groupColors` (see
806
+ * {@linkcode PluginProgramSpreadsheetApi.createCustomSheet}).
807
+ * @returns The sheet's updated {@linkcode PluginSpreadsheetCustomSheet}.
808
+ * @throws If `sheetName` is not a custom program sheet, or a property id is
809
+ * unknown.
810
+ *
811
+ * @examplePrompt Change the custom sheet to group by storey first
812
+ * @examplePrompt Add the Occupancy column to my grouped program sheet
813
+ * @examplePrompt Regroup the Clinical Program sheet by department only
814
+ *
815
+ * # Example
816
+ * ```ts
817
+ * await snaptrude.program.spreadsheet.updateCustomSheet("Clinical Program", {
818
+ * groupBy: ["storey", "departmentName"],
819
+ * })
820
+ * ```
821
+ */
822
+ abstract updateCustomSheet(sheetName: string, options: {
823
+ groupBy?: string[];
824
+ properties?: string[];
825
+ groupColors?: Record<string, string>;
826
+ }): PluginApiReturn<PluginProgramSpreadsheetCustomSheetResult>;
827
+ /**
828
+ * Get a custom program sheet's configuration.
829
+ *
830
+ * @param sheetName - The sheet to read.
831
+ * @returns Its {@linkcode PluginSpreadsheetCustomSheet}, or `null` when no
832
+ * custom program sheet has that name (plain sheets return `null` too).
833
+ *
834
+ * @examplePrompt How is the Clinical Program sheet grouped?
835
+ * @examplePrompt Get the group-by configuration of this custom sheet
836
+ *
837
+ * # Example
838
+ * ```ts
839
+ * const cfg = await snaptrude.program.spreadsheet.getCustomSheet("Clinical Program")
840
+ * if (cfg) console.log(cfg.groupBy, cfg.properties)
841
+ * ```
842
+ */
843
+ abstract getCustomSheet(sheetName: string): PluginApiReturn<PluginProgramSpreadsheetGetCustomSheetResult>;
844
+ /**
845
+ * List the custom program sheets in the workbook with their configurations.
846
+ *
847
+ * @returns A {@linkcode PluginProgramSpreadsheetListCustomSheetsResult} with a
848
+ * `sheets` array (empty when there are none).
849
+ *
850
+ * @examplePrompt List the custom program sheets
851
+ * @examplePrompt Which sheets are grouped program views?
852
+ *
853
+ * # Example
854
+ * ```ts
855
+ * const { sheets } = await snaptrude.program.spreadsheet.listCustomSheets()
856
+ * ```
857
+ */
858
+ abstract listCustomSheets(): PluginApiReturn<PluginProgramSpreadsheetListCustomSheetsResult>;
859
+ /**
860
+ * List the property ids a custom program sheet can show as columns or group by.
861
+ *
862
+ * Built-in properties (`label`, `departmentName`, `storey`, `areas`, …) plus
863
+ * one entry per program metadata header (its `headerId`). `groupable` is
864
+ * `false` for computed properties that can only be columns.
865
+ *
866
+ * @returns A {@linkcode PluginProgramSpreadsheetListCustomSheetPropertiesResult}.
867
+ *
868
+ * @examplePrompt What can I group a custom program sheet by?
869
+ * @examplePrompt List the columns available for a custom sheet
870
+ *
871
+ * # Example
872
+ * ```ts
873
+ * const { properties } = await snaptrude.program.spreadsheet.listCustomSheetProperties()
874
+ * const groupable = properties.filter((p) => p.groupable).map((p) => p.id)
875
+ * ```
876
+ */
877
+ abstract listCustomSheetProperties(): PluginApiReturn<PluginProgramSpreadsheetListCustomSheetPropertiesResult>;
878
+ }
879
+ /**
880
+ * Program-spreadsheet templates — capture a sheet's layout as a named, reusable
881
+ * template and re-apply it to another sheet.
882
+ *
883
+ * Accessed via `snaptrude.program.spreadsheet.templates`.
884
+ */
885
+ export declare abstract class PluginProgramSpreadsheetTemplatesApi {
886
+ constructor();
887
+ /**
888
+ * Save a sheet's current layout as a named template.
889
+ *
890
+ * (Renamed from the host's `save` to `create` for §4 compliance.)
891
+ *
892
+ * @param name - Template name (re-saving the same name overwrites it).
893
+ * @param sheetName - The source sheet to capture.
894
+ * @param scope - Template scope: `"project"` (default) or `"global"`.
895
+ * @returns A {@linkcode PluginProgramSpreadsheetTemplatesCreateResult} with the new
896
+ * template's `id`, `name`, `scope`, and source `sheetName`.
897
+ * @throws If the source sheet does not exist.
898
+ *
899
+ * @examplePrompt Save this sheet as a reusable template
900
+ * @examplePrompt Create a template from the Summary sheet
901
+ * @examplePrompt Save the current layout as a template called "Cover"
902
+ *
903
+ * # Example
904
+ * ```ts
905
+ * await snaptrude.program.spreadsheet.templates.create("Cover", "Summary")
906
+ * ```
907
+ */
908
+ abstract create(name: string, sheetName: string, scope?: PluginSpreadsheetTemplateScope): PluginApiReturn<PluginProgramSpreadsheetTemplatesCreateResult>;
909
+ /**
910
+ * Apply a saved template to a target sheet (create-or-replace).
911
+ *
912
+ * @param name - The template to apply.
913
+ * @param targetSheetName - The sheet to create/replace from the template.
914
+ * @returns A {@linkcode PluginProgramSpreadsheetTemplatesApplyResult} echoing the
915
+ * applied template and target sheet.
916
+ * @throws If the named template does not exist.
917
+ *
918
+ * @examplePrompt Apply the Cover template to a new sheet
919
+ * @examplePrompt Use my saved template on the Report sheet
920
+ * @examplePrompt Apply template "Cover" to sheet "Report"
921
+ *
922
+ * # Example
923
+ * ```ts
924
+ * await snaptrude.program.spreadsheet.templates.apply("Cover", "Report")
925
+ * ```
926
+ */
927
+ abstract apply(name: string, targetSheetName: string): PluginApiReturn<PluginProgramSpreadsheetTemplatesApplyResult>;
928
+ }
929
+ /**
930
+ * Program-spreadsheet data bindings — bind a live program dataset to a sheet
931
+ * range so it can be refreshed on demand.
932
+ *
933
+ * A binding links a dataset (e.g. the takeoff) to a target sheet range; a refresh
934
+ * re-pulls the current data and rewrites the range. Accessed via
935
+ * `snaptrude.program.spreadsheet.bindings`.
936
+ */
937
+ export declare abstract class PluginProgramSpreadsheetBindingsApi {
938
+ constructor();
939
+ /**
940
+ * Create a named binding from a dataset to a sheet range (and do an initial refresh).
941
+ *
942
+ * @param name - Binding name (re-using a name overwrites it).
943
+ * @param source - The dataset to bind (see
944
+ * {@linkcode PluginSpreadsheetBindingSource}).
945
+ * @param target - The target sheet range (see
946
+ * {@linkcode PluginSpreadsheetBindingTarget}).
947
+ * @param mode - How a refresh writes into the target (default `"replaceRange"`).
948
+ * @returns A {@linkcode PluginProgramSpreadsheetBindingsCreateResult} — the stored
949
+ * binding plus the `refresh` result of the initial pull.
950
+ * @throws If the target sheet does not exist.
951
+ *
952
+ * @examplePrompt Bind the takeoff to the Data sheet
953
+ * @examplePrompt Create a live binding from the takeoff to A1 on Data
954
+ * @examplePrompt Link the takeoff dataset to a sheet range
955
+ *
956
+ * # Example
957
+ * ```ts
958
+ * await snaptrude.program.spreadsheet.bindings.create(
959
+ * "takeoff",
960
+ * { dataset: "takeoff" },
961
+ * { sheetName: "Data", startCell: "A1" },
962
+ * )
963
+ * ```
964
+ */
965
+ abstract create(name: string, source: PluginSpreadsheetBindingSource, target: PluginSpreadsheetBindingTarget, mode?: PluginSpreadsheetBindingMode): PluginApiReturn<PluginProgramSpreadsheetBindingsCreateResult>;
966
+ /**
967
+ * Refresh one binding (by name) or all bindings, re-pulling their source data.
968
+ *
969
+ * (Verb ruling: `refresh` re-pulls a binding's live source into its target
970
+ * range — distinct from {@linkcode PluginProgramSpreadsheetApi.recalculate},
971
+ * which recomputes formulas.)
972
+ *
973
+ * @param options - Optional binding `name`; omit it to refresh every binding.
974
+ * @returns A {@linkcode PluginProgramSpreadsheetBindingsRefreshResult} with a
975
+ * `refreshed` entry per binding that was updated.
976
+ * @throws If a `name` is given but no binding with that name exists.
977
+ *
978
+ * @examplePrompt Refresh the takeoff binding
979
+ * @examplePrompt Re-pull all my data bindings
980
+ * @examplePrompt Refresh every binding on the sheets
981
+ *
982
+ * # Example
983
+ * ```ts
984
+ * await snaptrude.program.spreadsheet.bindings.refresh({ name: "takeoff" })
985
+ * ```
986
+ */
987
+ abstract refresh(options?: {
988
+ name?: string;
989
+ }): PluginApiReturn<PluginProgramSpreadsheetBindingsRefreshResult>;
990
+ /**
991
+ * List all data bindings in the workbook.
992
+ *
993
+ * @returns A {@linkcode PluginProgramSpreadsheetBindingsListResult} with every
994
+ * stored {@linkcode PluginSpreadsheetBinding}.
995
+ *
996
+ * @examplePrompt List the data bindings
997
+ * @examplePrompt What bindings are set up on the sheets?
998
+ * @examplePrompt Show all the live data bindings
999
+ *
1000
+ * # Example
1001
+ * ```ts
1002
+ * const { bindings } = await snaptrude.program.spreadsheet.bindings.list()
1003
+ * ```
1004
+ */
1005
+ abstract list(): PluginApiReturn<PluginProgramSpreadsheetBindingsListResult>;
1006
+ }
1007
+ /**
1008
+ * Program-spreadsheet plugin datasets — named, plugin-supplied row sets stored
1009
+ * alongside the workbook so bindings can render and re-render them.
1010
+ *
1011
+ * A dataset is uploaded with {@linkcode PluginProgramSpreadsheetDatasetsApi.set}
1012
+ * (upsert by name). A binding whose source is `{ dataset: "plugin", name }`
1013
+ * renders the dataset at its target anchor, and re-renders automatically every
1014
+ * time the dataset is set again — the "refresh on rerun" behaviour. Accessed
1015
+ * via `snaptrude.program.spreadsheet.datasets`.
1016
+ */
1017
+ export declare abstract class PluginProgramSpreadsheetDatasetsApi {
1018
+ constructor();
1019
+ /**
1020
+ * Store (upsert) a named plugin dataset.
1021
+ *
1022
+ * Re-using a `name` replaces the dataset and automatically refreshes every
1023
+ * binding whose source is `{ dataset: "plugin", name }` — no extra plugin
1024
+ * calls needed to keep bound ranges current. Limits: at most 10,000 rows and
1025
+ * 2 MB serialized.
1026
+ *
1027
+ * @param name - Dataset name (re-using a name overwrites it).
1028
+ * @param columns - Column definitions (see {@linkcode PluginSpreadsheetColumn});
1029
+ * their order is the column order bindings render.
1030
+ * @param rows - Row objects keyed by column `key`.
1031
+ * @returns A {@linkcode PluginProgramSpreadsheetDatasetsSetResult} with the
1032
+ * stored row count.
1033
+ * @throws If the dataset exceeds 10,000 rows or 2 MB serialized.
1034
+ *
1035
+ * @examplePrompt Store my plugin's rows as a named dataset
1036
+ * @examplePrompt Upload data the sheets can bind to and refresh
1037
+ * @examplePrompt Save a dataset for a live sheet binding
1038
+ * @examplePrompt Push my computed table so a binding keeps it fresh
1039
+ *
1040
+ * # Example
1041
+ * ```ts
1042
+ * await snaptrude.program.spreadsheet.datasets.set(
1043
+ * "costs",
1044
+ * [
1045
+ * { key: "item", header: "Item" },
1046
+ * { key: "cost", header: "Cost", align: "right" },
1047
+ * ],
1048
+ * [{ item: "Concrete", cost: 120 }],
1049
+ * )
1050
+ * ```
1051
+ */
1052
+ abstract set(name: string, columns: PluginSpreadsheetColumn[], rows: Record<string, PluginSpreadsheetCell>[]): PluginApiReturn<PluginProgramSpreadsheetDatasetsSetResult>;
1053
+ /**
1054
+ * List the stored plugin datasets.
1055
+ *
1056
+ * @returns A {@linkcode PluginProgramSpreadsheetDatasetsListResult} with each
1057
+ * dataset's `name`, `rowCount`, and `updatedAt` timestamp.
1058
+ *
1059
+ * @examplePrompt List my plugin datasets
1060
+ * @examplePrompt What datasets are stored for the sheets?
1061
+ * @examplePrompt Show the data sets bindings can use
1062
+ *
1063
+ * # Example
1064
+ * ```ts
1065
+ * const { datasets } = await snaptrude.program.spreadsheet.datasets.list()
1066
+ * ```
1067
+ */
1068
+ abstract list(): PluginApiReturn<PluginProgramSpreadsheetDatasetsListResult>;
1069
+ }
1070
+ /** A single spreadsheet cell value. */
1071
+ export declare const PluginSpreadsheetCell: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
1072
+ export type PluginSpreadsheetCell = z.infer<typeof PluginSpreadsheetCell>;
1073
+ /** Horizontal alignment for a rendered column. */
1074
+ export declare const PluginSpreadsheetAlign: z.ZodEnum<{
1075
+ center: "center";
1076
+ left: "left";
1077
+ right: "right";
1078
+ }>;
1079
+ export type PluginSpreadsheetAlign = z.infer<typeof PluginSpreadsheetAlign>;
1080
+ /**
1081
+ * A column definition for {@linkcode PluginProgramSpreadsheetApi.render}.
1082
+ *
1083
+ * | Property | Type | Description |
1084
+ * |---|---|---|
1085
+ * | `key` | `string` | Key into each row object |
1086
+ * | `header` | `string` | Column header text |
1087
+ * | `width` | `number?` | Fixed column width in px; auto-fit when omitted |
1088
+ * | `format` | `string?` | Number/date format string applied to the data cells |
1089
+ * | `align` | `"left" \| "center" \| "right"?` | Cell alignment |
1090
+ */
1091
+ export declare const PluginSpreadsheetColumn: z.ZodObject<{
1092
+ key: z.ZodString;
1093
+ header: z.ZodString;
1094
+ width: z.ZodOptional<z.ZodNumber>;
1095
+ format: z.ZodOptional<z.ZodString>;
1096
+ align: z.ZodOptional<z.ZodEnum<{
1097
+ center: "center";
1098
+ left: "left";
1099
+ right: "right";
1100
+ }>>;
1101
+ }, z.core.$strip>;
1102
+ export type PluginSpreadsheetColumn = z.infer<typeof PluginSpreadsheetColumn>;
1103
+ /**
1104
+ * A totals-row aggregation for {@linkcode PluginProgramSpreadsheetApi.render}.
1105
+ *
1106
+ * | Property | Type | Description |
1107
+ * |---|---|---|
1108
+ * | `column` | `string` | The {@linkcode PluginSpreadsheetColumn} `key` to aggregate |
1109
+ * | `fn` | `"sum" \| "avg" \| "count" \| "min" \| "max"` | Aggregation function |
1110
+ * | `label` | `string?` | Optional label printed in the first column of the totals row |
1111
+ */
1112
+ export declare const PluginSpreadsheetTotal: z.ZodObject<{
1113
+ column: z.ZodString;
1114
+ fn: z.ZodEnum<{
1115
+ min: "min";
1116
+ max: "max";
1117
+ count: "count";
1118
+ sum: "sum";
1119
+ avg: "avg";
1120
+ }>;
1121
+ label: z.ZodOptional<z.ZodString>;
1122
+ }, z.core.$strip>;
1123
+ export type PluginSpreadsheetTotal = z.infer<typeof PluginSpreadsheetTotal>;
1124
+ /**
1125
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.render}.
1126
+ *
1127
+ * | Property | Type | Description |
1128
+ * |---|---|---|
1129
+ * | `sheetName` | `string` | Target sheet name |
1130
+ * | `columns` | {@linkcode PluginSpreadsheetColumn}`[]` | Column definitions (at least one) |
1131
+ * | `rows` | `Record<string, cell>[]` | Row objects keyed by column `key` |
1132
+ * | `title` | `string?` | Optional title rendered above the header |
1133
+ * | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
1134
+ * | `whenExists` | `"replace" \| "error"?` | Behaviour if the sheet exists (default `"replace"`) |
1135
+ * | `asTable` | `boolean?` | Wrap the block in a table (default `true`) |
1136
+ * | `freezeHeader` | `boolean?` | Freeze rows above the data (default `true`) |
1137
+ * | `totals` | {@linkcode PluginSpreadsheetTotal}`[]?` | Optional totals row |
1138
+ */
1139
+ export declare const PluginProgramSpreadsheetRenderArgs: z.ZodObject<{
1140
+ sheetName: z.ZodString;
1141
+ columns: z.ZodArray<z.ZodObject<{
1142
+ key: z.ZodString;
1143
+ header: z.ZodString;
1144
+ width: z.ZodOptional<z.ZodNumber>;
1145
+ format: z.ZodOptional<z.ZodString>;
1146
+ align: z.ZodOptional<z.ZodEnum<{
1147
+ center: "center";
1148
+ left: "left";
1149
+ right: "right";
1150
+ }>>;
1151
+ }, z.core.$strip>>;
1152
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1153
+ title: z.ZodOptional<z.ZodString>;
1154
+ startCell: z.ZodOptional<z.ZodString>;
1155
+ whenExists: z.ZodOptional<z.ZodEnum<{
1156
+ error: "error";
1157
+ replace: "replace";
1158
+ }>>;
1159
+ asTable: z.ZodOptional<z.ZodBoolean>;
1160
+ freezeHeader: z.ZodOptional<z.ZodBoolean>;
1161
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
1162
+ column: z.ZodString;
1163
+ fn: z.ZodEnum<{
1164
+ min: "min";
1165
+ max: "max";
1166
+ count: "count";
1167
+ sum: "sum";
1168
+ avg: "avg";
1169
+ }>;
1170
+ label: z.ZodOptional<z.ZodString>;
1171
+ }, z.core.$strip>>>;
1172
+ }, z.core.$strip>;
1173
+ export type PluginProgramSpreadsheetRenderArgs = z.infer<typeof PluginProgramSpreadsheetRenderArgs>;
1174
+ /**
1175
+ * Result of {@linkcode PluginProgramSpreadsheetApi.render}.
1176
+ *
1177
+ * | Property | Type | Description |
1178
+ * |---|---|---|
1179
+ * | `sheetName` | `string` | The sheet that was written |
1180
+ * | `range` | `string` | A1 range covering the full written block (title + header + data + totals) |
1181
+ * | `headerRange` | `string` | A1 range of the header row alone |
1182
+ * | `rowCount` | `number` | Number of data rows written (excludes title/header/totals) |
1183
+ * | `colCount` | `number` | Number of columns written |
1184
+ * | `tableName` | `string \| null` | The created table's name, or `null` when not wrapped as a table |
1185
+ * | `replaced` | `boolean` | Whether an existing sheet was replaced |
1186
+ */
1187
+ export declare const PluginProgramSpreadsheetRenderResult: z.ZodObject<{
1188
+ sheetName: z.ZodString;
1189
+ range: z.ZodString;
1190
+ headerRange: z.ZodString;
1191
+ rowCount: z.ZodNumber;
1192
+ colCount: z.ZodNumber;
1193
+ tableName: z.ZodNullable<z.ZodString>;
1194
+ replaced: z.ZodBoolean;
1195
+ }, z.core.$strip>;
1196
+ export type PluginProgramSpreadsheetRenderResult = z.infer<typeof PluginProgramSpreadsheetRenderResult>;
1197
+ /**
1198
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.renderTakeoff} and
1199
+ * {@linkcode PluginProgramSpreadsheetApi.renderProgram} — the dataset render
1200
+ * methods. There is **no data argument**: the host pulls and projects the
1201
+ * takeoff/program dataset itself. All fields are optional. (Both methods share
1202
+ * this args type, as `import.image`/`import.pdf` share their args.)
1203
+ *
1204
+ * | Property | Type | Description |
1205
+ * |---|---|---|
1206
+ * | `sheetName` | `string?` | Target sheet name (a default is used when omitted) |
1207
+ * | `title` | `string?` | Optional title rendered above the table |
1208
+ * | `filter` | `string?` | Case-insensitive substring — a row is kept when any of its cell values contains it (blank/omitted keeps every row). Not a query language. |
1209
+ */
1210
+ export declare const PluginProgramSpreadsheetRenderDatasetArgs: z.ZodObject<{
1211
+ sheetName: z.ZodOptional<z.ZodString>;
1212
+ title: z.ZodOptional<z.ZodString>;
1213
+ filter: z.ZodOptional<z.ZodString>;
1214
+ }, z.core.$strip>;
1215
+ export type PluginProgramSpreadsheetRenderDatasetArgs = z.infer<typeof PluginProgramSpreadsheetRenderDatasetArgs>;
1216
+ /** The workbook export file format. */
1217
+ export declare const PluginSpreadsheetExportFormat: z.ZodEnum<{
1218
+ pdf: "pdf";
1219
+ xlsx: "xlsx";
1220
+ csv: "csv";
1221
+ }>;
1222
+ export type PluginSpreadsheetExportFormat = z.infer<typeof PluginSpreadsheetExportFormat>;
1223
+ /**
1224
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.export}.
1225
+ *
1226
+ * | Property | Type | Description |
1227
+ * |---|---|---|
1228
+ * | `format` | `"xlsx" \| "pdf" \| "csv"` | The file format to export to |
1229
+ * | `fileName` | `string?` | Desired file name (without extension); a default is used when omitted |
1230
+ * | `sheetName` | `string?` | For `csv`: the sheet to serialize (the active sheet when omitted). Ignored by `xlsx`/`pdf`. |
1231
+ */
1232
+ export declare const PluginProgramSpreadsheetExportArgs: z.ZodObject<{
1233
+ format: z.ZodEnum<{
1234
+ pdf: "pdf";
1235
+ xlsx: "xlsx";
1236
+ csv: "csv";
1237
+ }>;
1238
+ fileName: z.ZodOptional<z.ZodString>;
1239
+ sheetName: z.ZodOptional<z.ZodString>;
1240
+ }, z.core.$strip>;
1241
+ export type PluginProgramSpreadsheetExportArgs = z.infer<typeof PluginProgramSpreadsheetExportArgs>;
1242
+ /**
1243
+ * Result of {@linkcode PluginProgramSpreadsheetApi.export} — the exported workbook file.
1244
+ *
1245
+ * | Property | Type | Description |
1246
+ * |---|---|---|
1247
+ * | `format` | `"xlsx" \| "pdf" \| "csv"` | The format the file was exported in |
1248
+ * | `fileName` | `string` | The file name (with extension) |
1249
+ * | `mimeType` | `string` | The file's MIME type |
1250
+ * | `dataBase64` | `string` | The file's bytes, base64-encoded |
1251
+ */
1252
+ export declare const PluginProgramSpreadsheetExportResult: z.ZodObject<{
1253
+ format: z.ZodEnum<{
1254
+ pdf: "pdf";
1255
+ xlsx: "xlsx";
1256
+ csv: "csv";
1257
+ }>;
1258
+ fileName: z.ZodString;
1259
+ mimeType: z.ZodString;
1260
+ dataBase64: z.ZodString;
1261
+ }, z.core.$strip>;
1262
+ export type PluginProgramSpreadsheetExportResult = z.infer<typeof PluginProgramSpreadsheetExportResult>;
1263
+ /**
1264
+ * Metadata for one sheet in {@linkcode PluginProgramSpreadsheetListSheetsResult}.
1265
+ *
1266
+ * | Property | Type | Description |
1267
+ * |---|---|---|
1268
+ * | `name` | `string` | Sheet name |
1269
+ * | `index` | `number` | Zero-based sheet index |
1270
+ * | `visible` | `boolean` | Whether the sheet is visible |
1271
+ * | `rowCount` | `number` | Total rows in the sheet |
1272
+ * | `colCount` | `number` | Total columns in the sheet |
1273
+ */
1274
+ export declare const PluginSpreadsheetSheetInfo: z.ZodObject<{
1275
+ name: z.ZodString;
1276
+ index: z.ZodNumber;
1277
+ visible: z.ZodBoolean;
1278
+ rowCount: z.ZodNumber;
1279
+ colCount: z.ZodNumber;
1280
+ }, z.core.$strip>;
1281
+ export type PluginSpreadsheetSheetInfo = z.infer<typeof PluginSpreadsheetSheetInfo>;
1282
+ /**
1283
+ * Result of {@linkcode PluginProgramSpreadsheetApi.listSheets}.
1284
+ *
1285
+ * | Property | Type | Description |
1286
+ * |---|---|---|
1287
+ * | `sheets` | {@linkcode PluginSpreadsheetSheetInfo}`[]` | All sheets in the workbook |
1288
+ * | `activeSheet` | `string \| null` | The active sheet name, or `null` |
1289
+ */
1290
+ export declare const PluginProgramSpreadsheetListSheetsResult: z.ZodObject<{
1291
+ sheets: z.ZodArray<z.ZodObject<{
1292
+ name: z.ZodString;
1293
+ index: z.ZodNumber;
1294
+ visible: z.ZodBoolean;
1295
+ rowCount: z.ZodNumber;
1296
+ colCount: z.ZodNumber;
1297
+ }, z.core.$strip>>;
1298
+ activeSheet: z.ZodNullable<z.ZodString>;
1299
+ }, z.core.$strip>;
1300
+ export type PluginProgramSpreadsheetListSheetsResult = z.infer<typeof PluginProgramSpreadsheetListSheetsResult>;
1301
+ /**
1302
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.getSheetData}.
1303
+ *
1304
+ * | Property | Type | Description |
1305
+ * |---|---|---|
1306
+ * | `sheetName` | `string` | Sheet to read |
1307
+ * | `range` | `string?` | A1 range; defaults to the sheet's used range |
1308
+ * | `header` | `boolean?` | When `true`, also return records keyed by the first (header) row |
1309
+ */
1310
+ export declare const PluginProgramSpreadsheetGetSheetDataArgs: z.ZodObject<{
1311
+ sheetName: z.ZodString;
1312
+ range: z.ZodOptional<z.ZodString>;
1313
+ header: z.ZodOptional<z.ZodBoolean>;
1314
+ }, z.core.$strip>;
1315
+ export type PluginProgramSpreadsheetGetSheetDataArgs = z.infer<typeof PluginProgramSpreadsheetGetSheetDataArgs>;
1316
+ /**
1317
+ * Result of {@linkcode PluginProgramSpreadsheetApi.getSheetData}.
1318
+ *
1319
+ * | Property | Type | Description |
1320
+ * |---|---|---|
1321
+ * | `sheetName` | `string` | The sheet that was read |
1322
+ * | `range` | `string` | A1 range that was read |
1323
+ * | `values` | `cell[][]` | Row-major matrix of cell values |
1324
+ * | `records` | `Record<string, cell>[]?` | Present only when `header` was `true`: rows keyed by header |
1325
+ */
1326
+ export declare const PluginProgramSpreadsheetGetSheetDataResult: z.ZodObject<{
1327
+ sheetName: z.ZodString;
1328
+ range: z.ZodString;
1329
+ values: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1330
+ records: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>;
1331
+ }, z.core.$strip>;
1332
+ export type PluginProgramSpreadsheetGetSheetDataResult = z.infer<typeof PluginProgramSpreadsheetGetSheetDataResult>;
1333
+ /** Chart type for {@linkcode PluginProgramSpreadsheetApi.addChart}. */
1334
+ export declare const PluginSpreadsheetChartType: z.ZodEnum<{
1335
+ line: "line";
1336
+ area: "area";
1337
+ column: "column";
1338
+ bar: "bar";
1339
+ pie: "pie";
1340
+ scatter: "scatter";
1341
+ }>;
1342
+ export type PluginSpreadsheetChartType = z.infer<typeof PluginSpreadsheetChartType>;
1343
+ /**
1344
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.addChart}.
1345
+ *
1346
+ * | Property | Type | Description |
1347
+ * |---|---|---|
1348
+ * | `sheetName` | `string` | Sheet to add the chart to |
1349
+ * | `chartType` | `"column" \| "bar" \| "line" \| "pie" \| "area" \| "scatter"` | Chart type |
1350
+ * | `dataRange` | `string` | A1 range driving the chart |
1351
+ * | `title` | `string?` | Optional chart title |
1352
+ * | `position` | `{ x; y }?` | Top-left position (sheet coords) |
1353
+ * | `size` | `{ width; height }?` | Chart size in px |
1354
+ */
1355
+ export declare const PluginProgramSpreadsheetAddChartArgs: z.ZodObject<{
1356
+ sheetName: z.ZodString;
1357
+ chartType: z.ZodEnum<{
1358
+ line: "line";
1359
+ area: "area";
1360
+ column: "column";
1361
+ bar: "bar";
1362
+ pie: "pie";
1363
+ scatter: "scatter";
1364
+ }>;
1365
+ dataRange: z.ZodString;
1366
+ title: z.ZodOptional<z.ZodString>;
1367
+ position: z.ZodOptional<z.ZodObject<{
1368
+ x: z.ZodNumber;
1369
+ y: z.ZodNumber;
1370
+ }, z.core.$strip>>;
1371
+ size: z.ZodOptional<z.ZodObject<{
1372
+ width: z.ZodNumber;
1373
+ height: z.ZodNumber;
1374
+ }, z.core.$strip>>;
1375
+ }, z.core.$strip>;
1376
+ export type PluginProgramSpreadsheetAddChartArgs = z.infer<typeof PluginProgramSpreadsheetAddChartArgs>;
1377
+ /**
1378
+ * Result of {@linkcode PluginProgramSpreadsheetApi.addChart}.
1379
+ *
1380
+ * | Property | Type | Description |
1381
+ * |---|---|---|
1382
+ * | `chartId` | `string` | Id of the created chart |
1383
+ */
1384
+ export declare const PluginProgramSpreadsheetAddChartResult: z.ZodObject<{
1385
+ chartId: z.ZodString;
1386
+ }, z.core.$strip>;
1387
+ export type PluginProgramSpreadsheetAddChartResult = z.infer<typeof PluginProgramSpreadsheetAddChartResult>;
1388
+ /**
1389
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.highlightCells}.
1390
+ *
1391
+ * | Property | Type | Description |
1392
+ * |---|---|---|
1393
+ * | `sheetName` | `string` | Sheet containing the range |
1394
+ * | `range` | `string` | A1 range to highlight |
1395
+ * | `color` | `string?` | CSS hex background color (a default emphasis is used when omitted) |
1396
+ * | `bold` | `boolean?` | Also bold the text |
1397
+ */
1398
+ export declare const PluginProgramSpreadsheetHighlightCellsArgs: z.ZodObject<{
1399
+ sheetName: z.ZodString;
1400
+ range: z.ZodString;
1401
+ color: z.ZodOptional<z.ZodString>;
1402
+ bold: z.ZodOptional<z.ZodBoolean>;
1403
+ }, z.core.$strip>;
1404
+ export type PluginProgramSpreadsheetHighlightCellsArgs = z.infer<typeof PluginProgramSpreadsheetHighlightCellsArgs>;
1405
+ /**
1406
+ * Result of {@linkcode PluginProgramSpreadsheetApi.highlightCells}.
1407
+ *
1408
+ * | Property | Type | Description |
1409
+ * |---|---|---|
1410
+ * | `sheetName` | `string` | The sheet that was highlighted |
1411
+ * | `range` | `string` | The range that was highlighted |
1412
+ */
1413
+ export declare const PluginProgramSpreadsheetHighlightCellsResult: z.ZodObject<{
1414
+ sheetName: z.ZodString;
1415
+ range: z.ZodString;
1416
+ }, z.core.$strip>;
1417
+ export type PluginProgramSpreadsheetHighlightCellsResult = z.infer<typeof PluginProgramSpreadsheetHighlightCellsResult>;
1418
+ /**
1419
+ * One department row in the area-program dataset. Areas are in the enclosing
1420
+ * {@linkcode PluginProgramSpreadsheetGetProgramResult}'s `units`. This mirrors
1421
+ * {@linkcode PluginProgramDepartmentMetric}, plus a derived `variance`.
1422
+ *
1423
+ * | Property | Type | Description |
1424
+ * |---|---|---|
1425
+ * | `departmentId` | `string` | Department id |
1426
+ * | `name` | `string` | Department name |
1427
+ * | `targetArea` | `number \| null` | Target area, or `null` if no target is set |
1428
+ * | `allocatedArea` | `number` | Area currently allocated to this department |
1429
+ * | `variance` | `number \| null` | `allocatedArea − targetArea`, or `null` when no target |
1430
+ */
1431
+ export declare const PluginSpreadsheetProgramRow: z.ZodObject<{
1432
+ departmentId: z.ZodString;
1433
+ name: z.ZodString;
1434
+ targetArea: z.ZodNullable<z.ZodNumber>;
1435
+ allocatedArea: z.ZodNumber;
1436
+ variance: z.ZodNullable<z.ZodNumber>;
1437
+ }, z.core.$strip>;
1438
+ export type PluginSpreadsheetProgramRow = z.infer<typeof PluginSpreadsheetProgramRow>;
1439
+ /**
1440
+ * Result of {@linkcode PluginProgramSpreadsheetApi.getProgram} — the area-program
1441
+ * dataset {@linkcode PluginProgramSpreadsheetApi.renderProgram} draws. For the
1442
+ * canonical summary read, see {@linkcode PluginProgramMetricsApi.get}.
1443
+ *
1444
+ * | Property | Type | Description |
1445
+ * |---|---|---|
1446
+ * | `units` | `"ft2" \| "m2"` | The unit every area in this dataset is reported in |
1447
+ * | `rows` | {@linkcode PluginSpreadsheetProgramRow}`[]` | Per-department program rows |
1448
+ * | `totalTargetArea` | `number` | Sum of all department target areas |
1449
+ * | `totalAllocatedArea` | `number` | Total allocated area |
1450
+ * | `generatedAt` | `string` | ISO timestamp of when the dataset was projected |
1451
+ */
1452
+ export declare const PluginProgramSpreadsheetGetProgramResult: z.ZodObject<{
1453
+ units: z.ZodEnum<{
1454
+ ft2: "ft2";
1455
+ m2: "m2";
1456
+ }>;
1457
+ rows: z.ZodArray<z.ZodObject<{
1458
+ departmentId: z.ZodString;
1459
+ name: z.ZodString;
1460
+ targetArea: z.ZodNullable<z.ZodNumber>;
1461
+ allocatedArea: z.ZodNumber;
1462
+ variance: z.ZodNullable<z.ZodNumber>;
1463
+ }, z.core.$strip>>;
1464
+ totalTargetArea: z.ZodNumber;
1465
+ totalAllocatedArea: z.ZodNumber;
1466
+ generatedAt: z.ZodString;
1467
+ }, z.core.$strip>;
1468
+ export type PluginProgramSpreadsheetGetProgramResult = z.infer<typeof PluginProgramSpreadsheetGetProgramResult>;
1469
+ /**
1470
+ * One family-aggregated row in the quantity/material takeoff dataset. The takeoff
1471
+ * is grouped by object type + category + family (not per element), so each row is
1472
+ * a rolled-up quantity for that family.
1473
+ *
1474
+ * | Property | Type | Description |
1475
+ * |---|---|---|
1476
+ * | `objectType` | `string` | Element object type (e.g. `"Wall"`, `"Door"`, `"Window"`) |
1477
+ * | `category` | `string` | Element category |
1478
+ * | `family` | `string` | Element family the quantity is aggregated over |
1479
+ * | `quantity` | `number` | Aggregated quantity in `unit` |
1480
+ * | `unit` | `string` | Quantity unit (e.g. `"m"` for length, `"m2"` for area) |
1481
+ */
1482
+ export declare const PluginSpreadsheetTakeoffRow: z.ZodObject<{
1483
+ objectType: z.ZodString;
1484
+ category: z.ZodString;
1485
+ family: z.ZodString;
1486
+ quantity: z.ZodNumber;
1487
+ unit: z.ZodString;
1488
+ }, z.core.$strip>;
1489
+ export type PluginSpreadsheetTakeoffRow = z.infer<typeof PluginSpreadsheetTakeoffRow>;
1490
+ /**
1491
+ * Result of {@linkcode PluginProgramSpreadsheetApi.getTakeoff} — the takeoff dataset
1492
+ * {@linkcode PluginProgramSpreadsheetApi.renderTakeoff} draws.
1493
+ *
1494
+ * | Property | Type | Description |
1495
+ * |---|---|---|
1496
+ * | `rows` | {@linkcode PluginSpreadsheetTakeoffRow}`[]` | One row per aggregated object-type/category/family group |
1497
+ * | `rowCount` | `number` | Number of rows |
1498
+ * | `generatedAt` | `string` | ISO timestamp of when the dataset was read |
1499
+ */
1500
+ export declare const PluginProgramSpreadsheetGetTakeoffResult: z.ZodObject<{
1501
+ rows: z.ZodArray<z.ZodObject<{
1502
+ objectType: z.ZodString;
1503
+ category: z.ZodString;
1504
+ family: z.ZodString;
1505
+ quantity: z.ZodNumber;
1506
+ unit: z.ZodString;
1507
+ }, z.core.$strip>>;
1508
+ rowCount: z.ZodNumber;
1509
+ generatedAt: z.ZodString;
1510
+ }, z.core.$strip>;
1511
+ export type PluginProgramSpreadsheetGetTakeoffResult = z.infer<typeof PluginProgramSpreadsheetGetTakeoffResult>;
1512
+ /**
1513
+ * One row in the material take-off dataset. The take-off is grouped by element
1514
+ * object type + family + applied material, so each row is a rolled-up surface
1515
+ * area for that material on that family.
1516
+ *
1517
+ * | Property | Type | Description |
1518
+ * |---|---|---|
1519
+ * | `objectType` | `string` | Element object type the material sits on (`"wall"`, `"floor"`, `"ceiling"`, `"slab"`, `"roof"`) |
1520
+ * | `family` | `string` | Element family the quantity is aggregated under |
1521
+ * | `material` | `string` | Applied material name |
1522
+ * | `quantity` | `number` | Rolled-up surface area in `unit` |
1523
+ * | `unit` | `string` | Area unit (e.g. `"sq.ft"` or `"sq.m"`) |
1524
+ */
1525
+ export declare const PluginSpreadsheetMaterialTakeoffRow: z.ZodObject<{
1526
+ objectType: z.ZodString;
1527
+ family: z.ZodString;
1528
+ material: z.ZodString;
1529
+ quantity: z.ZodNumber;
1530
+ unit: z.ZodString;
1531
+ }, z.core.$strip>;
1532
+ export type PluginSpreadsheetMaterialTakeoffRow = z.infer<typeof PluginSpreadsheetMaterialTakeoffRow>;
1533
+ /**
1534
+ * Result of {@linkcode PluginProgramSpreadsheetApi.getMaterialTakeoff} — the native
1535
+ * material take-off dataset (surface area per material). Empty when no materials are
1536
+ * applied.
1537
+ *
1538
+ * | Property | Type | Description |
1539
+ * |---|---|---|
1540
+ * | `rows` | {@linkcode PluginSpreadsheetMaterialTakeoffRow}`[]` | One row per object-type/family/material group |
1541
+ * | `rowCount` | `number` | Number of rows |
1542
+ * | `generatedAt` | `string` | ISO timestamp of when the dataset was read |
1543
+ */
1544
+ export declare const PluginProgramSpreadsheetGetMaterialTakeoffResult: z.ZodObject<{
1545
+ rows: z.ZodArray<z.ZodObject<{
1546
+ objectType: z.ZodString;
1547
+ family: z.ZodString;
1548
+ material: z.ZodString;
1549
+ quantity: z.ZodNumber;
1550
+ unit: z.ZodString;
1551
+ }, z.core.$strip>>;
1552
+ rowCount: z.ZodNumber;
1553
+ generatedAt: z.ZodString;
1554
+ }, z.core.$strip>;
1555
+ export type PluginProgramSpreadsheetGetMaterialTakeoffResult = z.infer<typeof PluginProgramSpreadsheetGetMaterialTakeoffResult>;
1556
+ /** Behaviour when {@linkcode PluginProgramSpreadsheetApi.createSheet} targets an existing sheet name. */
1557
+ export declare const PluginSpreadsheetWhenExists: z.ZodEnum<{
1558
+ error: "error";
1559
+ replace: "replace";
1560
+ reuse: "reuse";
1561
+ }>;
1562
+ export type PluginSpreadsheetWhenExists = z.infer<typeof PluginSpreadsheetWhenExists>;
1563
+ /**
1564
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.createSheet}.
1565
+ *
1566
+ * | Property | Type | Description |
1567
+ * |---|---|---|
1568
+ * | `name` | `string` | The sheet name to create |
1569
+ * | `whenExists` | `"reuse" \| "replace" \| "error"?` | Behaviour if the name exists (default `"reuse"`) |
1570
+ */
1571
+ export declare const PluginProgramSpreadsheetCreateSheetArgs: z.ZodObject<{
1572
+ name: z.ZodString;
1573
+ whenExists: z.ZodOptional<z.ZodEnum<{
1574
+ error: "error";
1575
+ replace: "replace";
1576
+ reuse: "reuse";
1577
+ }>>;
1578
+ }, z.core.$strip>;
1579
+ export type PluginProgramSpreadsheetCreateSheetArgs = z.infer<typeof PluginProgramSpreadsheetCreateSheetArgs>;
1580
+ /**
1581
+ * Result of {@linkcode PluginProgramSpreadsheetApi.createSheet}.
1582
+ *
1583
+ * | Property | Type | Description |
1584
+ * |---|---|---|
1585
+ * | `sheetName` | `string` | The resolved sheet name |
1586
+ * | `replaced` | `boolean` | Whether an existing sheet was replaced/cleared |
1587
+ * | `sheetIndex` | `number \| null` | Zero-based index of the sheet, or `null` if unknown |
1588
+ */
1589
+ export declare const PluginProgramSpreadsheetCreateSheetResult: z.ZodObject<{
1590
+ sheetName: z.ZodString;
1591
+ replaced: z.ZodBoolean;
1592
+ sheetIndex: z.ZodNullable<z.ZodNumber>;
1593
+ }, z.core.$strip>;
1594
+ export type PluginProgramSpreadsheetCreateSheetResult = z.infer<typeof PluginProgramSpreadsheetCreateSheetResult>;
1595
+ /**
1596
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.setValues}.
1597
+ *
1598
+ * | Property | Type | Description |
1599
+ * |---|---|---|
1600
+ * | `sheetName` | `string` | Sheet to write into |
1601
+ * | `values` | `cell[][]` | Row-major matrix of values to write |
1602
+ * | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
1603
+ */
1604
+ export declare const PluginProgramSpreadsheetSetValuesArgs: z.ZodObject<{
1605
+ sheetName: z.ZodString;
1606
+ values: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1607
+ startCell: z.ZodOptional<z.ZodString>;
1608
+ }, z.core.$strip>;
1609
+ export type PluginProgramSpreadsheetSetValuesArgs = z.infer<typeof PluginProgramSpreadsheetSetValuesArgs>;
1610
+ /**
1611
+ * Result of {@linkcode PluginProgramSpreadsheetApi.setValues}.
1612
+ *
1613
+ * | Property | Type | Description |
1614
+ * |---|---|---|
1615
+ * | `sheetName` | `string` | The sheet that was written |
1616
+ * | `startCell` | `string` | The anchor cell values were written from |
1617
+ * | `rowCount` | `number` | Number of rows written |
1618
+ * | `colCount` | `number` | Widest row's column count |
1619
+ */
1620
+ export declare const PluginProgramSpreadsheetSetValuesResult: z.ZodObject<{
1621
+ sheetName: z.ZodString;
1622
+ startCell: z.ZodString;
1623
+ rowCount: z.ZodNumber;
1624
+ colCount: z.ZodNumber;
1625
+ }, z.core.$strip>;
1626
+ export type PluginProgramSpreadsheetSetValuesResult = z.infer<typeof PluginProgramSpreadsheetSetValuesResult>;
1627
+ /**
1628
+ * A single cell formula for {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
1629
+ *
1630
+ * | Property | Type | Description |
1631
+ * |---|---|---|
1632
+ * | `cell` | `string` | Target cell in A1 notation |
1633
+ * | `formula` | `string` | Formula expression (a leading `=` is optional) |
1634
+ */
1635
+ export declare const PluginSpreadsheetFormula: z.ZodObject<{
1636
+ cell: z.ZodString;
1637
+ formula: z.ZodString;
1638
+ }, z.core.$strip>;
1639
+ export type PluginSpreadsheetFormula = z.infer<typeof PluginSpreadsheetFormula>;
1640
+ /**
1641
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
1642
+ *
1643
+ * | Property | Type | Description |
1644
+ * |---|---|---|
1645
+ * | `sheetName` | `string` | Sheet to set formulas on |
1646
+ * | `formulas` | {@linkcode PluginSpreadsheetFormula}`[]` | The cell → formula assignments |
1647
+ */
1648
+ export declare const PluginProgramSpreadsheetSetFormulasArgs: z.ZodObject<{
1649
+ sheetName: z.ZodString;
1650
+ formulas: z.ZodArray<z.ZodObject<{
1651
+ cell: z.ZodString;
1652
+ formula: z.ZodString;
1653
+ }, z.core.$strip>>;
1654
+ }, z.core.$strip>;
1655
+ export type PluginProgramSpreadsheetSetFormulasArgs = z.infer<typeof PluginProgramSpreadsheetSetFormulasArgs>;
1656
+ /**
1657
+ * Result of {@linkcode PluginProgramSpreadsheetApi.setFormulas}.
1658
+ *
1659
+ * | Property | Type | Description |
1660
+ * |---|---|---|
1661
+ * | `sheetName` | `string` | The sheet that was written |
1662
+ * | `count` | `number` | Number of formulas set |
1663
+ */
1664
+ export declare const PluginProgramSpreadsheetSetFormulasResult: z.ZodObject<{
1665
+ sheetName: z.ZodString;
1666
+ count: z.ZodNumber;
1667
+ }, z.core.$strip>;
1668
+ export type PluginProgramSpreadsheetSetFormulasResult = z.infer<typeof PluginProgramSpreadsheetSetFormulasResult>;
1669
+ /** Font weight for a {@linkcode PluginSpreadsheetCellStyle}. */
1670
+ export declare const PluginSpreadsheetFontWeight: z.ZodEnum<{
1671
+ normal: "normal";
1672
+ bold: "bold";
1673
+ }>;
1674
+ export type PluginSpreadsheetFontWeight = z.infer<typeof PluginSpreadsheetFontWeight>;
1675
+ /** Font style for a {@linkcode PluginSpreadsheetCellStyle}. */
1676
+ export declare const PluginSpreadsheetFontStyle: z.ZodEnum<{
1677
+ normal: "normal";
1678
+ italic: "italic";
1679
+ }>;
1680
+ export type PluginSpreadsheetFontStyle = z.infer<typeof PluginSpreadsheetFontStyle>;
1681
+ /** Horizontal cell alignment for a {@linkcode PluginSpreadsheetCellStyle}. */
1682
+ export declare const PluginSpreadsheetHorizontalAlign: z.ZodEnum<{
1683
+ center: "center";
1684
+ left: "left";
1685
+ right: "right";
1686
+ general: "general";
1687
+ }>;
1688
+ export type PluginSpreadsheetHorizontalAlign = z.infer<typeof PluginSpreadsheetHorizontalAlign>;
1689
+ /** Vertical cell alignment for a {@linkcode PluginSpreadsheetCellStyle}. */
1690
+ export declare const PluginSpreadsheetVerticalAlign: z.ZodEnum<{
1691
+ center: "center";
1692
+ top: "top";
1693
+ bottom: "bottom";
1694
+ }>;
1695
+ export type PluginSpreadsheetVerticalAlign = z.infer<typeof PluginSpreadsheetVerticalAlign>;
1696
+ /**
1697
+ * A cell style for {@linkcode PluginProgramSpreadsheetApi.setStyles}. All fields
1698
+ * are optional; only the ones provided are applied.
1699
+ *
1700
+ * | Property | Type | Description |
1701
+ * |---|---|---|
1702
+ * | `backColor` | `string?` | Background (fill) color, CSS hex |
1703
+ * | `foreColor` | `string?` | Text color, CSS hex |
1704
+ * | `font` | `string?` | Full CSS font shorthand (overrides the parts below) |
1705
+ * | `fontFamily` | `string?` | Font family |
1706
+ * | `fontSize` | `number?` | Font size in px |
1707
+ * | `fontWeight` | `"normal" \| "bold"?` | Font weight |
1708
+ * | `fontStyle` | `"normal" \| "italic"?` | Font style |
1709
+ * | `formatter` | `string?` | Number/date format string |
1710
+ * | `horizontalAlign` | `"left" \| "center" \| "right" \| "general"?` | Horizontal alignment |
1711
+ * | `verticalAlign` | `"top" \| "center" \| "bottom"?` | Vertical alignment |
1712
+ */
1713
+ export declare const PluginSpreadsheetCellStyle: z.ZodObject<{
1714
+ backColor: z.ZodOptional<z.ZodString>;
1715
+ foreColor: z.ZodOptional<z.ZodString>;
1716
+ font: z.ZodOptional<z.ZodString>;
1717
+ fontFamily: z.ZodOptional<z.ZodString>;
1718
+ fontSize: z.ZodOptional<z.ZodNumber>;
1719
+ fontWeight: z.ZodOptional<z.ZodEnum<{
1720
+ normal: "normal";
1721
+ bold: "bold";
1722
+ }>>;
1723
+ fontStyle: z.ZodOptional<z.ZodEnum<{
1724
+ normal: "normal";
1725
+ italic: "italic";
1726
+ }>>;
1727
+ formatter: z.ZodOptional<z.ZodString>;
1728
+ horizontalAlign: z.ZodOptional<z.ZodEnum<{
1729
+ center: "center";
1730
+ left: "left";
1731
+ right: "right";
1732
+ general: "general";
1733
+ }>>;
1734
+ verticalAlign: z.ZodOptional<z.ZodEnum<{
1735
+ center: "center";
1736
+ top: "top";
1737
+ bottom: "bottom";
1738
+ }>>;
1739
+ }, z.core.$strip>;
1740
+ export type PluginSpreadsheetCellStyle = z.infer<typeof PluginSpreadsheetCellStyle>;
1741
+ /**
1742
+ * A range + the style to apply to it, for {@linkcode PluginProgramSpreadsheetApi.setStyles}.
1743
+ *
1744
+ * | Property | Type | Description |
1745
+ * |---|---|---|
1746
+ * | `range` | `string` | A1 range to style |
1747
+ * | `style` | {@linkcode PluginSpreadsheetCellStyle} | The style to apply |
1748
+ */
1749
+ export declare const PluginSpreadsheetRangeStyle: z.ZodObject<{
1750
+ range: z.ZodString;
1751
+ style: z.ZodObject<{
1752
+ backColor: z.ZodOptional<z.ZodString>;
1753
+ foreColor: z.ZodOptional<z.ZodString>;
1754
+ font: z.ZodOptional<z.ZodString>;
1755
+ fontFamily: z.ZodOptional<z.ZodString>;
1756
+ fontSize: z.ZodOptional<z.ZodNumber>;
1757
+ fontWeight: z.ZodOptional<z.ZodEnum<{
1758
+ normal: "normal";
1759
+ bold: "bold";
1760
+ }>>;
1761
+ fontStyle: z.ZodOptional<z.ZodEnum<{
1762
+ normal: "normal";
1763
+ italic: "italic";
1764
+ }>>;
1765
+ formatter: z.ZodOptional<z.ZodString>;
1766
+ horizontalAlign: z.ZodOptional<z.ZodEnum<{
1767
+ center: "center";
1768
+ left: "left";
1769
+ right: "right";
1770
+ general: "general";
1771
+ }>>;
1772
+ verticalAlign: z.ZodOptional<z.ZodEnum<{
1773
+ center: "center";
1774
+ top: "top";
1775
+ bottom: "bottom";
1776
+ }>>;
1777
+ }, z.core.$strip>;
1778
+ }, z.core.$strip>;
1779
+ export type PluginSpreadsheetRangeStyle = z.infer<typeof PluginSpreadsheetRangeStyle>;
1780
+ /**
1781
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.setStyles}.
1782
+ *
1783
+ * | Property | Type | Description |
1784
+ * |---|---|---|
1785
+ * | `sheetName` | `string` | Sheet containing the ranges |
1786
+ * | `ranges` | {@linkcode PluginSpreadsheetRangeStyle}`[]` | Range → style assignments |
1787
+ */
1788
+ export declare const PluginProgramSpreadsheetSetStylesArgs: z.ZodObject<{
1789
+ sheetName: z.ZodString;
1790
+ ranges: z.ZodArray<z.ZodObject<{
1791
+ range: z.ZodString;
1792
+ style: z.ZodObject<{
1793
+ backColor: z.ZodOptional<z.ZodString>;
1794
+ foreColor: z.ZodOptional<z.ZodString>;
1795
+ font: z.ZodOptional<z.ZodString>;
1796
+ fontFamily: z.ZodOptional<z.ZodString>;
1797
+ fontSize: z.ZodOptional<z.ZodNumber>;
1798
+ fontWeight: z.ZodOptional<z.ZodEnum<{
1799
+ normal: "normal";
1800
+ bold: "bold";
1801
+ }>>;
1802
+ fontStyle: z.ZodOptional<z.ZodEnum<{
1803
+ normal: "normal";
1804
+ italic: "italic";
1805
+ }>>;
1806
+ formatter: z.ZodOptional<z.ZodString>;
1807
+ horizontalAlign: z.ZodOptional<z.ZodEnum<{
1808
+ center: "center";
1809
+ left: "left";
1810
+ right: "right";
1811
+ general: "general";
1812
+ }>>;
1813
+ verticalAlign: z.ZodOptional<z.ZodEnum<{
1814
+ center: "center";
1815
+ top: "top";
1816
+ bottom: "bottom";
1817
+ }>>;
1818
+ }, z.core.$strip>;
1819
+ }, z.core.$strip>>;
1820
+ }, z.core.$strip>;
1821
+ export type PluginProgramSpreadsheetSetStylesArgs = z.infer<typeof PluginProgramSpreadsheetSetStylesArgs>;
1822
+ /**
1823
+ * Result of {@linkcode PluginProgramSpreadsheetApi.setStyles}.
1824
+ *
1825
+ * | Property | Type | Description |
1826
+ * |---|---|---|
1827
+ * | `sheetName` | `string` | The sheet that was styled |
1828
+ * | `count` | `number` | Number of ranges styled |
1829
+ */
1830
+ export declare const PluginProgramSpreadsheetSetStylesResult: z.ZodObject<{
1831
+ sheetName: z.ZodString;
1832
+ count: z.ZodNumber;
1833
+ }, z.core.$strip>;
1834
+ export type PluginProgramSpreadsheetSetStylesResult = z.infer<typeof PluginProgramSpreadsheetSetStylesResult>;
1835
+ /**
1836
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.mergeCells}.
1837
+ *
1838
+ * | Property | Type | Description |
1839
+ * |---|---|---|
1840
+ * | `sheetName` | `string` | Sheet containing the range |
1841
+ * | `range` | `string` | A1 range to merge into one spanned cell |
1842
+ * | `value` | `cell?` | Optional value to set in the merged (top-left) cell |
1843
+ */
1844
+ export declare const PluginProgramSpreadsheetMergeCellsArgs: z.ZodObject<{
1845
+ sheetName: z.ZodString;
1846
+ range: z.ZodString;
1847
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
1848
+ }, z.core.$strip>;
1849
+ export type PluginProgramSpreadsheetMergeCellsArgs = z.infer<typeof PluginProgramSpreadsheetMergeCellsArgs>;
1850
+ /**
1851
+ * Result of {@linkcode PluginProgramSpreadsheetApi.mergeCells}.
1852
+ *
1853
+ * | Property | Type | Description |
1854
+ * |---|---|---|
1855
+ * | `sheetName` | `string` | The sheet that was merged |
1856
+ * | `range` | `string` | The range that was merged |
1857
+ */
1858
+ export declare const PluginProgramSpreadsheetMergeCellsResult: z.ZodObject<{
1859
+ sheetName: z.ZodString;
1860
+ range: z.ZodString;
1861
+ }, z.core.$strip>;
1862
+ export type PluginProgramSpreadsheetMergeCellsResult = z.infer<typeof PluginProgramSpreadsheetMergeCellsResult>;
1863
+ /** Conditional-formatting rule type. Currently only `dataBar`; more are reserved. */
1864
+ export declare const PluginSpreadsheetConditionalRuleType: z.ZodEnum<{
1865
+ dataBar: "dataBar";
1866
+ }>;
1867
+ export type PluginSpreadsheetConditionalRuleType = z.infer<typeof PluginSpreadsheetConditionalRuleType>;
1868
+ /**
1869
+ * A conditional-formatting rule for {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
1870
+ *
1871
+ * | Property | Type | Description |
1872
+ * |---|---|---|
1873
+ * | `type` | `"dataBar"` | The rule kind (a proportional in-cell bar) |
1874
+ * | `color` | `string?` | Bar color, CSS hex (a default is used when omitted) |
1875
+ */
1876
+ export declare const PluginSpreadsheetConditionalRule: z.ZodObject<{
1877
+ type: z.ZodEnum<{
1878
+ dataBar: "dataBar";
1879
+ }>;
1880
+ color: z.ZodOptional<z.ZodString>;
1881
+ }, z.core.$strip>;
1882
+ export type PluginSpreadsheetConditionalRule = z.infer<typeof PluginSpreadsheetConditionalRule>;
1883
+ /**
1884
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
1885
+ *
1886
+ * | Property | Type | Description |
1887
+ * |---|---|---|
1888
+ * | `sheetName` | `string` | Sheet containing the range |
1889
+ * | `range` | `string` | A1 range to format |
1890
+ * | `rule` | {@linkcode PluginSpreadsheetConditionalRule} | The conditional-format rule |
1891
+ */
1892
+ export declare const PluginProgramSpreadsheetAddConditionalFormattingArgs: z.ZodObject<{
1893
+ sheetName: z.ZodString;
1894
+ range: z.ZodString;
1895
+ rule: z.ZodObject<{
1896
+ type: z.ZodEnum<{
1897
+ dataBar: "dataBar";
1898
+ }>;
1899
+ color: z.ZodOptional<z.ZodString>;
1900
+ }, z.core.$strip>;
1901
+ }, z.core.$strip>;
1902
+ export type PluginProgramSpreadsheetAddConditionalFormattingArgs = z.infer<typeof PluginProgramSpreadsheetAddConditionalFormattingArgs>;
1903
+ /**
1904
+ * Result of {@linkcode PluginProgramSpreadsheetApi.addConditionalFormatting}.
1905
+ *
1906
+ * | Property | Type | Description |
1907
+ * |---|---|---|
1908
+ * | `sheetName` | `string` | The sheet that was formatted |
1909
+ * | `range` | `string` | The range the rule was applied to |
1910
+ * | `created` | `boolean` | Whether a data-bar rule was created (vs a fallback fill) |
1911
+ */
1912
+ export declare const PluginProgramSpreadsheetAddConditionalFormattingResult: z.ZodObject<{
1913
+ sheetName: z.ZodString;
1914
+ range: z.ZodString;
1915
+ created: z.ZodBoolean;
1916
+ }, z.core.$strip>;
1917
+ export type PluginProgramSpreadsheetAddConditionalFormattingResult = z.infer<typeof PluginProgramSpreadsheetAddConditionalFormattingResult>;
1918
+ /**
1919
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.recalculate}.
1920
+ *
1921
+ * | Property | Type | Description |
1922
+ * |---|---|---|
1923
+ * | `sheetName` | `string?` | A sheet to focus before recalculating; omit for the whole workbook |
1924
+ */
1925
+ export declare const PluginProgramSpreadsheetRecalculateArgs: z.ZodObject<{
1926
+ sheetName: z.ZodOptional<z.ZodString>;
1927
+ }, z.core.$strip>;
1928
+ export type PluginProgramSpreadsheetRecalculateArgs = z.infer<typeof PluginProgramSpreadsheetRecalculateArgs>;
1929
+ /**
1930
+ * Result of {@linkcode PluginProgramSpreadsheetApi.recalculate}.
1931
+ *
1932
+ * | Property | Type | Description |
1933
+ * |---|---|---|
1934
+ * | `scope` | `"sheet" \| "workbook"` | Whether a single sheet was focused or the whole workbook |
1935
+ * | `sheetName` | `string \| null` | The focused sheet, or `null` for a workbook-wide recompute |
1936
+ */
1937
+ export declare const PluginProgramSpreadsheetRecalculateResult: z.ZodObject<{
1938
+ scope: z.ZodEnum<{
1939
+ sheet: "sheet";
1940
+ workbook: "workbook";
1941
+ }>;
1942
+ sheetName: z.ZodNullable<z.ZodString>;
1943
+ }, z.core.$strip>;
1944
+ export type PluginProgramSpreadsheetRecalculateResult = z.infer<typeof PluginProgramSpreadsheetRecalculateResult>;
1945
+ /** A batchable operation name for {@linkcode PluginProgramSpreadsheetApi.transaction}. */
1946
+ export declare const PluginSpreadsheetTransactionMethod: z.ZodEnum<{
1947
+ createSheet: "createSheet";
1948
+ setValues: "setValues";
1949
+ setFormulas: "setFormulas";
1950
+ setStyles: "setStyles";
1951
+ mergeCells: "mergeCells";
1952
+ }>;
1953
+ export type PluginSpreadsheetTransactionMethod = z.infer<typeof PluginSpreadsheetTransactionMethod>;
1954
+ /**
1955
+ * One operation within a {@linkcode PluginProgramSpreadsheetApi.transaction}.
1956
+ *
1957
+ * | Property | Type | Description |
1958
+ * |---|---|---|
1959
+ * | `method` | {@linkcode PluginSpreadsheetTransactionMethod} | The batchable method to run |
1960
+ * | `args` | `unknown` | The `method`'s own arguments object |
1961
+ */
1962
+ export declare const PluginSpreadsheetTransactionOp: z.ZodObject<{
1963
+ method: z.ZodEnum<{
1964
+ createSheet: "createSheet";
1965
+ setValues: "setValues";
1966
+ setFormulas: "setFormulas";
1967
+ setStyles: "setStyles";
1968
+ mergeCells: "mergeCells";
1969
+ }>;
1970
+ args: z.ZodUnknown;
1971
+ }, z.core.$strip>;
1972
+ export type PluginSpreadsheetTransactionOp = z.infer<typeof PluginSpreadsheetTransactionOp>;
1973
+ /**
1974
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.transaction}.
1975
+ *
1976
+ * | Property | Type | Description |
1977
+ * |---|---|---|
1978
+ * | `operations` | {@linkcode PluginSpreadsheetTransactionOp}`[]` | The operations to run in order |
1979
+ * | `label` | `string?` | Undo-history label for the batch |
1980
+ */
1981
+ export declare const PluginProgramSpreadsheetTransactionArgs: z.ZodObject<{
1982
+ operations: z.ZodArray<z.ZodObject<{
1983
+ method: z.ZodEnum<{
1984
+ createSheet: "createSheet";
1985
+ setValues: "setValues";
1986
+ setFormulas: "setFormulas";
1987
+ setStyles: "setStyles";
1988
+ mergeCells: "mergeCells";
1989
+ }>;
1990
+ args: z.ZodUnknown;
1991
+ }, z.core.$strip>>;
1992
+ label: z.ZodOptional<z.ZodString>;
1993
+ }, z.core.$strip>;
1994
+ export type PluginProgramSpreadsheetTransactionArgs = z.infer<typeof PluginProgramSpreadsheetTransactionArgs>;
1995
+ /**
1996
+ * Result of {@linkcode PluginProgramSpreadsheetApi.transaction}.
1997
+ *
1998
+ * | Property | Type | Description |
1999
+ * |---|---|---|
2000
+ * | `label` | `string` | The undo-history label used |
2001
+ * | `operationCount` | `number` | Number of operations run |
2002
+ * | `results` | `unknown[]` | Each operation's result, in order |
2003
+ */
2004
+ export declare const PluginProgramSpreadsheetTransactionResult: z.ZodObject<{
2005
+ label: z.ZodString;
2006
+ operationCount: z.ZodNumber;
2007
+ results: z.ZodArray<z.ZodUnknown>;
2008
+ }, z.core.$strip>;
2009
+ export type PluginProgramSpreadsheetTransactionResult = z.infer<typeof PluginProgramSpreadsheetTransactionResult>;
2010
+ /**
2011
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.runScript}.
2012
+ *
2013
+ * | Property | Type | Description |
2014
+ * |---|---|---|
2015
+ * | `script` | `string` | Script source, run against a sandboxed `workbook` facade |
2016
+ */
2017
+ export declare const PluginProgramSpreadsheetRunScriptArgs: z.ZodObject<{
2018
+ script: z.ZodString;
2019
+ }, z.core.$strip>;
2020
+ export type PluginProgramSpreadsheetRunScriptArgs = z.infer<typeof PluginProgramSpreadsheetRunScriptArgs>;
2021
+ /**
2022
+ * Result of {@linkcode PluginProgramSpreadsheetApi.runScript}.
2023
+ *
2024
+ * | Property | Type | Description |
2025
+ * |---|---|---|
2026
+ * | `result` | `unknown` | The script's return value (`null` when it returns nothing) |
2027
+ */
2028
+ export declare const PluginProgramSpreadsheetRunScriptResult: z.ZodObject<{
2029
+ result: z.ZodUnknown;
2030
+ }, z.core.$strip>;
2031
+ export type PluginProgramSpreadsheetRunScriptResult = z.infer<typeof PluginProgramSpreadsheetRunScriptResult>;
2032
+ /** Status of an audit-log entry. */
2033
+ export declare const PluginSpreadsheetAuditStatus: z.ZodEnum<{
2034
+ error: "error";
2035
+ success: "success";
2036
+ }>;
2037
+ export type PluginSpreadsheetAuditStatus = z.infer<typeof PluginSpreadsheetAuditStatus>;
2038
+ /**
2039
+ * One entry in the program-spreadsheet audit log.
2040
+ *
2041
+ * | Property | Type | Description |
2042
+ * |---|---|---|
2043
+ * | `id` | `string` | Entry id |
2044
+ * | `pluginId` | `string` | Id of the plugin that performed the operation |
2045
+ * | `method` | `string` | The API method invoked |
2046
+ * | `label` | `string?` | Optional operation label |
2047
+ * | `sheetName` | `string?` | The sheet the operation targeted, if any |
2048
+ * | `timestamp` | `string` | ISO timestamp |
2049
+ * | `status` | `"success" \| "error"` | Whether the operation succeeded |
2050
+ * | `summary` | `string?` | Short human-readable summary |
2051
+ */
2052
+ export declare const PluginSpreadsheetAuditEntry: z.ZodObject<{
2053
+ id: z.ZodString;
2054
+ pluginId: z.ZodString;
2055
+ method: z.ZodString;
2056
+ label: z.ZodOptional<z.ZodString>;
2057
+ sheetName: z.ZodOptional<z.ZodString>;
2058
+ timestamp: z.ZodString;
2059
+ status: z.ZodEnum<{
2060
+ error: "error";
2061
+ success: "success";
2062
+ }>;
2063
+ summary: z.ZodOptional<z.ZodString>;
2064
+ }, z.core.$strip>;
2065
+ export type PluginSpreadsheetAuditEntry = z.infer<typeof PluginSpreadsheetAuditEntry>;
2066
+ /**
2067
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.getAuditLog}.
2068
+ *
2069
+ * | Property | Type | Description |
2070
+ * |---|---|---|
2071
+ * | `limit` | `number?` | Max entries to return (clamped 1–100, default 20) |
2072
+ */
2073
+ export declare const PluginProgramSpreadsheetGetAuditLogArgs: z.ZodObject<{
2074
+ limit: z.ZodOptional<z.ZodNumber>;
2075
+ }, z.core.$strip>;
2076
+ export type PluginProgramSpreadsheetGetAuditLogArgs = z.infer<typeof PluginProgramSpreadsheetGetAuditLogArgs>;
2077
+ /**
2078
+ * Result of {@linkcode PluginProgramSpreadsheetApi.getAuditLog}.
2079
+ *
2080
+ * | Property | Type | Description |
2081
+ * |---|---|---|
2082
+ * | `entries` | {@linkcode PluginSpreadsheetAuditEntry}`[]` | Recent audit entries, newest first |
2083
+ */
2084
+ export declare const PluginProgramSpreadsheetGetAuditLogResult: z.ZodObject<{
2085
+ entries: z.ZodArray<z.ZodObject<{
2086
+ id: z.ZodString;
2087
+ pluginId: z.ZodString;
2088
+ method: z.ZodString;
2089
+ label: z.ZodOptional<z.ZodString>;
2090
+ sheetName: z.ZodOptional<z.ZodString>;
2091
+ timestamp: z.ZodString;
2092
+ status: z.ZodEnum<{
2093
+ error: "error";
2094
+ success: "success";
2095
+ }>;
2096
+ summary: z.ZodOptional<z.ZodString>;
2097
+ }, z.core.$strip>>;
2098
+ }, z.core.$strip>;
2099
+ export type PluginProgramSpreadsheetGetAuditLogResult = z.infer<typeof PluginProgramSpreadsheetGetAuditLogResult>;
2100
+ /**
2101
+ * Result of {@linkcode PluginProgramSpreadsheetApi.ping}.
2102
+ *
2103
+ * | Property | Type | Description |
2104
+ * |---|---|---|
2105
+ * | `pong` | `boolean` | `true` when the program-mode spreadsheet bridge is reachable |
2106
+ */
2107
+ export declare const PluginProgramSpreadsheetPingResult: z.ZodObject<{
2108
+ pong: z.ZodBoolean;
2109
+ }, z.core.$strip>;
2110
+ export type PluginProgramSpreadsheetPingResult = z.infer<typeof PluginProgramSpreadsheetPingResult>;
2111
+ /** The visibility scope of a saved template. */
2112
+ export declare const PluginSpreadsheetTemplateScope: z.ZodEnum<{
2113
+ project: "project";
2114
+ global: "global";
2115
+ }>;
2116
+ export type PluginSpreadsheetTemplateScope = z.infer<typeof PluginSpreadsheetTemplateScope>;
2117
+ /**
2118
+ * Arguments for {@linkcode PluginProgramSpreadsheetTemplatesApi.create}.
2119
+ *
2120
+ * | Property | Type | Description |
2121
+ * |---|---|---|
2122
+ * | `name` | `string` | Template name (re-saving the same name overwrites it) |
2123
+ * | `sheetName` | `string` | The source sheet to capture |
2124
+ * | `scope` | `"project" \| "global"?` | Template scope (default `"project"`) |
2125
+ */
2126
+ export declare const PluginProgramSpreadsheetTemplatesCreateArgs: z.ZodObject<{
2127
+ name: z.ZodString;
2128
+ sheetName: z.ZodString;
2129
+ scope: z.ZodOptional<z.ZodEnum<{
2130
+ project: "project";
2131
+ global: "global";
2132
+ }>>;
2133
+ }, z.core.$strip>;
2134
+ export type PluginProgramSpreadsheetTemplatesCreateArgs = z.infer<typeof PluginProgramSpreadsheetTemplatesCreateArgs>;
2135
+ /**
2136
+ * Result of {@linkcode PluginProgramSpreadsheetTemplatesApi.create}.
2137
+ *
2138
+ * | Property | Type | Description |
2139
+ * |---|---|---|
2140
+ * | `id` | `string` | The new template's id |
2141
+ * | `name` | `string` | The template name |
2142
+ * | `scope` | `"project" \| "global"` | The template scope |
2143
+ * | `sheetName` | `string` | The source sheet captured |
2144
+ */
2145
+ export declare const PluginProgramSpreadsheetTemplatesCreateResult: z.ZodObject<{
2146
+ id: z.ZodString;
2147
+ name: z.ZodString;
2148
+ scope: z.ZodEnum<{
2149
+ project: "project";
2150
+ global: "global";
2151
+ }>;
2152
+ sheetName: z.ZodString;
2153
+ }, z.core.$strip>;
2154
+ export type PluginProgramSpreadsheetTemplatesCreateResult = z.infer<typeof PluginProgramSpreadsheetTemplatesCreateResult>;
2155
+ /**
2156
+ * Arguments for {@linkcode PluginProgramSpreadsheetTemplatesApi.apply}.
2157
+ *
2158
+ * | Property | Type | Description |
2159
+ * |---|---|---|
2160
+ * | `name` | `string` | The template to apply |
2161
+ * | `targetSheetName` | `string` | The sheet to create/replace from the template |
2162
+ */
2163
+ export declare const PluginProgramSpreadsheetTemplatesApplyArgs: z.ZodObject<{
2164
+ name: z.ZodString;
2165
+ targetSheetName: z.ZodString;
2166
+ }, z.core.$strip>;
2167
+ export type PluginProgramSpreadsheetTemplatesApplyArgs = z.infer<typeof PluginProgramSpreadsheetTemplatesApplyArgs>;
2168
+ /**
2169
+ * Result of {@linkcode PluginProgramSpreadsheetTemplatesApi.apply}.
2170
+ *
2171
+ * | Property | Type | Description |
2172
+ * |---|---|---|
2173
+ * | `name` | `string` | The template that was applied |
2174
+ * | `targetSheetName` | `string` | The sheet it was applied to |
2175
+ */
2176
+ export declare const PluginProgramSpreadsheetTemplatesApplyResult: z.ZodObject<{
2177
+ name: z.ZodString;
2178
+ targetSheetName: z.ZodString;
2179
+ }, z.core.$strip>;
2180
+ export type PluginProgramSpreadsheetTemplatesApplyResult = z.infer<typeof PluginProgramSpreadsheetTemplatesApplyResult>;
2181
+ /**
2182
+ * A binding's data source — the built-in takeoff dataset, or a named plugin
2183
+ * dataset stored via {@linkcode PluginProgramSpreadsheetDatasetsApi.set}.
2184
+ *
2185
+ * | Property | Type | Description |
2186
+ * |---|---|---|
2187
+ * | `dataset` | `"takeoff" \| "plugin"` | The dataset kind the binding pulls from |
2188
+ * | `name` | `string` | (`"plugin"` only) The stored dataset's name |
2189
+ */
2190
+ export declare const PluginSpreadsheetBindingSource: z.ZodDiscriminatedUnion<[z.ZodObject<{
2191
+ dataset: z.ZodLiteral<"takeoff">;
2192
+ }, z.core.$strip>, z.ZodObject<{
2193
+ dataset: z.ZodLiteral<"plugin">;
2194
+ name: z.ZodString;
2195
+ }, z.core.$strip>], "dataset">;
2196
+ export type PluginSpreadsheetBindingSource = z.infer<typeof PluginSpreadsheetBindingSource>;
2197
+ /** How a binding refresh writes into its target range. Currently only `replaceRange`. */
2198
+ export declare const PluginSpreadsheetBindingMode: z.ZodEnum<{
2199
+ replaceRange: "replaceRange";
2200
+ }>;
2201
+ export type PluginSpreadsheetBindingMode = z.infer<typeof PluginSpreadsheetBindingMode>;
2202
+ /**
2203
+ * A binding's target range, for {@linkcode PluginProgramSpreadsheetBindingsApi.create}.
2204
+ *
2205
+ * | Property | Type | Description |
2206
+ * |---|---|---|
2207
+ * | `sheetName` | `string` | The sheet to write into |
2208
+ * | `startCell` | `string?` | Top-left anchor in A1 notation (default `"A1"`) |
2209
+ */
2210
+ export declare const PluginSpreadsheetBindingTarget: z.ZodObject<{
2211
+ sheetName: z.ZodString;
2212
+ startCell: z.ZodOptional<z.ZodString>;
2213
+ }, z.core.$strip>;
2214
+ export type PluginSpreadsheetBindingTarget = z.infer<typeof PluginSpreadsheetBindingTarget>;
2215
+ /**
2216
+ * A stored data binding.
2217
+ *
2218
+ * | Property | Type | Description |
2219
+ * |---|---|---|
2220
+ * | `id` | `string` | Binding id |
2221
+ * | `name` | `string` | Binding name (unique per workbook) |
2222
+ * | `pluginId` | `string` | Id of the plugin that owns the binding |
2223
+ * | `source` | {@linkcode PluginSpreadsheetBindingSource} | The bound dataset |
2224
+ * | `target` | `{ sheetName: string; startCell: string }` | The resolved target range anchor |
2225
+ * | `mode` | {@linkcode PluginSpreadsheetBindingMode} | How a refresh writes into the target |
2226
+ * | `createdAt` | `string` | ISO creation timestamp |
2227
+ * | `updatedAt` | `string` | ISO last-refresh timestamp |
2228
+ */
2229
+ export declare const PluginSpreadsheetBinding: z.ZodObject<{
2230
+ id: z.ZodString;
2231
+ name: z.ZodString;
2232
+ pluginId: z.ZodString;
2233
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2234
+ dataset: z.ZodLiteral<"takeoff">;
2235
+ }, z.core.$strip>, z.ZodObject<{
2236
+ dataset: z.ZodLiteral<"plugin">;
2237
+ name: z.ZodString;
2238
+ }, z.core.$strip>], "dataset">;
2239
+ target: z.ZodObject<{
2240
+ sheetName: z.ZodString;
2241
+ startCell: z.ZodString;
2242
+ }, z.core.$strip>;
2243
+ mode: z.ZodEnum<{
2244
+ replaceRange: "replaceRange";
2245
+ }>;
2246
+ createdAt: z.ZodString;
2247
+ updatedAt: z.ZodString;
2248
+ }, z.core.$strip>;
2249
+ export type PluginSpreadsheetBinding = z.infer<typeof PluginSpreadsheetBinding>;
2250
+ /**
2251
+ * The outcome of refreshing a single binding.
2252
+ *
2253
+ * | Property | Type | Description |
2254
+ * |---|---|---|
2255
+ * | `id` | `string` | The refreshed binding's id |
2256
+ * | `name` | `string` | The refreshed binding's name |
2257
+ * | `sheetName` | `string` | The sheet that was rewritten |
2258
+ * | `rowCount` | `number` | Number of rows written |
2259
+ */
2260
+ export declare const PluginSpreadsheetBindingRefresh: z.ZodObject<{
2261
+ id: z.ZodString;
2262
+ name: z.ZodString;
2263
+ sheetName: z.ZodString;
2264
+ rowCount: z.ZodNumber;
2265
+ }, z.core.$strip>;
2266
+ export type PluginSpreadsheetBindingRefresh = z.infer<typeof PluginSpreadsheetBindingRefresh>;
2267
+ /**
2268
+ * Arguments for {@linkcode PluginProgramSpreadsheetBindingsApi.create}.
2269
+ *
2270
+ * | Property | Type | Description |
2271
+ * |---|---|---|
2272
+ * | `name` | `string` | Binding name (re-using a name overwrites it) |
2273
+ * | `source` | {@linkcode PluginSpreadsheetBindingSource} | The dataset to bind |
2274
+ * | `target` | {@linkcode PluginSpreadsheetBindingTarget} | The target sheet range |
2275
+ * | `mode` | {@linkcode PluginSpreadsheetBindingMode}`?` | How a refresh writes (default `"replaceRange"`) |
2276
+ */
2277
+ export declare const PluginProgramSpreadsheetBindingsCreateArgs: z.ZodObject<{
2278
+ name: z.ZodString;
2279
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2280
+ dataset: z.ZodLiteral<"takeoff">;
2281
+ }, z.core.$strip>, z.ZodObject<{
2282
+ dataset: z.ZodLiteral<"plugin">;
2283
+ name: z.ZodString;
2284
+ }, z.core.$strip>], "dataset">;
2285
+ target: z.ZodObject<{
2286
+ sheetName: z.ZodString;
2287
+ startCell: z.ZodOptional<z.ZodString>;
2288
+ }, z.core.$strip>;
2289
+ mode: z.ZodOptional<z.ZodEnum<{
2290
+ replaceRange: "replaceRange";
2291
+ }>>;
2292
+ }, z.core.$strip>;
2293
+ export type PluginProgramSpreadsheetBindingsCreateArgs = z.infer<typeof PluginProgramSpreadsheetBindingsCreateArgs>;
2294
+ /**
2295
+ * Result of {@linkcode PluginProgramSpreadsheetBindingsApi.create} — the stored
2296
+ * {@linkcode PluginSpreadsheetBinding} plus the initial `refresh` outcome.
2297
+ */
2298
+ export declare const PluginProgramSpreadsheetBindingsCreateResult: z.ZodObject<{
2299
+ id: z.ZodString;
2300
+ name: z.ZodString;
2301
+ pluginId: z.ZodString;
2302
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2303
+ dataset: z.ZodLiteral<"takeoff">;
2304
+ }, z.core.$strip>, z.ZodObject<{
2305
+ dataset: z.ZodLiteral<"plugin">;
2306
+ name: z.ZodString;
2307
+ }, z.core.$strip>], "dataset">;
2308
+ target: z.ZodObject<{
2309
+ sheetName: z.ZodString;
2310
+ startCell: z.ZodString;
2311
+ }, z.core.$strip>;
2312
+ mode: z.ZodEnum<{
2313
+ replaceRange: "replaceRange";
2314
+ }>;
2315
+ createdAt: z.ZodString;
2316
+ updatedAt: z.ZodString;
2317
+ refresh: z.ZodObject<{
2318
+ id: z.ZodString;
2319
+ name: z.ZodString;
2320
+ sheetName: z.ZodString;
2321
+ rowCount: z.ZodNumber;
2322
+ }, z.core.$strip>;
2323
+ }, z.core.$strip>;
2324
+ export type PluginProgramSpreadsheetBindingsCreateResult = z.infer<typeof PluginProgramSpreadsheetBindingsCreateResult>;
2325
+ /**
2326
+ * Arguments for {@linkcode PluginProgramSpreadsheetBindingsApi.refresh}.
2327
+ *
2328
+ * | Property | Type | Description |
2329
+ * |---|---|---|
2330
+ * | `name` | `string?` | The binding to refresh; omit to refresh every binding |
2331
+ */
2332
+ export declare const PluginProgramSpreadsheetBindingsRefreshArgs: z.ZodObject<{
2333
+ name: z.ZodOptional<z.ZodString>;
2334
+ }, z.core.$strip>;
2335
+ export type PluginProgramSpreadsheetBindingsRefreshArgs = z.infer<typeof PluginProgramSpreadsheetBindingsRefreshArgs>;
2336
+ /**
2337
+ * Result of {@linkcode PluginProgramSpreadsheetBindingsApi.refresh}.
2338
+ *
2339
+ * | Property | Type | Description |
2340
+ * |---|---|---|
2341
+ * | `refreshed` | {@linkcode PluginSpreadsheetBindingRefresh}`[]` | One entry per binding refreshed |
2342
+ */
2343
+ export declare const PluginProgramSpreadsheetBindingsRefreshResult: z.ZodObject<{
2344
+ refreshed: z.ZodArray<z.ZodObject<{
2345
+ id: z.ZodString;
2346
+ name: z.ZodString;
2347
+ sheetName: z.ZodString;
2348
+ rowCount: z.ZodNumber;
2349
+ }, z.core.$strip>>;
2350
+ }, z.core.$strip>;
2351
+ export type PluginProgramSpreadsheetBindingsRefreshResult = z.infer<typeof PluginProgramSpreadsheetBindingsRefreshResult>;
2352
+ /**
2353
+ * Result of {@linkcode PluginProgramSpreadsheetBindingsApi.list}.
2354
+ *
2355
+ * | Property | Type | Description |
2356
+ * |---|---|---|
2357
+ * | `bindings` | {@linkcode PluginSpreadsheetBinding}`[]` | Every stored binding |
2358
+ */
2359
+ export declare const PluginProgramSpreadsheetBindingsListResult: z.ZodObject<{
2360
+ bindings: z.ZodArray<z.ZodObject<{
2361
+ id: z.ZodString;
2362
+ name: z.ZodString;
2363
+ pluginId: z.ZodString;
2364
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2365
+ dataset: z.ZodLiteral<"takeoff">;
2366
+ }, z.core.$strip>, z.ZodObject<{
2367
+ dataset: z.ZodLiteral<"plugin">;
2368
+ name: z.ZodString;
2369
+ }, z.core.$strip>], "dataset">;
2370
+ target: z.ZodObject<{
2371
+ sheetName: z.ZodString;
2372
+ startCell: z.ZodString;
2373
+ }, z.core.$strip>;
2374
+ mode: z.ZodEnum<{
2375
+ replaceRange: "replaceRange";
2376
+ }>;
2377
+ createdAt: z.ZodString;
2378
+ updatedAt: z.ZodString;
2379
+ }, z.core.$strip>>;
2380
+ }, z.core.$strip>;
2381
+ export type PluginProgramSpreadsheetBindingsListResult = z.infer<typeof PluginProgramSpreadsheetBindingsListResult>;
2382
+ /**
2383
+ * Arguments for {@linkcode PluginProgramSpreadsheetDatasetsApi.set}.
2384
+ *
2385
+ * | Property | Type | Description |
2386
+ * |---|---|---|
2387
+ * | `name` | `string` | Dataset name (re-using a name overwrites it) |
2388
+ * | `columns` | {@linkcode PluginSpreadsheetColumn}`[]` | Column definitions (at least one) |
2389
+ * | `rows` | `Record<string, cell>[]` | Row objects keyed by column `key` (max 10,000) |
2390
+ */
2391
+ export declare const PluginProgramSpreadsheetDatasetsSetArgs: z.ZodObject<{
2392
+ name: z.ZodString;
2393
+ columns: z.ZodArray<z.ZodObject<{
2394
+ key: z.ZodString;
2395
+ header: z.ZodString;
2396
+ width: z.ZodOptional<z.ZodNumber>;
2397
+ format: z.ZodOptional<z.ZodString>;
2398
+ align: z.ZodOptional<z.ZodEnum<{
2399
+ center: "center";
2400
+ left: "left";
2401
+ right: "right";
2402
+ }>>;
2403
+ }, z.core.$strip>>;
2404
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2405
+ }, z.core.$strip>;
2406
+ export type PluginProgramSpreadsheetDatasetsSetArgs = z.infer<typeof PluginProgramSpreadsheetDatasetsSetArgs>;
2407
+ /**
2408
+ * Result of {@linkcode PluginProgramSpreadsheetDatasetsApi.set}.
2409
+ *
2410
+ * | Property | Type | Description |
2411
+ * |---|---|---|
2412
+ * | `name` | `string` | The stored dataset's name |
2413
+ * | `rowCount` | `number` | Number of rows stored |
2414
+ */
2415
+ export declare const PluginProgramSpreadsheetDatasetsSetResult: z.ZodObject<{
2416
+ name: z.ZodString;
2417
+ rowCount: z.ZodNumber;
2418
+ }, z.core.$strip>;
2419
+ export type PluginProgramSpreadsheetDatasetsSetResult = z.infer<typeof PluginProgramSpreadsheetDatasetsSetResult>;
2420
+ /**
2421
+ * A stored plugin dataset's summary, for
2422
+ * {@linkcode PluginProgramSpreadsheetDatasetsApi.list}.
2423
+ *
2424
+ * | Property | Type | Description |
2425
+ * |---|---|---|
2426
+ * | `name` | `string` | Dataset name |
2427
+ * | `rowCount` | `number` | Number of rows stored |
2428
+ * | `updatedAt` | `string` | ISO timestamp of the last `set` |
2429
+ */
2430
+ export declare const PluginSpreadsheetDataset: z.ZodObject<{
2431
+ name: z.ZodString;
2432
+ rowCount: z.ZodNumber;
2433
+ updatedAt: z.ZodString;
2434
+ }, z.core.$strip>;
2435
+ export type PluginSpreadsheetDataset = z.infer<typeof PluginSpreadsheetDataset>;
2436
+ /**
2437
+ * Result of {@linkcode PluginProgramSpreadsheetDatasetsApi.list}.
2438
+ *
2439
+ * | Property | Type | Description |
2440
+ * |---|---|---|
2441
+ * | `datasets` | {@linkcode PluginSpreadsheetDataset}`[]` | Every stored dataset |
2442
+ */
2443
+ export declare const PluginProgramSpreadsheetDatasetsListResult: z.ZodObject<{
2444
+ datasets: z.ZodArray<z.ZodObject<{
2445
+ name: z.ZodString;
2446
+ rowCount: z.ZodNumber;
2447
+ updatedAt: z.ZodString;
2448
+ }, z.core.$strip>>;
2449
+ }, z.core.$strip>;
2450
+ export type PluginProgramSpreadsheetDatasetsListResult = z.infer<typeof PluginProgramSpreadsheetDatasetsListResult>;
2451
+ /**
2452
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.addImage}.
2453
+ *
2454
+ * | Property | Type | Description |
2455
+ * |---|---|---|
2456
+ * | `sheetName` | `string` | Sheet to place the image on |
2457
+ * | `image` | `{ dataUri: string }` | Base64 `data:image/png\|jpeg\|svg+xml` URI (max 2 MB; URLs rejected) |
2458
+ * | `anchorCell` | `string?` | Anchor cell in A1 notation (default `"A1"`) |
2459
+ * | `size` | `{ width; height }?` | Size in px; intrinsic size when omitted |
2460
+ * | `name` | `string?` | Stable picture id — same name replaces on rerun; generated when omitted |
2461
+ */
2462
+ export declare const PluginProgramSpreadsheetAddImageArgs: z.ZodObject<{
2463
+ sheetName: z.ZodString;
2464
+ image: z.ZodObject<{
2465
+ dataUri: z.ZodString;
2466
+ }, z.core.$strip>;
2467
+ anchorCell: z.ZodOptional<z.ZodString>;
2468
+ size: z.ZodOptional<z.ZodObject<{
2469
+ width: z.ZodNumber;
2470
+ height: z.ZodNumber;
2471
+ }, z.core.$strip>>;
2472
+ name: z.ZodOptional<z.ZodString>;
2473
+ }, z.core.$strip>;
2474
+ export type PluginProgramSpreadsheetAddImageArgs = z.infer<typeof PluginProgramSpreadsheetAddImageArgs>;
2475
+ /**
2476
+ * Result of {@linkcode PluginProgramSpreadsheetApi.addImage}.
2477
+ *
2478
+ * | Property | Type | Description |
2479
+ * |---|---|---|
2480
+ * | `sheetName` | `string` | The sheet the image was placed on |
2481
+ * | `name` | `string` | The picture's (stable or generated) name |
2482
+ */
2483
+ export declare const PluginProgramSpreadsheetAddImageResult: z.ZodObject<{
2484
+ sheetName: z.ZodString;
2485
+ name: z.ZodString;
2486
+ }, z.core.$strip>;
2487
+ export type PluginProgramSpreadsheetAddImageResult = z.infer<typeof PluginProgramSpreadsheetAddImageResult>;
2488
+ /**
2489
+ * A custom program sheet's configuration — the grouped, data-bound program view
2490
+ * created by {@linkcode PluginProgramSpreadsheetApi.createCustomSheet}.
2491
+ *
2492
+ * | Property | Type | Description |
2493
+ * |---|---|---|
2494
+ * | `sheetName` | `string` | The sheet's name |
2495
+ * | `groupBy` | `string[]` | Group-by hierarchy, outermost first (property ids); `[]` when ungrouped |
2496
+ * | `properties` | `string[]` | Column property ids in column order (`""` marks an unassigned column) |
2497
+ * | `groupColors` | `Record<string, string>` | Property id → CSS hex fill of that level's group headers |
2498
+ * | `proposalId` | `string \| null` | The proposal the sheet belongs to, or `null` when the project has none |
2499
+ */
2500
+ export declare const PluginSpreadsheetCustomSheet: z.ZodObject<{
2501
+ sheetName: z.ZodString;
2502
+ groupBy: z.ZodArray<z.ZodString>;
2503
+ properties: z.ZodArray<z.ZodString>;
2504
+ groupColors: z.ZodRecord<z.ZodString, z.ZodString>;
2505
+ proposalId: z.ZodNullable<z.ZodString>;
2506
+ }, z.core.$strip>;
2507
+ export type PluginSpreadsheetCustomSheet = z.infer<typeof PluginSpreadsheetCustomSheet>;
2508
+ /**
2509
+ * The configurable part of a custom program sheet, for
2510
+ * {@linkcode PluginProgramSpreadsheetApi.createCustomSheet} /
2511
+ * {@linkcode PluginProgramSpreadsheetApi.updateCustomSheet}. All fields optional.
2512
+ *
2513
+ * | Property | Type | Description |
2514
+ * |---|---|---|
2515
+ * | `groupBy` | `string[]?` | Group-by hierarchy, outermost first (property ids) |
2516
+ * | `properties` | `string[]?` | Column property ids, in order |
2517
+ * | `groupColors` | `Record<string, string>?` | Property id → CSS hex fill for that level's group headers |
2518
+ */
2519
+ export declare const PluginSpreadsheetCustomSheetConfig: z.ZodObject<{
2520
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
2521
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
2522
+ groupColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2523
+ }, z.core.$strip>;
2524
+ export type PluginSpreadsheetCustomSheetConfig = z.infer<typeof PluginSpreadsheetCustomSheetConfig>;
2525
+ /**
2526
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.createCustomSheet}.
2527
+ *
2528
+ * | Property | Type | Description |
2529
+ * |---|---|---|
2530
+ * | `name` | `string` | The sheet name to create |
2531
+ * | `groupBy` / `properties` / `groupColors` | — | See {@linkcode PluginSpreadsheetCustomSheetConfig} |
2532
+ */
2533
+ export declare const PluginProgramSpreadsheetCreateCustomSheetArgs: z.ZodObject<{
2534
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
2535
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
2536
+ groupColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2537
+ name: z.ZodString;
2538
+ }, z.core.$strip>;
2539
+ export type PluginProgramSpreadsheetCreateCustomSheetArgs = z.infer<typeof PluginProgramSpreadsheetCreateCustomSheetArgs>;
2540
+ /**
2541
+ * Arguments for {@linkcode PluginProgramSpreadsheetApi.updateCustomSheet}.
2542
+ *
2543
+ * | Property | Type | Description |
2544
+ * |---|---|---|
2545
+ * | `sheetName` | `string` | The custom sheet to update |
2546
+ * | `groupBy` / `properties` / `groupColors` | — | Sparse; see {@linkcode PluginSpreadsheetCustomSheetConfig} |
2547
+ */
2548
+ export declare const PluginProgramSpreadsheetUpdateCustomSheetArgs: z.ZodObject<{
2549
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
2550
+ properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
2551
+ groupColors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2552
+ sheetName: z.ZodString;
2553
+ }, z.core.$strip>;
2554
+ export type PluginProgramSpreadsheetUpdateCustomSheetArgs = z.infer<typeof PluginProgramSpreadsheetUpdateCustomSheetArgs>;
2555
+ /** Result of `createCustomSheet` / `updateCustomSheet` — the sheet's configuration. */
2556
+ export declare const PluginProgramSpreadsheetCustomSheetResult: z.ZodObject<{
2557
+ sheetName: z.ZodString;
2558
+ groupBy: z.ZodArray<z.ZodString>;
2559
+ properties: z.ZodArray<z.ZodString>;
2560
+ groupColors: z.ZodRecord<z.ZodString, z.ZodString>;
2561
+ proposalId: z.ZodNullable<z.ZodString>;
2562
+ }, z.core.$strip>;
2563
+ export type PluginProgramSpreadsheetCustomSheetResult = z.infer<typeof PluginProgramSpreadsheetCustomSheetResult>;
2564
+ /** Arguments for {@linkcode PluginProgramSpreadsheetApi.getCustomSheet}. */
2565
+ export declare const PluginProgramSpreadsheetGetCustomSheetArgs: z.ZodObject<{
2566
+ sheetName: z.ZodString;
2567
+ }, z.core.$strip>;
2568
+ export type PluginProgramSpreadsheetGetCustomSheetArgs = z.infer<typeof PluginProgramSpreadsheetGetCustomSheetArgs>;
2569
+ /** Result of {@linkcode PluginProgramSpreadsheetApi.getCustomSheet} — the configuration, or `null`. */
2570
+ export declare const PluginProgramSpreadsheetGetCustomSheetResult: z.ZodNullable<z.ZodObject<{
2571
+ sheetName: z.ZodString;
2572
+ groupBy: z.ZodArray<z.ZodString>;
2573
+ properties: z.ZodArray<z.ZodString>;
2574
+ groupColors: z.ZodRecord<z.ZodString, z.ZodString>;
2575
+ proposalId: z.ZodNullable<z.ZodString>;
2576
+ }, z.core.$strip>>;
2577
+ export type PluginProgramSpreadsheetGetCustomSheetResult = z.infer<typeof PluginProgramSpreadsheetGetCustomSheetResult>;
2578
+ /**
2579
+ * Result of {@linkcode PluginProgramSpreadsheetApi.listCustomSheets}.
2580
+ *
2581
+ * | Property | Type | Description |
2582
+ * |---|---|---|
2583
+ * | `sheets` | {@linkcode PluginSpreadsheetCustomSheet}`[]` | Every custom program sheet |
2584
+ */
2585
+ export declare const PluginProgramSpreadsheetListCustomSheetsResult: z.ZodObject<{
2586
+ sheets: z.ZodArray<z.ZodObject<{
2587
+ sheetName: z.ZodString;
2588
+ groupBy: z.ZodArray<z.ZodString>;
2589
+ properties: z.ZodArray<z.ZodString>;
2590
+ groupColors: z.ZodRecord<z.ZodString, z.ZodString>;
2591
+ proposalId: z.ZodNullable<z.ZodString>;
2592
+ }, z.core.$strip>>;
2593
+ }, z.core.$strip>;
2594
+ export type PluginProgramSpreadsheetListCustomSheetsResult = z.infer<typeof PluginProgramSpreadsheetListCustomSheetsResult>;
2595
+ /**
2596
+ * A property a custom program sheet can show or group by.
2597
+ *
2598
+ * | Property | Type | Description |
2599
+ * |---|---|---|
2600
+ * | `id` | `string` | Property id (built-in key, or a metadata `headerId`) |
2601
+ * | `name` | `string` | Display name |
2602
+ * | `groupable` | `boolean` | Whether the sheet can group by it |
2603
+ * | `custom` | `boolean` | `true` for program metadata headers, `false` for built-ins |
2604
+ */
2605
+ export declare const PluginSpreadsheetCustomSheetProperty: z.ZodObject<{
2606
+ id: z.ZodString;
2607
+ name: z.ZodString;
2608
+ groupable: z.ZodBoolean;
2609
+ custom: z.ZodBoolean;
2610
+ }, z.core.$strip>;
2611
+ export type PluginSpreadsheetCustomSheetProperty = z.infer<typeof PluginSpreadsheetCustomSheetProperty>;
2612
+ /**
2613
+ * Result of {@linkcode PluginProgramSpreadsheetApi.listCustomSheetProperties}.
2614
+ *
2615
+ * | Property | Type | Description |
2616
+ * |---|---|---|
2617
+ * | `properties` | {@linkcode PluginSpreadsheetCustomSheetProperty}`[]` | Built-ins first, then metadata headers |
2618
+ */
2619
+ export declare const PluginProgramSpreadsheetListCustomSheetPropertiesResult: z.ZodObject<{
2620
+ properties: z.ZodArray<z.ZodObject<{
2621
+ id: z.ZodString;
2622
+ name: z.ZodString;
2623
+ groupable: z.ZodBoolean;
2624
+ custom: z.ZodBoolean;
2625
+ }, z.core.$strip>>;
2626
+ }, z.core.$strip>;
2627
+ export type PluginProgramSpreadsheetListCustomSheetPropertiesResult = z.infer<typeof PluginProgramSpreadsheetListCustomSheetPropertiesResult>;
2628
+ //# sourceMappingURL=spreadsheet.d.ts.map