@trebco/treb 36.1.4 → 37.0.1

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 (552) hide show
  1. package/api-config.json +1 -1
  2. package/build/package.json +119 -0
  3. package/build/treb-base-types/src/api_types.d.ts +11 -0
  4. package/build/treb-base-types/src/api_types.js +22 -0
  5. package/build/treb-base-types/src/api_types.js.map +1 -0
  6. package/build/treb-base-types/src/area-utils.d.ts +9 -0
  7. package/build/treb-base-types/src/area-utils.js +50 -0
  8. package/build/treb-base-types/src/area-utils.js.map +1 -0
  9. package/build/treb-base-types/src/area.d.ts +182 -0
  10. package/build/treb-base-types/src/area.js +715 -0
  11. package/build/treb-base-types/src/area.js.map +1 -0
  12. package/build/treb-base-types/src/basic_types.d.ts +20 -0
  13. package/build/treb-base-types/src/basic_types.js +22 -0
  14. package/build/treb-base-types/src/basic_types.js.map +1 -0
  15. package/build/treb-base-types/src/cell.d.ts +167 -0
  16. package/build/treb-base-types/src/cell.js +432 -0
  17. package/build/treb-base-types/src/cell.js.map +1 -0
  18. package/build/treb-base-types/src/cells.d.ts +251 -0
  19. package/build/treb-base-types/src/cells.js +1136 -0
  20. package/build/treb-base-types/src/cells.js.map +1 -0
  21. package/build/treb-base-types/src/color.d.ts +35 -0
  22. package/build/treb-base-types/src/color.js +162 -0
  23. package/build/treb-base-types/src/color.js.map +1 -0
  24. package/build/treb-base-types/src/dom-utilities.d.ts +70 -0
  25. package/build/treb-base-types/src/dom-utilities.js +144 -0
  26. package/build/treb-base-types/src/dom-utilities.js.map +1 -0
  27. package/build/treb-base-types/src/evaluate-options.d.ts +35 -0
  28. package/build/treb-base-types/src/evaluate-options.js +22 -0
  29. package/build/treb-base-types/src/evaluate-options.js.map +1 -0
  30. package/build/treb-base-types/src/font-stack.d.ts +37 -0
  31. package/build/treb-base-types/src/font-stack.js +93 -0
  32. package/build/treb-base-types/src/font-stack.js.map +1 -0
  33. package/build/treb-base-types/src/gradient.d.ts +18 -0
  34. package/build/treb-base-types/src/gradient.js +86 -0
  35. package/build/treb-base-types/src/gradient.js.map +1 -0
  36. package/build/treb-base-types/src/import.d.ts +48 -0
  37. package/build/treb-base-types/src/import.js +22 -0
  38. package/build/treb-base-types/src/import.js.map +1 -0
  39. package/build/treb-base-types/src/index-standalone.d.ts +6 -0
  40. package/build/treb-base-types/src/index-standalone.js +27 -0
  41. package/build/treb-base-types/src/index-standalone.js.map +1 -0
  42. package/build/treb-base-types/src/index.d.ts +22 -0
  43. package/build/treb-base-types/src/index.js +45 -0
  44. package/build/treb-base-types/src/index.js.map +1 -0
  45. package/build/treb-base-types/src/layout.d.ts +22 -0
  46. package/build/treb-base-types/src/layout.js +22 -0
  47. package/build/treb-base-types/src/layout.js.map +1 -0
  48. package/build/treb-base-types/src/localization.d.ts +37 -0
  49. package/build/treb-base-types/src/localization.js +157 -0
  50. package/build/treb-base-types/src/localization.js.map +1 -0
  51. package/build/treb-base-types/src/rectangle.d.ts +51 -0
  52. package/build/treb-base-types/src/rectangle.js +123 -0
  53. package/build/treb-base-types/src/rectangle.js.map +1 -0
  54. package/build/treb-base-types/src/render_text.d.ts +34 -0
  55. package/build/treb-base-types/src/render_text.js +22 -0
  56. package/build/treb-base-types/src/render_text.js.map +1 -0
  57. package/build/treb-base-types/src/style.d.ts +214 -0
  58. package/build/treb-base-types/src/style.js +373 -0
  59. package/build/treb-base-types/src/style.js.map +1 -0
  60. package/build/treb-base-types/src/table.d.ts +58 -0
  61. package/build/treb-base-types/src/table.js +27 -0
  62. package/build/treb-base-types/src/table.js.map +1 -0
  63. package/build/treb-base-types/src/text_part.d.ts +26 -0
  64. package/build/treb-base-types/src/text_part.js +47 -0
  65. package/build/treb-base-types/src/text_part.js.map +1 -0
  66. package/build/treb-base-types/src/theme.d.ts +120 -0
  67. package/build/treb-base-types/src/theme.js +460 -0
  68. package/build/treb-base-types/src/theme.js.map +1 -0
  69. package/build/treb-base-types/src/union.d.ts +73 -0
  70. package/build/treb-base-types/src/union.js +61 -0
  71. package/build/treb-base-types/src/union.js.map +1 -0
  72. package/build/treb-base-types/src/value-type.d.ts +86 -0
  73. package/build/treb-base-types/src/value-type.js +168 -0
  74. package/build/treb-base-types/src/value-type.js.map +1 -0
  75. package/build/treb-base-types/src/worker-proxy.d.ts +95 -0
  76. package/build/treb-base-types/src/worker-proxy.js +221 -0
  77. package/build/treb-base-types/src/worker-proxy.js.map +1 -0
  78. package/build/treb-calculator/src/calculator.d.ts +249 -0
  79. package/build/treb-calculator/src/calculator.js +2755 -0
  80. package/build/treb-calculator/src/calculator.js.map +1 -0
  81. package/build/treb-calculator/src/complex-math.d.ts +75 -0
  82. package/build/treb-calculator/src/complex-math.js +559 -0
  83. package/build/treb-calculator/src/complex-math.js.map +1 -0
  84. package/build/treb-calculator/src/dag/array-vertex.d.ts +71 -0
  85. package/build/treb-calculator/src/dag/array-vertex.js +156 -0
  86. package/build/treb-calculator/src/dag/array-vertex.js.map +1 -0
  87. package/build/treb-calculator/src/dag/calculation_leaf_vertex.d.ts +48 -0
  88. package/build/treb-calculator/src/dag/calculation_leaf_vertex.js +84 -0
  89. package/build/treb-calculator/src/dag/calculation_leaf_vertex.js.map +1 -0
  90. package/build/treb-calculator/src/dag/graph.d.ts +134 -0
  91. package/build/treb-calculator/src/dag/graph.js +842 -0
  92. package/build/treb-calculator/src/dag/graph.js.map +1 -0
  93. package/build/treb-calculator/src/dag/spreadsheet_vertex.d.ts +58 -0
  94. package/build/treb-calculator/src/dag/spreadsheet_vertex.js +232 -0
  95. package/build/treb-calculator/src/dag/spreadsheet_vertex.js.map +1 -0
  96. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.d.ts +20 -0
  97. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js +25 -0
  98. package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js.map +1 -0
  99. package/build/treb-calculator/src/dag/state_leaf_vertex.d.ts +43 -0
  100. package/build/treb-calculator/src/dag/state_leaf_vertex.js +81 -0
  101. package/build/treb-calculator/src/dag/state_leaf_vertex.js.map +1 -0
  102. package/build/treb-calculator/src/dag/vertex.d.ts +71 -0
  103. package/build/treb-calculator/src/dag/vertex.js +274 -0
  104. package/build/treb-calculator/src/dag/vertex.js.map +1 -0
  105. package/build/treb-calculator/src/descriptors.d.ts +189 -0
  106. package/build/treb-calculator/src/descriptors.js +22 -0
  107. package/build/treb-calculator/src/descriptors.js.map +1 -0
  108. package/build/treb-calculator/src/expression-calculator.d.ts +127 -0
  109. package/build/treb-calculator/src/expression-calculator.js +1033 -0
  110. package/build/treb-calculator/src/expression-calculator.js.map +1 -0
  111. package/build/treb-calculator/src/function-error.d.ts +35 -0
  112. package/build/treb-calculator/src/function-error.js +85 -0
  113. package/build/treb-calculator/src/function-error.js.map +1 -0
  114. package/build/treb-calculator/src/function-library.d.ts +22 -0
  115. package/build/treb-calculator/src/function-library.js +96 -0
  116. package/build/treb-calculator/src/function-library.js.map +1 -0
  117. package/build/treb-calculator/src/functions/base-functions.d.ts +7 -0
  118. package/build/treb-calculator/src/functions/base-functions.js +2611 -0
  119. package/build/treb-calculator/src/functions/base-functions.js.map +1 -0
  120. package/build/treb-calculator/src/functions/beta.d.ts +17 -0
  121. package/build/treb-calculator/src/functions/beta.js +201 -0
  122. package/build/treb-calculator/src/functions/beta.js.map +1 -0
  123. package/build/treb-calculator/src/functions/checkbox.d.ts +3 -0
  124. package/build/treb-calculator/src/functions/checkbox.js +128 -0
  125. package/build/treb-calculator/src/functions/checkbox.js.map +1 -0
  126. package/build/treb-calculator/src/functions/complex-functions.d.ts +2 -0
  127. package/build/treb-calculator/src/functions/complex-functions.js +217 -0
  128. package/build/treb-calculator/src/functions/complex-functions.js.map +1 -0
  129. package/build/treb-calculator/src/functions/date-utils.d.ts +3 -0
  130. package/build/treb-calculator/src/functions/date-utils.js +59 -0
  131. package/build/treb-calculator/src/functions/date-utils.js.map +1 -0
  132. package/build/treb-calculator/src/functions/finance-functions.d.ts +2 -0
  133. package/build/treb-calculator/src/functions/finance-functions.js +547 -0
  134. package/build/treb-calculator/src/functions/finance-functions.js.map +1 -0
  135. package/build/treb-calculator/src/functions/fp.d.ts +2 -0
  136. package/build/treb-calculator/src/functions/fp.js +463 -0
  137. package/build/treb-calculator/src/functions/fp.js.map +1 -0
  138. package/build/treb-calculator/src/functions/function-utilities.d.ts +2 -0
  139. package/build/treb-calculator/src/functions/function-utilities.js +36 -0
  140. package/build/treb-calculator/src/functions/function-utilities.js.map +1 -0
  141. package/build/treb-calculator/src/functions/gamma.d.ts +20 -0
  142. package/build/treb-calculator/src/functions/gamma.js +142 -0
  143. package/build/treb-calculator/src/functions/gamma.js.map +1 -0
  144. package/build/treb-calculator/src/functions/information-functions.d.ts +2 -0
  145. package/build/treb-calculator/src/functions/information-functions.js +71 -0
  146. package/build/treb-calculator/src/functions/information-functions.js.map +1 -0
  147. package/build/treb-calculator/src/functions/lambda-functions.d.ts +2 -0
  148. package/build/treb-calculator/src/functions/lambda-functions.js +85 -0
  149. package/build/treb-calculator/src/functions/lambda-functions.js.map +1 -0
  150. package/build/treb-calculator/src/functions/matrix-functions.d.ts +2 -0
  151. package/build/treb-calculator/src/functions/matrix-functions.js +144 -0
  152. package/build/treb-calculator/src/functions/matrix-functions.js.map +1 -0
  153. package/build/treb-calculator/src/functions/normal.d.ts +2 -0
  154. package/build/treb-calculator/src/functions/normal.js +32 -0
  155. package/build/treb-calculator/src/functions/normal.js.map +1 -0
  156. package/build/treb-calculator/src/functions/regex-functions.d.ts +2 -0
  157. package/build/treb-calculator/src/functions/regex-functions.js +188 -0
  158. package/build/treb-calculator/src/functions/regex-functions.js.map +1 -0
  159. package/build/treb-calculator/src/functions/sparkline.d.ts +37 -0
  160. package/build/treb-calculator/src/functions/sparkline.js +264 -0
  161. package/build/treb-calculator/src/functions/sparkline.js.map +1 -0
  162. package/build/treb-calculator/src/functions/statistics-functions.d.ts +6 -0
  163. package/build/treb-calculator/src/functions/statistics-functions.js +989 -0
  164. package/build/treb-calculator/src/functions/statistics-functions.js.map +1 -0
  165. package/build/treb-calculator/src/functions/students-t.d.ts +3 -0
  166. package/build/treb-calculator/src/functions/students-t.js +64 -0
  167. package/build/treb-calculator/src/functions/students-t.js.map +1 -0
  168. package/build/treb-calculator/src/functions/text-functions.d.ts +3 -0
  169. package/build/treb-calculator/src/functions/text-functions.js +320 -0
  170. package/build/treb-calculator/src/functions/text-functions.js.map +1 -0
  171. package/build/treb-calculator/src/index.d.ts +2 -0
  172. package/build/treb-calculator/src/index.js +22 -0
  173. package/build/treb-calculator/src/index.js.map +1 -0
  174. package/build/treb-calculator/src/notifier-types.d.ts +26 -0
  175. package/build/treb-calculator/src/notifier-types.js +22 -0
  176. package/build/treb-calculator/src/notifier-types.js.map +1 -0
  177. package/build/treb-calculator/src/primitives.d.ts +15 -0
  178. package/build/treb-calculator/src/primitives.js +398 -0
  179. package/build/treb-calculator/src/primitives.js.map +1 -0
  180. package/build/treb-calculator/src/utilities.d.ts +68 -0
  181. package/build/treb-calculator/src/utilities.js +324 -0
  182. package/build/treb-calculator/src/utilities.js.map +1 -0
  183. package/build/treb-charts/src/chart-functions.d.ts +8 -0
  184. package/build/treb-charts/src/chart-functions.js +209 -0
  185. package/build/treb-charts/src/chart-functions.js.map +1 -0
  186. package/build/treb-charts/src/chart-types.d.ts +233 -0
  187. package/build/treb-charts/src/chart-types.js +57 -0
  188. package/build/treb-charts/src/chart-types.js.map +1 -0
  189. package/build/treb-charts/src/chart-utils.d.ts +106 -0
  190. package/build/treb-charts/src/chart-utils.js +1060 -0
  191. package/build/treb-charts/src/chart-utils.js.map +1 -0
  192. package/build/treb-charts/src/chart.d.ts +23 -0
  193. package/build/treb-charts/src/chart.js +94 -0
  194. package/build/treb-charts/src/chart.js.map +1 -0
  195. package/build/treb-charts/src/default-chart-renderer.d.ts +16 -0
  196. package/build/treb-charts/src/default-chart-renderer.js +533 -0
  197. package/build/treb-charts/src/default-chart-renderer.js.map +1 -0
  198. package/build/treb-charts/src/index.d.ts +5 -0
  199. package/build/treb-charts/src/index.js +24 -0
  200. package/build/treb-charts/src/index.js.map +1 -0
  201. package/build/treb-charts/src/main.d.ts +1 -0
  202. package/build/treb-charts/src/main.js +34 -0
  203. package/build/treb-charts/src/main.js.map +1 -0
  204. package/build/treb-charts/src/quicksort.d.ts +1 -0
  205. package/build/treb-charts/src/quicksort.js +49 -0
  206. package/build/treb-charts/src/quicksort.js.map +1 -0
  207. package/build/treb-charts/src/rectangle.d.ts +18 -0
  208. package/build/treb-charts/src/rectangle.js +41 -0
  209. package/build/treb-charts/src/rectangle.js.map +1 -0
  210. package/build/treb-charts/src/renderer-type.d.ts +24 -0
  211. package/build/treb-charts/src/renderer-type.js +22 -0
  212. package/build/treb-charts/src/renderer-type.js.map +1 -0
  213. package/build/treb-charts/src/renderer.d.ts +127 -0
  214. package/build/treb-charts/src/renderer.js +1518 -0
  215. package/build/treb-charts/src/renderer.js.map +1 -0
  216. package/build/treb-charts/src/util.d.ts +18 -0
  217. package/build/treb-charts/src/util.js +71 -0
  218. package/build/treb-charts/src/util.js.map +1 -0
  219. package/build/treb-data-model/src/annotation.d.ts +167 -0
  220. package/build/treb-data-model/src/annotation.js +120 -0
  221. package/build/treb-data-model/src/annotation.js.map +1 -0
  222. package/build/treb-data-model/src/conditional_format.d.ts +155 -0
  223. package/build/treb-data-model/src/conditional_format.js +62 -0
  224. package/build/treb-data-model/src/conditional_format.js.map +1 -0
  225. package/build/treb-data-model/src/data-validation.d.ts +28 -0
  226. package/build/treb-data-model/src/data-validation.js +22 -0
  227. package/build/treb-data-model/src/data-validation.js.map +1 -0
  228. package/build/treb-data-model/src/data_model.d.ts +173 -0
  229. package/build/treb-data-model/src/data_model.js +637 -0
  230. package/build/treb-data-model/src/data_model.js.map +1 -0
  231. package/build/treb-data-model/src/index.d.ts +13 -0
  232. package/build/treb-data-model/src/index.js +28 -0
  233. package/build/treb-data-model/src/index.js.map +1 -0
  234. package/build/treb-data-model/src/language-model.d.ts +22 -0
  235. package/build/treb-data-model/src/language-model.js +22 -0
  236. package/build/treb-data-model/src/language-model.js.map +1 -0
  237. package/build/treb-data-model/src/named.d.ts +124 -0
  238. package/build/treb-data-model/src/named.js +372 -0
  239. package/build/treb-data-model/src/named.js.map +1 -0
  240. package/build/treb-data-model/src/serialize_options.d.ts +49 -0
  241. package/build/treb-data-model/src/serialize_options.js +22 -0
  242. package/build/treb-data-model/src/serialize_options.js.map +1 -0
  243. package/build/treb-data-model/src/sheet.d.ts +499 -0
  244. package/build/treb-data-model/src/sheet.js +2904 -0
  245. package/build/treb-data-model/src/sheet.js.map +1 -0
  246. package/build/treb-data-model/src/sheet_collection.d.ts +58 -0
  247. package/build/treb-data-model/src/sheet_collection.js +112 -0
  248. package/build/treb-data-model/src/sheet_collection.js.map +1 -0
  249. package/build/treb-data-model/src/sheet_selection.d.ts +42 -0
  250. package/build/treb-data-model/src/sheet_selection.js +39 -0
  251. package/build/treb-data-model/src/sheet_selection.js.map +1 -0
  252. package/build/treb-data-model/src/sheet_types.d.ts +104 -0
  253. package/build/treb-data-model/src/sheet_types.js +22 -0
  254. package/build/treb-data-model/src/sheet_types.js.map +1 -0
  255. package/build/treb-data-model/src/types.d.ts +59 -0
  256. package/build/treb-data-model/src/types.js +22 -0
  257. package/build/treb-data-model/src/types.js.map +1 -0
  258. package/build/treb-embed/src/custom-element/spreadsheet-constructor.d.ts +75 -0
  259. package/build/treb-embed/src/custom-element/spreadsheet-constructor.js +1144 -0
  260. package/build/treb-embed/src/custom-element/spreadsheet-constructor.js.map +1 -0
  261. package/build/treb-embed/src/custom-element/treb-global.d.ts +36 -0
  262. package/build/treb-embed/src/custom-element/treb-global.js +64 -0
  263. package/build/treb-embed/src/custom-element/treb-global.js.map +1 -0
  264. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.d.ts +1 -0
  265. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js +61 -0
  266. package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js.map +1 -0
  267. package/build/treb-embed/src/embedded-spreadsheet.d.ts +1358 -0
  268. package/build/treb-embed/src/embedded-spreadsheet.js +5205 -0
  269. package/build/treb-embed/src/embedded-spreadsheet.js.map +1 -0
  270. package/build/treb-embed/src/index.d.ts +12 -0
  271. package/build/treb-embed/src/index.js +34 -0
  272. package/build/treb-embed/src/index.js.map +1 -0
  273. package/build/treb-embed/src/options.d.ts +266 -0
  274. package/build/treb-embed/src/options.js +56 -0
  275. package/build/treb-embed/src/options.js.map +1 -0
  276. package/build/treb-embed/src/plugin.d.ts +9 -0
  277. package/build/treb-embed/src/plugin.js +22 -0
  278. package/build/treb-embed/src/plugin.js.map +1 -0
  279. package/build/treb-embed/src/progress-dialog.d.ts +49 -0
  280. package/build/treb-embed/src/progress-dialog.js +178 -0
  281. package/build/treb-embed/src/progress-dialog.js.map +1 -0
  282. package/build/treb-embed/src/selection-state.d.ts +15 -0
  283. package/build/treb-embed/src/selection-state.js +22 -0
  284. package/build/treb-embed/src/selection-state.js.map +1 -0
  285. package/build/treb-embed/src/spinner.d.ts +8 -0
  286. package/build/treb-embed/src/spinner.js +40 -0
  287. package/build/treb-embed/src/spinner.js.map +1 -0
  288. package/build/treb-embed/src/toolbar-message.d.ts +72 -0
  289. package/build/treb-embed/src/toolbar-message.js +22 -0
  290. package/build/treb-embed/src/toolbar-message.js.map +1 -0
  291. package/build/treb-embed/src/types.d.ts +185 -0
  292. package/build/treb-embed/src/types.js +45 -0
  293. package/build/treb-embed/src/types.js.map +1 -0
  294. package/build/treb-embed/tsconfig.tsbuildinfo +1 -0
  295. package/build/treb-export/src/address-type.d.ts +34 -0
  296. package/build/treb-export/src/address-type.js +53 -0
  297. package/build/treb-export/src/address-type.js.map +1 -0
  298. package/build/treb-export/src/base-template.d.ts +1 -0
  299. package/build/treb-export/src/base-template.js +22 -0
  300. package/build/treb-export/src/base-template.js.map +1 -0
  301. package/build/treb-export/src/column-width.d.ts +2 -0
  302. package/build/treb-export/src/column-width.js +80 -0
  303. package/build/treb-export/src/column-width.js.map +1 -0
  304. package/build/treb-export/src/drawing/bubble-chart-template.d.ts +514 -0
  305. package/build/treb-export/src/drawing/bubble-chart-template.js +544 -0
  306. package/build/treb-export/src/drawing/bubble-chart-template.js.map +1 -0
  307. package/build/treb-export/src/drawing/chart-template-components2.d.ts +365 -0
  308. package/build/treb-export/src/drawing/chart-template-components2.js +386 -0
  309. package/build/treb-export/src/drawing/chart-template-components2.js.map +1 -0
  310. package/build/treb-export/src/drawing/chart.d.ts +26 -0
  311. package/build/treb-export/src/drawing/chart.js +247 -0
  312. package/build/treb-export/src/drawing/chart.js.map +1 -0
  313. package/build/treb-export/src/drawing/column-chart-template2.d.ts +490 -0
  314. package/build/treb-export/src/drawing/column-chart-template2.js +518 -0
  315. package/build/treb-export/src/drawing/column-chart-template2.js.map +1 -0
  316. package/build/treb-export/src/drawing/donut-chart-template2.d.ts +272 -0
  317. package/build/treb-export/src/drawing/donut-chart-template2.js +293 -0
  318. package/build/treb-export/src/drawing/donut-chart-template2.js.map +1 -0
  319. package/build/treb-export/src/drawing/drawing.d.ts +49 -0
  320. package/build/treb-export/src/drawing/drawing.js +193 -0
  321. package/build/treb-export/src/drawing/drawing.js.map +1 -0
  322. package/build/treb-export/src/drawing/embedded-image.d.ts +12 -0
  323. package/build/treb-export/src/drawing/embedded-image.js +54 -0
  324. package/build/treb-export/src/drawing/embedded-image.js.map +1 -0
  325. package/build/treb-export/src/drawing/scatter-chart-template2.d.ts +520 -0
  326. package/build/treb-export/src/drawing/scatter-chart-template2.js +551 -0
  327. package/build/treb-export/src/drawing/scatter-chart-template2.js.map +1 -0
  328. package/build/treb-export/src/export.d.ts +72 -0
  329. package/build/treb-export/src/export.js +2039 -0
  330. package/build/treb-export/src/export.js.map +1 -0
  331. package/build/treb-export/src/import-export-messages.d.ts +31 -0
  332. package/build/treb-export/src/import-export-messages.js +22 -0
  333. package/build/treb-export/src/import-export-messages.js.map +1 -0
  334. package/build/treb-export/src/import.d.ts +33 -0
  335. package/build/treb-export/src/import.js +1258 -0
  336. package/build/treb-export/src/import.js.map +1 -0
  337. package/build/treb-export/src/index.worker.d.ts +1 -0
  338. package/build/treb-export/src/index.worker.js +93 -0
  339. package/build/treb-export/src/index.worker.js.map +1 -0
  340. package/build/treb-export/src/metadata.d.ts +51 -0
  341. package/build/treb-export/src/metadata.js +153 -0
  342. package/build/treb-export/src/metadata.js.map +1 -0
  343. package/build/treb-export/src/ooxml.d.ts +7 -0
  344. package/build/treb-export/src/ooxml.js +41 -0
  345. package/build/treb-export/src/ooxml.js.map +1 -0
  346. package/build/treb-export/src/relationship.d.ts +8 -0
  347. package/build/treb-export/src/relationship.js +27 -0
  348. package/build/treb-export/src/relationship.js.map +1 -0
  349. package/build/treb-export/src/shared-strings.d.ts +11 -0
  350. package/build/treb-export/src/shared-strings.js +105 -0
  351. package/build/treb-export/src/shared-strings.js.map +1 -0
  352. package/build/treb-export/src/template-2.d.ts +1 -0
  353. package/build/treb-export/src/template-2.js +22 -0
  354. package/build/treb-export/src/template-2.js.map +1 -0
  355. package/build/treb-export/src/unescape_xml.d.ts +1 -0
  356. package/build/treb-export/src/unescape_xml.js +61 -0
  357. package/build/treb-export/src/unescape_xml.js.map +1 -0
  358. package/build/treb-export/src/workbook-sheet.d.ts +75 -0
  359. package/build/treb-export/src/workbook-sheet.js +128 -0
  360. package/build/treb-export/src/workbook-sheet.js.map +1 -0
  361. package/build/treb-export/src/workbook-style.d.ts +110 -0
  362. package/build/treb-export/src/workbook-style.js +1134 -0
  363. package/build/treb-export/src/workbook-style.js.map +1 -0
  364. package/build/treb-export/src/workbook-theme.d.ts +13 -0
  365. package/build/treb-export/src/workbook-theme.js +85 -0
  366. package/build/treb-export/src/workbook-theme.js.map +1 -0
  367. package/build/treb-export/src/workbook.d.ts +123 -0
  368. package/build/treb-export/src/workbook.js +644 -0
  369. package/build/treb-export/src/workbook.js.map +1 -0
  370. package/build/treb-export/src/xml-test.d.ts +9 -0
  371. package/build/treb-export/src/xml-test.js +52 -0
  372. package/build/treb-export/src/xml-test.js.map +1 -0
  373. package/build/treb-export/src/xml-utils.d.ts +76 -0
  374. package/build/treb-export/src/xml-utils.js +223 -0
  375. package/build/treb-export/src/xml-utils.js.map +1 -0
  376. package/build/treb-export/src/zip-wrapper.d.ts +22 -0
  377. package/build/treb-export/src/zip-wrapper.js +93 -0
  378. package/build/treb-export/src/zip-wrapper.js.map +1 -0
  379. package/build/treb-format/src/format.d.ts +130 -0
  380. package/build/treb-format/src/format.js +805 -0
  381. package/build/treb-format/src/format.js.map +1 -0
  382. package/build/treb-format/src/format_cache.d.ts +55 -0
  383. package/build/treb-format/src/format_cache.js +166 -0
  384. package/build/treb-format/src/format_cache.js.map +1 -0
  385. package/build/treb-format/src/format_parser.d.ts +70 -0
  386. package/build/treb-format/src/format_parser.js +618 -0
  387. package/build/treb-format/src/format_parser.js.map +1 -0
  388. package/build/treb-format/src/index.d.ts +4 -0
  389. package/build/treb-format/src/index.js +25 -0
  390. package/build/treb-format/src/index.js.map +1 -0
  391. package/build/treb-format/src/number_format_section.d.ts +58 -0
  392. package/build/treb-format/src/number_format_section.js +78 -0
  393. package/build/treb-format/src/number_format_section.js.map +1 -0
  394. package/build/treb-format/src/value_parser.d.ts +48 -0
  395. package/build/treb-format/src/value_parser.js +244 -0
  396. package/build/treb-format/src/value_parser.js.map +1 -0
  397. package/build/treb-grid/src/editors/autocomplete.d.ts +39 -0
  398. package/build/treb-grid/src/editors/autocomplete.js +316 -0
  399. package/build/treb-grid/src/editors/autocomplete.js.map +1 -0
  400. package/build/treb-grid/src/editors/autocomplete_matcher.d.ts +74 -0
  401. package/build/treb-grid/src/editors/autocomplete_matcher.js +212 -0
  402. package/build/treb-grid/src/editors/autocomplete_matcher.js.map +1 -0
  403. package/build/treb-grid/src/editors/editor.d.ts +214 -0
  404. package/build/treb-grid/src/editors/editor.js +879 -0
  405. package/build/treb-grid/src/editors/editor.js.map +1 -0
  406. package/build/treb-grid/src/editors/external_editor.d.ts +11 -0
  407. package/build/treb-grid/src/editors/external_editor.js +118 -0
  408. package/build/treb-grid/src/editors/external_editor.js.map +1 -0
  409. package/build/treb-grid/src/editors/formula_bar.d.ts +85 -0
  410. package/build/treb-grid/src/editors/formula_bar.js +444 -0
  411. package/build/treb-grid/src/editors/formula_bar.js.map +1 -0
  412. package/build/treb-grid/src/editors/overlay_editor.d.ts +85 -0
  413. package/build/treb-grid/src/editors/overlay_editor.js +353 -0
  414. package/build/treb-grid/src/editors/overlay_editor.js.map +1 -0
  415. package/build/treb-grid/src/index.d.ts +12 -0
  416. package/build/treb-grid/src/index.js +28 -0
  417. package/build/treb-grid/src/index.js.map +1 -0
  418. package/build/treb-grid/src/layout/base_layout.d.ts +346 -0
  419. package/build/treb-grid/src/layout/base_layout.js +2050 -0
  420. package/build/treb-grid/src/layout/base_layout.js.map +1 -0
  421. package/build/treb-grid/src/layout/grid_layout.d.ts +19 -0
  422. package/build/treb-grid/src/layout/grid_layout.js +235 -0
  423. package/build/treb-grid/src/layout/grid_layout.js.map +1 -0
  424. package/build/treb-grid/src/layout/mock-layout.d.ts +10 -0
  425. package/build/treb-grid/src/layout/mock-layout.js +37 -0
  426. package/build/treb-grid/src/layout/mock-layout.js.map +1 -0
  427. package/build/treb-grid/src/render/selection-renderer.d.ts +97 -0
  428. package/build/treb-grid/src/render/selection-renderer.js +315 -0
  429. package/build/treb-grid/src/render/selection-renderer.js.map +1 -0
  430. package/build/treb-grid/src/render/svg_header_overlay.d.ts +20 -0
  431. package/build/treb-grid/src/render/svg_header_overlay.js +76 -0
  432. package/build/treb-grid/src/render/svg_header_overlay.js.map +1 -0
  433. package/build/treb-grid/src/render/svg_selection_block.d.ts +27 -0
  434. package/build/treb-grid/src/render/svg_selection_block.js +106 -0
  435. package/build/treb-grid/src/render/svg_selection_block.js.map +1 -0
  436. package/build/treb-grid/src/render/tile_renderer.d.ts +121 -0
  437. package/build/treb-grid/src/render/tile_renderer.js +1609 -0
  438. package/build/treb-grid/src/render/tile_renderer.js.map +1 -0
  439. package/build/treb-grid/src/types/border_constants.d.ts +9 -0
  440. package/build/treb-grid/src/types/border_constants.js +34 -0
  441. package/build/treb-grid/src/types/border_constants.js.map +1 -0
  442. package/build/treb-grid/src/types/clipboard_data.d.ts +11 -0
  443. package/build/treb-grid/src/types/clipboard_data.js +22 -0
  444. package/build/treb-grid/src/types/clipboard_data.js.map +1 -0
  445. package/build/treb-grid/src/types/clipboard_data2.d.ts +46 -0
  446. package/build/treb-grid/src/types/clipboard_data2.js +22 -0
  447. package/build/treb-grid/src/types/clipboard_data2.js.map +1 -0
  448. package/build/treb-grid/src/types/drag_mask.d.ts +10 -0
  449. package/build/treb-grid/src/types/drag_mask.js +78 -0
  450. package/build/treb-grid/src/types/drag_mask.js.map +1 -0
  451. package/build/treb-grid/src/types/external_editor_config.d.ts +33 -0
  452. package/build/treb-grid/src/types/external_editor_config.js +22 -0
  453. package/build/treb-grid/src/types/external_editor_config.js.map +1 -0
  454. package/build/treb-grid/src/types/grid.d.ts +806 -0
  455. package/build/treb-grid/src/types/grid.js +6410 -0
  456. package/build/treb-grid/src/types/grid.js.map +1 -0
  457. package/build/treb-grid/src/types/grid_base.d.ts +442 -0
  458. package/build/treb-grid/src/types/grid_base.js +3523 -0
  459. package/build/treb-grid/src/types/grid_base.js.map +1 -0
  460. package/build/treb-grid/src/types/grid_command.d.ts +408 -0
  461. package/build/treb-grid/src/types/grid_command.js +75 -0
  462. package/build/treb-grid/src/types/grid_command.js.map +1 -0
  463. package/build/treb-grid/src/types/grid_events.d.ts +93 -0
  464. package/build/treb-grid/src/types/grid_events.js +36 -0
  465. package/build/treb-grid/src/types/grid_events.js.map +1 -0
  466. package/build/treb-grid/src/types/grid_options.d.ts +50 -0
  467. package/build/treb-grid/src/types/grid_options.js +34 -0
  468. package/build/treb-grid/src/types/grid_options.js.map +1 -0
  469. package/build/treb-grid/src/types/scale-control.d.ts +21 -0
  470. package/build/treb-grid/src/types/scale-control.js +148 -0
  471. package/build/treb-grid/src/types/scale-control.js.map +1 -0
  472. package/build/treb-grid/src/types/set_range_options.d.ts +24 -0
  473. package/build/treb-grid/src/types/set_range_options.js +22 -0
  474. package/build/treb-grid/src/types/set_range_options.js.map +1 -0
  475. package/build/treb-grid/src/types/tab_bar.d.ts +84 -0
  476. package/build/treb-grid/src/types/tab_bar.js +426 -0
  477. package/build/treb-grid/src/types/tab_bar.js.map +1 -0
  478. package/build/treb-grid/src/types/tile.d.ts +29 -0
  479. package/build/treb-grid/src/types/tile.js +22 -0
  480. package/build/treb-grid/src/types/tile.js.map +1 -0
  481. package/build/treb-grid/src/types/update_flags.d.ts +48 -0
  482. package/build/treb-grid/src/types/update_flags.js +22 -0
  483. package/build/treb-grid/src/types/update_flags.js.map +1 -0
  484. package/build/treb-grid/src/util/fontmetrics.d.ts +21 -0
  485. package/build/treb-grid/src/util/fontmetrics.js +82 -0
  486. package/build/treb-grid/src/util/fontmetrics.js.map +1 -0
  487. package/build/treb-grid/src/util/ua.d.ts +33 -0
  488. package/build/treb-grid/src/util/ua.js +86 -0
  489. package/build/treb-grid/src/util/ua.js.map +1 -0
  490. package/build/treb-parser/src/csv-parser.d.ts +13 -0
  491. package/build/treb-parser/src/csv-parser.js +107 -0
  492. package/build/treb-parser/src/csv-parser.js.map +1 -0
  493. package/build/treb-parser/src/index.d.ts +4 -0
  494. package/build/treb-parser/src/index.js +25 -0
  495. package/build/treb-parser/src/index.js.map +1 -0
  496. package/build/treb-parser/src/md-parser.d.ts +97 -0
  497. package/build/treb-parser/src/md-parser.js +403 -0
  498. package/build/treb-parser/src/md-parser.js.map +1 -0
  499. package/build/treb-parser/src/parser-types.d.ts +345 -0
  500. package/build/treb-parser/src/parser-types.js +53 -0
  501. package/build/treb-parser/src/parser-types.js.map +1 -0
  502. package/build/treb-parser/src/parser.d.ts +422 -0
  503. package/build/treb-parser/src/parser.js +2418 -0
  504. package/build/treb-parser/src/parser.js.map +1 -0
  505. package/build/treb-utils/src/event_source.d.ts +34 -0
  506. package/build/treb-utils/src/event_source.js +110 -0
  507. package/build/treb-utils/src/event_source.js.map +1 -0
  508. package/build/treb-utils/src/ievent_source.d.ts +9 -0
  509. package/build/treb-utils/src/ievent_source.js +22 -0
  510. package/build/treb-utils/src/ievent_source.js.map +1 -0
  511. package/build/treb-utils/src/index.d.ts +6 -0
  512. package/build/treb-utils/src/index.js +30 -0
  513. package/build/treb-utils/src/index.js.map +1 -0
  514. package/build/treb-utils/src/measurement.d.ts +42 -0
  515. package/build/treb-utils/src/measurement.js +145 -0
  516. package/build/treb-utils/src/measurement.js.map +1 -0
  517. package/build/treb-utils/src/scale.d.ts +16 -0
  518. package/build/treb-utils/src/scale.js +106 -0
  519. package/build/treb-utils/src/scale.js.map +1 -0
  520. package/build/treb-utils/src/serialize_html.d.ts +5 -0
  521. package/build/treb-utils/src/serialize_html.js +128 -0
  522. package/build/treb-utils/src/serialize_html.js.map +1 -0
  523. package/build/treb-utils/src/validate_uri.d.ts +20 -0
  524. package/build/treb-utils/src/validate_uri.js +55 -0
  525. package/build/treb-utils/src/validate_uri.js.map +1 -0
  526. package/dist/{chunk-Z4XFMZ2X.mjs → chunk-E35ONJUS.mjs} +1 -1
  527. package/dist/treb-export-worker.mjs +2 -2
  528. package/dist/treb-spreadsheet.mjs +4 -4
  529. package/dist/treb.d.ts +1 -1
  530. package/esbuild-composite.mjs +5 -1
  531. package/package.json +67 -3
  532. package/treb-embed/src/custom-element/spreadsheet-constructor.ts +7 -3
  533. package/treb-embed/src/embedded-spreadsheet.ts +1 -1
  534. package/treb-grid/src/types/grid_options.ts +1 -1
  535. package/tsproject.json +1 -2
  536. package/dist/chunk-43DLP2OX.mjs +0 -11
  537. package/dist/chunk-4CKS56PE.mjs +0 -11
  538. package/dist/chunk-75PARUQE.mjs +0 -11
  539. package/dist/chunk-7QD63AZS.mjs +0 -24601
  540. package/dist/chunk-A55ARVRD.mjs +0 -11
  541. package/dist/chunk-DESAKYW4.mjs +0 -11
  542. package/dist/chunk-EQ2R5W6P.mjs +0 -24565
  543. package/dist/chunk-IYJU2J6D.mjs +0 -24601
  544. package/dist/chunk-KSJFPGXT.mjs +0 -11
  545. package/dist/chunk-MQK4DNXI.mjs +0 -11
  546. package/dist/chunk-ORQFKLXM.mjs +0 -24601
  547. package/dist/chunk-SFDNNDHY.mjs +0 -11
  548. package/dist/chunk-T47DX5MI.mjs +0 -11
  549. package/dist/chunk-T6ILBVEX.mjs +0 -11
  550. package/dist/chunk-TPRCDYYG.mjs +0 -11
  551. package/dist/chunk-YAHNOOHO.mjs +0 -11
  552. package/dist/chunk-YLCFKX2G.mjs +0 -24601
@@ -0,0 +1,1358 @@
1
+ import type { GridEvent, SheetChangeEvent, GridOptions, CellEvent, ExternalEditorConfig, GridSelectionEvent } from 'treb-grid';
2
+ import { DataModel, Sheet } from 'treb-data-model';
3
+ import type { SerializeOptions, Annotation, AnnotationType, GridSelection, ConnectedElementType, SerializedModel, FreezePane, ConditionalFormatDuplicateValuesOptions, ConditionalFormatGradientOptions, ConditionalFormat, StandardGradient, CondifionalFormatExpressionOptions, ConditionalFormatCellMatchOptions, SerializedNamed, ConditionalFormatDataBarOptions } from 'treb-data-model';
4
+ import { Grid, BorderConstants, ErrorCode } from 'treb-grid';
5
+ import { Parser } from 'treb-parser';
6
+ import { Calculator } from 'treb-calculator';
7
+ import type { ICellAddress, EvaluateOptions, IArea, CellValue, Point, Complex, IRectangle, AddressReference, RangeReference, TableSortOptions, Table, TableTheme, Theme } from 'treb-base-types';
8
+ import { type CellStyle, Localization, type Color, Area, DOMContext } from 'treb-base-types';
9
+ import { EventSource } from 'treb-utils';
10
+ import { Dialog } from './progress-dialog';
11
+ import { Spinner } from './spinner';
12
+ import { type EmbeddedSpreadsheetOptions, type ExportOptions } from './options';
13
+ import { type TREBDocument, LoadSource, type EmbeddedSheetEvent, type InsertTableOptions } from './types';
14
+ import type { SelectionState } from './selection-state';
15
+ import type { ToolbarMessage } from './toolbar-message';
16
+ import { Chart } from 'treb-charts';
17
+ import type { SetRangeOptions, ClipboardData, PasteOptions } from 'treb-grid';
18
+ import * as ImportExportMessages from 'treb-export/src/import-export-messages';
19
+ /**
20
+ * import type for our worker, plus markup files
21
+ */
22
+ import { type WorkerProxy } from 'treb-base-types';
23
+ /** new, intended for tui support but keeping it as generic as possible */
24
+ export type CustomGridFactory = (options: GridOptions, model: DataModel, theme: Theme | undefined, initialze_dom: boolean, DOM: DOMContext) => Grid;
25
+ /**
26
+ * options for saving files. we add the option for JSON formatting.
27
+ */
28
+ export interface SaveOptions extends SerializeOptions {
29
+ /** pretty json formatting */
30
+ pretty?: boolean;
31
+ }
32
+ declare enum CalculationOptions {
33
+ automatic = 0,
34
+ manual = 1
35
+ }
36
+ declare enum FileChooserOperation {
37
+ None = 0,
38
+ LoadFile = 1,
39
+ InsertImage = 2
40
+ }
41
+ /**
42
+ * @internal
43
+ */
44
+ export interface ToolbarCtl {
45
+ Show: (show: boolean) => void;
46
+ }
47
+ declare enum SemanticVersionElement {
48
+ major = 0,
49
+ minor = 1,
50
+ patch = 2
51
+ }
52
+ interface SemanticVersionComparison {
53
+ match: number;
54
+ level?: SemanticVersionElement;
55
+ }
56
+ /**
57
+ * options for the LoadDocument method
58
+ */
59
+ export interface LoadDocumentOptions {
60
+ scroll?: string | ICellAddress;
61
+ flush?: boolean;
62
+ recalculate?: boolean;
63
+ override_sheet?: string;
64
+ /** @internal */
65
+ override_selection?: GridSelection;
66
+ source?: LoadSource;
67
+ /** opaque data for reference */
68
+ path?: string;
69
+ }
70
+ /**
71
+ * options for the GetRange method
72
+ */
73
+ export interface GetRangeOptions {
74
+ /**
75
+ * return formatted values (apply number formats and return strings)
76
+ * @deprecated
77
+ */
78
+ formatted?: boolean;
79
+ /**
80
+ * return formulas instead of values. formula takes precedence over
81
+ * "formatted"; if you pass both, returned values will *not* be formatted.
82
+ * @deprecated
83
+ *
84
+ * @privateRemarks
85
+ *
86
+ * FIXME: that should throw?
87
+ */
88
+ formula?: boolean;
89
+ /**
90
+ * by default, GetRange returns cell values. the optional type field
91
+ * can be used to returns data in different formats.
92
+ *
93
+ * @remarks
94
+ *
95
+ * `formatted` returns formatted values, applying number formatting and
96
+ * returning strings.
97
+ *
98
+ * `A1` returns cell formulas instead of values, in A1 format.
99
+ *
100
+ * `R1C1` returns cell formauls in R1C1 format.
101
+ *
102
+ * `formula` is an alias for 'A1', for backwards compatibility.
103
+ *
104
+ */
105
+ type?: 'formatted' | 'A1' | 'R1C1' | 'formula';
106
+ }
107
+ /**
108
+ * options for the ScrollTo method.
109
+ *
110
+ * @remarks
111
+ *
112
+ * this method was renamed because of a conflict with a DOM type,
113
+ * which was causing problems with the documentation generator.
114
+ */
115
+ export interface SheetScrollOptions {
116
+ /** scroll in x-direction. defaults to true. */
117
+ x?: boolean;
118
+ /** scroll in y-direction. defaults to true. */
119
+ y?: boolean;
120
+ /**
121
+ * smooth scrolling, if supported. we use scrollTo so support is as here:
122
+ * https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo
123
+ */
124
+ smooth?: boolean;
125
+ }
126
+ /**
127
+ * function type used for filtering tables
128
+ */
129
+ export type TableFilterFunction = (value: CellValue, calculated_value: CellValue, style: CellStyle) => boolean;
130
+ /**
131
+ * embedded spreadsheet
132
+ */
133
+ export declare class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
134
+ /**
135
+ * this is temporary. we need a better way to handle this, perhaps
136
+ * making the factory method (createSpreadsheet) async.
137
+ *
138
+ * for now, you can test on this set of promises to see when the
139
+ * app is ready
140
+ */
141
+ protected _ready_state: Promise<void>[];
142
+ get ready(): Promise<void[]>;
143
+ /** @internal */
144
+ static treb_base_path: string;
145
+ /**
146
+ * @internal
147
+ *
148
+ * keep track of modules we've tried to load dynamically, so we don't
149
+ * do it again. not sure if this is strictly necessary but especially if
150
+ * we're logging I don't want to see it again
151
+ */
152
+ protected static failed_dynamic_modules: string[];
153
+ /** @internal */
154
+ static one_time_warnings: Record<string, boolean>;
155
+ /** @internal */
156
+ protected static clipboard?: ClipboardData;
157
+ protected DOM: DOMContext;
158
+ /**
159
+ * this flag will be set on LoadDocument. the intent is to be able to
160
+ * know if you have loaded a network document, which may happen before you
161
+ * have the chance to subscribe to events
162
+ *
163
+ * FIXME: we need to nail down the semantics of this. what does it mean if
164
+ * you call reset?
165
+ *
166
+ * @internal
167
+ */
168
+ loaded: boolean;
169
+ /**
170
+ * this is a cache of number formats and colors used in the document. it's
171
+ * intended for an external toolbar.
172
+ *
173
+ * FIXME: should we preferentially use Color objects? (...)
174
+ *
175
+ * @internal
176
+ */
177
+ document_styles: {
178
+ number_formats: string[];
179
+ colors: string[];
180
+ theme_colors: Array<{
181
+ color: Color;
182
+ resolved: string;
183
+ }>[];
184
+ };
185
+ /**
186
+ * this is a representation of selection state for an external toolbar.
187
+ * we also use it to manage state changes. this used to be internal only,
188
+ * now we are exposing it. we might want to only expose a copy via an
189
+ * accessor, but for now we'll just expose the actual object.
190
+ *
191
+ * not sure why this was ever optional, we should just have an empty default
192
+ *
193
+ * @internal
194
+ */
195
+ selection_state: SelectionState;
196
+ /**
197
+ * this is our options object, EmbeddedSpreadsheetOptions but we
198
+ * narrow the storage key type to a string|undefined (can be boolean
199
+ * in the input).
200
+ *
201
+ * @internal
202
+ */
203
+ options: EmbeddedSpreadsheetOptions & {
204
+ local_storage: string | undefined;
205
+ };
206
+ /**
207
+ * @internal
208
+ *
209
+ * this is not public (in the API, at least), for the moment, but
210
+ * it is accessible. not sure which way we're going to go with this.
211
+ */
212
+ get Localization(): Localization;
213
+ /** FIXME: fix type (needs to be extensible) */
214
+ protected events: EventSource<{
215
+ type: string;
216
+ }>;
217
+ /**
218
+ * automatic/manual
219
+ * why is this protected? is there some reason we don't want people to use it?
220
+ */
221
+ protected calculation: CalculationOptions;
222
+ /**
223
+ * this might be something that should travel with the document,
224
+ * as a way to compare different versions... something to think
225
+ * about. we could certainly preserve/restore it on save/load.
226
+ *
227
+ * UPDATE: we're now storing this with the document, as "revision".
228
+ * for the future we should be able to use this as the basis for
229
+ * dirty flags in various applications.
230
+ */
231
+ protected file_version: number;
232
+ /**
233
+ * this is recordkeeping for "dirty" marking, which also supports
234
+ * undo. if we preserve the file version this will have to track.
235
+ */
236
+ protected last_save_version: number;
237
+ /**
238
+ * simpler flag for testing if we can revert
239
+ */
240
+ protected initial_load_source: LoadSource | undefined;
241
+ /**
242
+ * calculator instance. we may share this if we're in a split view.
243
+ */
244
+ protected calculator: Calculator;
245
+ /**
246
+ */
247
+ protected grid: Grid;
248
+ /**
249
+ * model moved from grid. we control it now. grid still maintains
250
+ * its own view, including active sheet.
251
+ */
252
+ protected model: DataModel;
253
+ /**
254
+ * dialog is assigned in the constructor, only if there's a containing
255
+ * element (i.e. not when we're just using the engine)
256
+ */
257
+ protected dialog?: Dialog;
258
+ /** new spinner */
259
+ protected spinner?: Spinner;
260
+ /** file chooser */
261
+ protected file_chooser?: HTMLInputElement;
262
+ /** file chooser operation */
263
+ protected file_chooser_operation: FileChooserOperation;
264
+ /** localized parser instance. we're sharing. */
265
+ protected get parser(): Parser;
266
+ /** for destruction */
267
+ protected view_node?: HTMLElement;
268
+ /** for destruction */
269
+ protected key_listener?: (event: KeyboardEvent) => void;
270
+ protected views: Array<{
271
+ view: EmbeddedSpreadsheet;
272
+ subscription?: number;
273
+ }>;
274
+ /** focus target if we have multiple views */
275
+ protected focus_target: EmbeddedSpreadsheet;
276
+ /** parent, if we are a split view child */
277
+ protected parent_view?: EmbeddedSpreadsheet;
278
+ /**
279
+ * export worker (no longer using worker-loader).
280
+ * export worker is loaded on demand, not by default.
281
+ *
282
+ * FIXME: type
283
+ */
284
+ protected export_worker?: WorkerProxy<ImportExportMessages.RXMessages, ImportExportMessages.TXMessages>;
285
+ /**
286
+ * undo pointer points to the next insert spot. that means that when
287
+ * you push an undo operation, it goes into the slot [undo_pointer].
288
+ *
289
+ * that means if you want to undo, and the pointer is at X, you need
290
+ * to go to the state X-2 -- because X-1 is effectively the _current_ state.
291
+ * and also if you do that (undo), you decrement the pointer by 1.
292
+ *
293
+ * this is confusing.
294
+ */
295
+ private undo_pointer;
296
+ private undo_stack;
297
+ /**
298
+ * ...
299
+ */
300
+ private last_selection?;
301
+ /**
302
+ * convenience function returns the name of the active sheet. if the
303
+ * sheet name has spaces or other characters that require quoting, it
304
+ * will be quoted using single quotes.
305
+ */
306
+ get active_sheet(): string;
307
+ /**
308
+ * this was added for riskamp.com; it doesn't track modified, really, because
309
+ * it doesn't reflect saves. we need to do that but leave this one as-is for
310
+ * backwards compatibility.
311
+ *
312
+ * @internal
313
+ */
314
+ get modified(): boolean;
315
+ /** document name (metadata) */
316
+ get document_name(): string | undefined;
317
+ /** document name (metadata) */
318
+ set document_name(name: string | undefined);
319
+ /**
320
+ * opaque user data (metadata). `USER_DATA_TYPE` is a template
321
+ * parameter you can set when creating the spreadsheet.
322
+ */
323
+ get user_data(): USER_DATA_TYPE | undefined;
324
+ /**
325
+ * opaque user data (metadata). `USER_DATA_TYPE` is a template
326
+ * parameter you can set when creating the spreadsheet.
327
+ */
328
+ set user_data(data: USER_DATA_TYPE | undefined);
329
+ /** current grid scale */
330
+ get scale(): number;
331
+ /** current grid scale */
332
+ set scale(value: number);
333
+ /** headless state */
334
+ get headless(): boolean;
335
+ /** headless state */
336
+ set headless(value: boolean);
337
+ /**
338
+ * state is the current revision of the document. it is preserved any
339
+ * time the document is saved. it should be a consistent indication of
340
+ * the document version and can be used to compare versions.
341
+ *
342
+ * state is an atomically-incrementing integer but rolls over at 2^16.
343
+ */
344
+ get state(): number;
345
+ /**
346
+ * this flag indicates we can revert the document. what that means is
347
+ * we loaded a user-created version from localStorage, but there's a
348
+ * backing network or inline document. or we did load the original version
349
+ * but the user has made some document changes.
350
+ *
351
+ * it's like `dirty`, but that uses the load source as the ground truth,
352
+ * which means if you load a modified document from localStorage it's
353
+ * initially considered not-dirty (which is maybe just a bad design?)
354
+ *
355
+ * the intent of this field is to support enabling/disabling revert
356
+ * logic, or to add a visual indicator that you are not looking at the
357
+ * canonical version.
358
+ *
359
+ * @privateRemarks
360
+ * for that to work we need to know that we loaded from localStorage --
361
+ * that's not something we're keeping track of at the moment.
362
+ *
363
+ * it might be good to include the "canonical version" when we put stuff
364
+ * in localStorage...
365
+ *
366
+ */
367
+ get can_revert(): boolean;
368
+ /**
369
+ * indicates the current revision of the document is not equal to the
370
+ * last-saved revision of the document.
371
+ */
372
+ get dirty(): boolean;
373
+ /**
374
+ * explicitly set or clear the dirty flag. it's intended for use by clients
375
+ * that have their own save routine.
376
+ */
377
+ set dirty(value: boolean);
378
+ /**
379
+ * returns the names of all sheets in the current document
380
+ */
381
+ get sheet_names(): string[];
382
+ /**
383
+ * constructor takes spreadsheet options. type should be implicit, either
384
+ * the default (here) or a subclass
385
+ *
386
+ * @internal
387
+ */
388
+ constructor(options: EmbeddedSpreadsheetOptions & {
389
+ model?: EmbeddedSpreadsheet;
390
+ custom_grid?: CustomGridFactory;
391
+ });
392
+ /**
393
+ * update autocomplete functions. we're breaking this out into a
394
+ * separate method so we can better manage language translation.
395
+ */
396
+ protected UpdateAC(): void;
397
+ /**
398
+ * initialize calculator instance
399
+ */
400
+ protected CreateCalculator(model: DataModel, options: EmbeddedSpreadsheetOptions): Calculator;
401
+ /**
402
+ * we moved error strings from grid, so we can (at some point) localize
403
+ * them. returns a message and (optionally) a title for the dialog
404
+ */
405
+ protected TranslateGridError(code: ErrorCode): {
406
+ message: string;
407
+ title?: string;
408
+ };
409
+ /**
410
+ * this will need to get overloaded for subclasses so they can
411
+ * create the correct type
412
+ */
413
+ protected CreateView(): EmbeddedSpreadsheet;
414
+ /**
415
+ * testing
416
+ *
417
+ * @internal
418
+ */
419
+ Unsplit(): void;
420
+ /**
421
+ * set or remove an external editor. external editor is an interface used
422
+ * to support outside tooling by highlighting a list of arguments and
423
+ * responding to selection.
424
+ */
425
+ ExternalEditor(config?: Partial<ExternalEditorConfig>): void;
426
+ /**
427
+ * this is not very efficient atm. we create another whole instance of this
428
+ * class, do a lot of unecssary painting and layout. it works but it could
429
+ * definitely be improved.
430
+ *
431
+ * @internal
432
+ */
433
+ Split(): void;
434
+ /**
435
+ * list conditional formats. uses the active sheet by default, or pass a
436
+ * sheet name or id.
437
+ *
438
+ * @internal
439
+ */
440
+ ListConditionalFormats(sheet?: number | string): import("treb-data-model").ConditionalFormatList;
441
+ /**
442
+ * @internalRemarks removing internal flag
443
+ */
444
+ ConditionalFormatDuplicateValues(range: RangeReference | undefined, options: ConditionalFormatDuplicateValuesOptions): ConditionalFormat;
445
+ /**
446
+ * @internalRemarks removing internal flag
447
+ */
448
+ ConditionalFormatGradient(range: RangeReference | undefined, options: ConditionalFormatGradientOptions | StandardGradient): ConditionalFormat;
449
+ /**
450
+ *
451
+ */
452
+ ConditionalFormatDataBars(range: RangeReference | undefined, options?: ConditionalFormatDataBarOptions): ConditionalFormat;
453
+ /**
454
+ * @internalRemarks removing internal flag
455
+ */
456
+ ConditionalFormatCellMatch(range: RangeReference | undefined, options: ConditionalFormatCellMatchOptions): ConditionalFormat;
457
+ /**
458
+ * @internalRemarks removing internal flag
459
+ */
460
+ ConditionalFormatExpression(range: RangeReference | undefined, options: CondifionalFormatExpressionOptions): ConditionalFormat;
461
+ /**
462
+ * add a conditional format
463
+ *
464
+ * @internal
465
+ */
466
+ AddConditionalFormat(format: ConditionalFormat): ConditionalFormat;
467
+ /**
468
+ * remove conditional format
469
+ *
470
+ * @internalRemarks removing internal flag
471
+ */
472
+ RemoveConditionalFormat(format: ConditionalFormat): void;
473
+ /**
474
+ * clear conditional formats from the target range (or currently selected
475
+ * range). we operate on format objects, meaning we'll remove the whole
476
+ * format object rather than clip the area.
477
+ *
478
+ * @internalRemarks removing internal flag
479
+ */
480
+ RemoveConditionalFormats(range?: RangeReference): void;
481
+ /**
482
+ * @internal
483
+ */
484
+ HandleToolbarMessage(event: ToolbarMessage): void;
485
+ /**
486
+ * @internal
487
+ *
488
+ * @param show - true or false to show/hide, or leave undefined to toggle
489
+ */
490
+ ShowToolbar(show?: boolean): void;
491
+ /**
492
+ * @internal
493
+ *
494
+ * @param show - true or false to show/hide, or leave undefined to toggle
495
+ */
496
+ ShowSidebar(show?: boolean): void;
497
+ /**
498
+ * Create (and return) a Chart object.
499
+ * @internal
500
+ */
501
+ CreateChart(): Chart;
502
+ /** dynamically load language module */
503
+ LoadLanguage(language?: string): Promise<void>;
504
+ /**
505
+ * Use this function to batch multiple document changes. Essentially the
506
+ * grid stops broadcasting events for the duration of the function call,
507
+ * and collects them instead. After the function call we update as necessary.
508
+ *
509
+ * @privateRemarks
510
+ *
511
+ * FIXME: we need to consider the case where this is nested, since we now
512
+ * call it from the Paste method. that might be batched by a caller. we
513
+ * need a batch stack, and we need to consolidate any options (paint is the
514
+ * only option) and keep the top-of-stack last selection.
515
+ *
516
+ * Q: why does this work the way it does, anyway? why not just rely
517
+ * on the actual events? if grid published them after a batch, wouldn't
518
+ * everything just work? or is the problem that we normally handle events
519
+ * serially? maybe we need to rethink how we handle events coming from
520
+ * the grid.
521
+ *
522
+ * ---
523
+ *
524
+ * OK so now, grid will handle nested batching. it won't return anything
525
+ * until the last batch is complete. so this should work in the case of
526
+ * nested calls, because nothing will happen until the last one is complete.
527
+ *
528
+ */
529
+ Batch(func: () => void, paint?: boolean): void;
530
+ /** set freeze area */
531
+ Freeze(rows?: number, columns?: number): void;
532
+ /** freeze at current selection */
533
+ FreezeSelection(): void;
534
+ /** return current freeze area */
535
+ GetFreeze(): FreezePane;
536
+ /**
537
+ * Update theme from CSS. Because the spreadsheet is painted, not
538
+ * rendered, you need to notifiy us if external style (CSS) properties
539
+ * have changed. We will update and repaint.
540
+ */
541
+ UpdateTheme(): void;
542
+ /**
543
+ * Get sheet ID, by name (sheet name) or index. This may be useful for
544
+ * constructing references programatically.
545
+ *
546
+ * @remarks
547
+ *
548
+ * Sheet IDs are positive integers. IDs are ephemeral, they should not be
549
+ * retained after a document is closed or reloaded. They will likely (almost)
550
+ * always be the same, but that's not guaranteed, so don't rely on them.
551
+ *
552
+ * @param sheet - sheet name or index. sheet names are matched case-insensitively.
553
+ *
554
+ * @returns ID, or undefined if the index is not found (0 is not a valid
555
+ * sheet ID, so you can test for falsy).
556
+ *
557
+ * @public
558
+ */
559
+ GetSheetID(sheet: string | number): number | undefined;
560
+ /**
561
+ * insert a table in the given range. optionally include a totals row.
562
+ * this method does not make any changes to content or layout. it just
563
+ * converts the range to a table.
564
+ *
565
+ * @param reference
566
+ */
567
+ InsertTable(range?: RangeReference, options?: InsertTableOptions): void;
568
+ RemoveTable(range?: RangeReference): void;
569
+ UpdateTableStyle(range?: RangeReference, theme?: TableTheme | number): void;
570
+ SetTabColor(sheet?: number | string, color?: Color): void;
571
+ /**
572
+ * Add a sheet, optionally named.
573
+ */
574
+ AddSheet(name?: string): number;
575
+ RemoveConnectedChart(id: number): void;
576
+ UpdateConnectedChart(id: number, formula: string): void;
577
+ /**
578
+ * this is a generic version that takes a callback, so we can use
579
+ * separately from charts. however (atm) we're using leaf vertices that
580
+ * don't actually calculate, they just indicate the dirty state. so we
581
+ * won't have access to the result of a calculation in the callback.
582
+ *
583
+ * @internal
584
+ *
585
+ */
586
+ CreateConnectedFormula(formula: string, callback?: (instance: ConnectedElementType) => void, options?: EvaluateOptions): number;
587
+ /**
588
+ * @internal
589
+ *
590
+ * @returns an id that can be used to manage the reference
591
+ */
592
+ CreateConnectedChart(formula: string, target: HTMLElement, options: EvaluateOptions): number;
593
+ /**
594
+ * Insert an annotation node. Usually this means inserting a chart. Regarding
595
+ * the argument separator, see the Evaluate function.
596
+ *
597
+ * @param formula - annotation formula. For charts, the chart formula.
598
+ * @param type - annotation type. Defaults to `treb-chart`.
599
+ * @param rect - coordinates, or a range reference for layout.
600
+ * @param options - evaluate options. because this function used to take
601
+ * the argument separator, we allow that to be passed directly, but this
602
+ * is deprecated. new code should use the options object.
603
+ */
604
+ InsertAnnotation(formula: string, type?: AnnotationType, rect?: IRectangle | RangeReference, options?: EvaluateOptions | ',' | ';'): void;
605
+ /**
606
+ * Insert an image. This method will open a file chooser and (if an image
607
+ * is selected) insert the image into the document.
608
+ */
609
+ InsertImage(): void;
610
+ /**
611
+ * Rename a sheet.
612
+ *
613
+ * @param index - old name or index of sheet. leave undefined to use
614
+ * current active sheet.
615
+ *
616
+ * @public
617
+ */
618
+ RenameSheet(index: string | number | undefined, new_name: string): void;
619
+ /**
620
+ * Delete a sheet.
621
+ *
622
+ * @param index - sheet name or index. Leave undefined to delete the active sheet.
623
+ *
624
+ * @public
625
+ */
626
+ DeleteSheet(index?: string | number): void;
627
+ /**
628
+ * Show or hide sheet. This is a replacement for the `ShowSheet` method,
629
+ * because that name is somewhat ambiguous.
630
+ *
631
+ * @param index - sheet name or index.
632
+ *
633
+ * @public
634
+ */
635
+ HideSheet(index?: number | string, hide?: boolean): void;
636
+ /** list sheets in the model */
637
+ ListSheets(): {
638
+ name: string;
639
+ hidden?: boolean;
640
+ }[];
641
+ /**
642
+ * Show or hide sheet. This method is deprecated because it's ambiguous.
643
+ * To set a sheet's visibility, use `HideSheet`. To activate a sheet, use
644
+ * `ActivateSheet`.
645
+ *
646
+ * @param index - sheet name or index.
647
+ *
648
+ * @see HideSheet
649
+ * @deprecated Use `HideSheet` instead.
650
+ */
651
+ ShowSheet(index?: number | string, show?: boolean): void;
652
+ /**
653
+ * Activate sheet.
654
+ *
655
+ * @param index - sheet name or index.
656
+ *
657
+ * @public
658
+ */
659
+ ActivateSheet(index: number | string): void;
660
+ /**
661
+ * Set width of column(s).
662
+ *
663
+ * @param column - column, or columns (array), or undefined means all columns
664
+ * @param width - desired width (can be 0) or undefined means 'auto-size'
665
+ * @param allow_shrinking - for auto-size, allow shrinking. defaults to true.
666
+ *
667
+ * @privateRemarks
668
+ *
669
+ * TODO: this method assumes the current sheet. we need a method that can
670
+ * (optionally) specify a sheet.
671
+ *
672
+ * @public
673
+ */
674
+ SetColumnWidth(column?: number | number[], width?: number, allow_shrinking?: boolean): void;
675
+ /**
676
+ * Set height of row(s).
677
+ *
678
+ * @param row - row, or rows (array), or undefined means all rows
679
+ * @param height - desired height (can be 0) or undefined means 'auto-size'
680
+ *
681
+ * @privateRemarks
682
+ *
683
+ * TODO: this method assumes the current sheet. we need a method that can
684
+ * (optionally) specify a sheet.
685
+ *
686
+ * @public
687
+ */
688
+ SetRowHeight(row?: number | number[], height?: number): void;
689
+ /**
690
+ * Insert row(s).
691
+ *
692
+ * @param before_row - leave undefined to use current selection.
693
+ *
694
+ * @public
695
+ */
696
+ InsertRows(before_row?: number, count?: number): void;
697
+ /**
698
+ * Insert column(s).
699
+ *
700
+ * @param before_column - leave undefined to use current selection.
701
+ *
702
+ * @public
703
+ */
704
+ InsertColumns(before_column?: number, count?: number): void;
705
+ /**
706
+ * Delete row(s).
707
+ *
708
+ * @param start_row - leave undefined to use current selection. in this
709
+ * case the `count` parameter will be ignored and all rows in the selection
710
+ * will be deleted.
711
+ */
712
+ DeleteRows(start_row?: number, count?: number): void;
713
+ /**
714
+ * Delete columns(s).
715
+ *
716
+ * @param start_column - leave undefined to use current selection. in this
717
+ * case the `count` parameter will be ignored and all columns in the
718
+ * selection will be deleted.
719
+ */
720
+ DeleteColumns(start_column?: number, count?: number): void;
721
+ /**
722
+ * filter a table. the reference can be the table name, or a cell in the table.
723
+ * if the reference is an area (range), we're going to look at the top-left
724
+ * cell.
725
+ *
726
+ * this method uses a function to filter rows based on cell values. leave the
727
+ * function undefined to show all rows. this is a shortcut for "unfilter".
728
+ *
729
+ * @param column - the column to sort on. values from this column will be
730
+ * passed to the filter function.
731
+ *
732
+ * @param filter - a callback function to filter based on cell values. this
733
+ * will be called with the cell value (formula), the calculated value (if any),
734
+ * and the cell style. return false to hide the row, and true to show the row.
735
+ * if the filter parameter is omitted, all values will be shown.
736
+ *
737
+ */
738
+ FilterTable(reference: RangeReference, column?: number, filter?: TableFilterFunction): void;
739
+ /**
740
+ * sort a table. the reference can be the table name, or a cell in the table.
741
+ * if the reference is an area (range), we're going to look at the top-left
742
+ * cell.
743
+ */
744
+ SortTable(reference: RangeReference, options?: Partial<TableSortOptions>): void;
745
+ /**
746
+ * Merge cells in range.
747
+ *
748
+ * @param range - target range. leave undefined to use current selection.
749
+ *
750
+ * @public
751
+ */
752
+ MergeCells(range?: RangeReference): void;
753
+ /**
754
+ * Unmerge cells in range.
755
+ *
756
+ * @param range - target range. leave undefined to use current selection.
757
+ *
758
+ * @public
759
+ */
760
+ UnmergeCells(range?: RangeReference): void;
761
+ /**
762
+ * Export XLSX as a blob. This is intended for electron clients, who may
763
+ * implement their own file save routines (because they have access to the
764
+ * filesystem).
765
+ *
766
+ * @internal
767
+ */
768
+ ExportBlob(serialized?: SerializedModel): Promise<Blob>;
769
+ /**
770
+ * revert to the network version of this document, if `local_storage`
771
+ * is set and the create options had either `document` or `inline-document`
772
+ * set.
773
+ *
774
+ * FIXME: we should adjust for documents that fail to load.
775
+ */
776
+ Revert(): void;
777
+ /**
778
+ * Export to XLSX file.
779
+ *
780
+ * @remarks
781
+ *
782
+ * this requires a bunch of processing -- one, we do this in a worker, and
783
+ * two, it's demand loaded so we don't bloat up this embed script.
784
+ */
785
+ Export(): void;
786
+ /**
787
+ * Return "live" reference to selection.
788
+ *
789
+ * @internal
790
+ */
791
+ GetSelectionReference(): GridSelection;
792
+ /**
793
+ * Focus the grid.
794
+ *
795
+ * @public
796
+ */
797
+ Focus(): void;
798
+ /**
799
+ * Update layout and repaint if necessary.
800
+ *
801
+ * @remarks
802
+ *
803
+ * This method should be called when the container is resized, to
804
+ * trigger an update to layout. It should be called automatically
805
+ * by a resize observer set in the containing tag class, but you
806
+ * can call it manually if necessary.
807
+ *
808
+ * @public
809
+ */
810
+ Resize(): void;
811
+ /**
812
+ * Clear/reset sheet. This will reset the undo stack as well,
813
+ * so it cannot be undone.
814
+ *
815
+ * @public
816
+ */
817
+ Reset(): void;
818
+ /**
819
+ * load a document from from local storage, using the given key.
820
+ * this method will also set the local option for the storage key, so the
821
+ * document will potentially be saved on modification.
822
+ */
823
+ LoadFromLocalStorage(key: string): boolean;
824
+ /**
825
+ * load a network document by URI. CORS headers must be set appropriately
826
+ * on documents originating from different hosts.
827
+ */
828
+ LoadNetworkDocument(uri: string, options?: EmbeddedSpreadsheetOptions): Promise<void>;
829
+ /**
830
+ * Load a desktop file. This method will show a file chooser and open
831
+ * the selected file (if any).
832
+ *
833
+ * @public
834
+ */
835
+ LoadLocalFile(): Promise<void>;
836
+ /**
837
+ * Export sheet as CSV/TSV. This is an internal method called by the save
838
+ * document methods, but you can call it directly if you want the text as
839
+ * a string.
840
+ *
841
+ * @returns string
842
+ *
843
+ * @public
844
+ */
845
+ ExportDelimited(options?: ExportOptions): string;
846
+ /**
847
+ * @deprecated - use SaveToDesktop
848
+ *
849
+ * @param filename
850
+ * @param additional_options
851
+ */
852
+ SaveLocalFile(filename?: string, additional_options?: SaveOptions): void;
853
+ /**
854
+ * Save the current document to a desktop file. This is the new version
855
+ * of the method, renamed from SaveLocalFile.
856
+ *
857
+ * @param filename Filename or extension to use the document name.
858
+ */
859
+ SaveToDesktop(filename?: string, additional_options?: SaveOptions): void;
860
+ /**
861
+ * Load CSV from string. This is used internally when loading network
862
+ * documents and local files, but you can call it directly if you have
863
+ * a CSV file as text.
864
+ *
865
+ * @public
866
+ */
867
+ LoadCSV(csv: string, source?: LoadSource): void;
868
+ /**
869
+ * get or set the current scroll offset. scroll offset is automatically
870
+ * saved if you save the document or switch tabs; this is for saving/
871
+ * restoring scroll if you cache the containing element.
872
+ */
873
+ ScrollOffset(offset?: Point): Point | undefined;
874
+ /**
875
+ * unserialize document from data.
876
+ *
877
+ * @privateRemarks
878
+ *
879
+ * UPDATE: will no longer recalculate on load if the "rendered_values"
880
+ * flag is set in the document (assuming it's correct), because we can
881
+ * display those values.
882
+ *
883
+ * UPDATE: default scroll to A1 in open sheet
884
+ *
885
+ */
886
+ LoadDocument(data: TREBDocument, options?: LoadDocumentOptions): void;
887
+ /**
888
+ * Set note (comment) in cell.
889
+ *
890
+ * @param address target address, or leave undefined to use current selection.
891
+ * @param note note text, or leave undefined to clear existing note.
892
+ */
893
+ SetNote(address: AddressReference | undefined, note?: string): void;
894
+ /**
895
+ * set or clear cell valiation.
896
+ *
897
+ * @param target - target cell/area
898
+ * @param validation - a spreadsheet range, list of data, or undefined. pass
899
+ * undefined to remove existing cell validation.
900
+ * @param error - setting an invalid value in the target cell is an error (and
901
+ * is blocked). defaults to false.
902
+ */
903
+ SetValidation(target: RangeReference, validation?: RangeReference | CellValue[], error?: boolean): void;
904
+ /**
905
+ * Delete a macro function.
906
+ *
907
+ * @public
908
+ */
909
+ RemoveFunction(name: string): void;
910
+ /**
911
+ * Create a macro function.
912
+ *
913
+ * FIXME: this needs a control for argument separator, like other
914
+ * functions that use formulas (@see SetRange)
915
+ *
916
+ * @public
917
+ */
918
+ DefineFunction(name: string, argument_names?: string | string[], function_def?: string): void;
919
+ /**
920
+ * Serialize document to a plain javascript object. The result is suitable
921
+ * for converting to JSON. This method is used by the SaveLocalFile and
922
+ * SaveLocalStorage methods, but you can call it directly if you want to
923
+ * save the document some other way.
924
+ *
925
+ * @privateRemarks
926
+ *
927
+ * serialize document; optionally include any MC data
928
+ * optionally preserve rendered values
929
+ * UPDATE: default rendered values -> true
930
+ *
931
+ * @public
932
+ */
933
+ SerializeDocument(options?: SerializeOptions): TREBDocument;
934
+ /**
935
+ * Recalculate sheet.
936
+ *
937
+ * @privateRemarks
938
+ *
939
+ * the event parameter should not be used if this is called
940
+ * as an API function, remove it from typings
941
+ *
942
+ * why is this async? it doesn't do anything async.
943
+ *
944
+ * @public
945
+ */
946
+ Recalculate(event?: GridEvent): void;
947
+ /**
948
+ * Save document to local storage.
949
+ *
950
+ * @param key optional storage key. if omitted, the method will use
951
+ * the key from local options (set at create time).
952
+ */
953
+ SaveLocalStorage(key?: string | undefined): void;
954
+ /**
955
+ * Revert state one level from the undo stack.
956
+ *
957
+ * @public
958
+ * @returns true if undo succeeded, false if the undo stack was empty
959
+ */
960
+ Undo(): boolean;
961
+ /**
962
+ * Show the about dialog.
963
+ *
964
+ * @public
965
+ */
966
+ About(): void;
967
+ /**
968
+ * scroll the given address into view. it could be at either side
969
+ * of the window. optionally use smooth scrolling.
970
+ */
971
+ ScrollIntoView(address: AddressReference, smooth?: boolean): void;
972
+ /**
973
+ * Scroll to the given address. In the current implementation this method
974
+ * will not change sheets, although it probably should if the reference
975
+ * is to a different sheet.
976
+ *
977
+ * @public
978
+ */
979
+ ScrollTo(address: AddressReference, options?: SheetScrollOptions): void;
980
+ /**
981
+ * Resolve a string address/range to an address or area (range) object.
982
+ *
983
+ * @param reference A string like "A1" or "Sheet1!B2:C3". If a sheet name
984
+ * is not included, the current active sheet is used. You can also pass a
985
+ * named range as reference.
986
+ *
987
+ * @public
988
+ */
989
+ Resolve(reference: string, options?: {
990
+ r1c1?: boolean;
991
+ }): ICellAddress | IArea | undefined;
992
+ /**
993
+ * Convert an address/range object to a string. this is a convenience
994
+ * function for composing formulas.
995
+ *
996
+ * @param ref sheet reference as a string or structured object
997
+ * @param [qualified=true] include sheet names
998
+ * @param [named=true] resolve to named ranges, where applicable
999
+ */
1000
+ Unresolve(ref: RangeReference, qualified?: boolean, named?: boolean): string;
1001
+ /**
1002
+ * Evaluate an arbitrary expression in the spreadsheet. You should generally
1003
+ * use sheet names when referring to cells, to avoid ambiguity. Otherwise
1004
+ * cell references will resolve to the active sheet.
1005
+ *
1006
+ * @param expression - an expression in spreadsheet language
1007
+ * @param options - options for parsing the passed function
1008
+ *
1009
+ * @public
1010
+ */
1011
+ Evaluate(expression: string, options?: EvaluateOptions): CellValue | CellValue[][];
1012
+ /**
1013
+ * Returns the current selection, as a string address or range.
1014
+ *
1015
+ * @param qualified include sheet name in result. default true.
1016
+ *
1017
+ * @returns selection as a string, or empty string if there's no selection.
1018
+ *
1019
+ * @public
1020
+ */
1021
+ GetSelection(qualified?: boolean): string;
1022
+ /**
1023
+ * Parse a string and return a number (if possible).
1024
+ *
1025
+ * @privateRemarks
1026
+ *
1027
+ * We're using ValueParser, which the one used when you type into a grid
1028
+ * (not the Parser parser). It's intended to handle things that would look
1029
+ * wrong in functions, like currency symbols.
1030
+ *
1031
+ * @public
1032
+ */
1033
+ ParseNumber(text: string): number | Complex | boolean | string | undefined;
1034
+ /**
1035
+ * Format a number with an arbitrary formatter.
1036
+ *
1037
+ * @privateRemarks
1038
+ *
1039
+ * FIXME: should this support complex numbers? not sure...
1040
+ *
1041
+ * @public
1042
+ */
1043
+ FormatNumber(value: number | Complex, format?: string): string;
1044
+ /**
1045
+ * convert a javascript date (or timestamp) to a spreadsheet date
1046
+ */
1047
+ SpreadsheetDate(javascript_date: number | Date): number;
1048
+ /**
1049
+ * convert a spreadsheet date to a javascript date
1050
+ */
1051
+ JavascriptDate(spreadsheet_date: number): number;
1052
+ /**
1053
+ * Apply borders to range.
1054
+ *
1055
+ * @param range pass `undefined` as range to apply to current selection.
1056
+ *
1057
+ * @remarks
1058
+ *
1059
+ * Borders are part of style, but setting/removing borders is more
1060
+ * complicated than setting other style properties. usually you want
1061
+ * things to apply to ranges, rather than individual cells. removing
1062
+ * borders needs to consider neighbor borders. and so on.
1063
+ *
1064
+ * @public
1065
+ */
1066
+ ApplyBorders(range: RangeReference | undefined, borders: BorderConstants, width?: number): void;
1067
+ /**
1068
+ * Apply style to range.
1069
+ *
1070
+ * @param range pass `undefined` as range to apply to current selection.
1071
+ * @param delta apply over existing properties. default true.
1072
+ *
1073
+ * @remarks
1074
+ *
1075
+ * Don't use this method to set borders, use `ApplyBorders`.
1076
+ *
1077
+ * @public
1078
+ */
1079
+ ApplyStyle(range?: RangeReference, style?: CellStyle, delta?: boolean): void;
1080
+ /**
1081
+ * Remove a named range (removes the name, not the range).
1082
+ *
1083
+ * @public
1084
+ */
1085
+ ClearName(name: string): void;
1086
+ ListNames(): SerializedNamed[];
1087
+ /**
1088
+ * Create a named range or named expression. A named range refers to an
1089
+ * address or range. A named expression can be any value or formula. To set
1090
+ * the value as a literal string, enclose the string in double-quotes (as
1091
+ * you would when using a string as a function argument).
1092
+ *
1093
+ * @param value range, value or expression
1094
+ *
1095
+ * @remarks
1096
+ *
1097
+ * This function used to support passing `undefined` as the value,
1098
+ * which meant "create a named range using current selection". We don't
1099
+ * support that any more but you can accompilsh that with
1100
+ * `sheet.DefineName("Name", sheet.GetSelection())`.
1101
+ *
1102
+ * @public
1103
+ */
1104
+ DefineName(name: string, value: RangeReference | CellValue, scope?: string | number, overwrite?: boolean): void;
1105
+ /**
1106
+ * Set or remove a link in a cell.
1107
+ *
1108
+ * @param target http/https URL or a spreadsheet reference (as text). set blank to remove link.
1109
+ *
1110
+ * @public
1111
+ */
1112
+ SetLink(address?: AddressReference, target?: string): void;
1113
+ /**
1114
+ * Select a range. This function will change sheets if your reference
1115
+ * refers to a different sheet. if the argument is undefined or falsy
1116
+ * it will remove the selection (set to no selection).
1117
+ *
1118
+ * @public
1119
+ */
1120
+ Select(range?: RangeReference): void;
1121
+ /**
1122
+ * override for paste method omits the data parameter.
1123
+ */
1124
+ Paste(target?: RangeReference, options?: PasteOptions): void;
1125
+ /**
1126
+ * standard paste method accepts data argument
1127
+ *
1128
+ * @param target
1129
+ * @param data
1130
+ * @param options
1131
+ */
1132
+ Paste(target?: RangeReference, data?: ClipboardData, options?: PasteOptions): void;
1133
+ /**
1134
+ * copy data. this method returns the copied data. it does not put it on
1135
+ * the system clipboard. this is for API access when the system clipboard
1136
+ * might not be available.
1137
+ *
1138
+ * @privateRemarks LLM API
1139
+ */
1140
+ Copy(source?: RangeReference): ClipboardData;
1141
+ /**
1142
+ * cut data. this method returns the cut data. it does not put it on the
1143
+ * system clipboard. this method is similar to the Copy method, with
1144
+ * two differences: (1) we remove the source data, effectively clearing
1145
+ * the source range; and (2) the clipboard data retains references, meaning
1146
+ * if you paste the data in a different location it will refer to the same
1147
+ * cells.
1148
+ *
1149
+ * @privateRemarks LLM API
1150
+ */
1151
+ Cut(source?: RangeReference): ClipboardData;
1152
+ /**
1153
+ *
1154
+ * @param range target range. leave undefined to use current selection.
1155
+ *
1156
+ * @public
1157
+ */
1158
+ GetRange(range?: RangeReference, options?: GetRangeOptions): CellValue | CellValue[][] | undefined;
1159
+ /**
1160
+ * returns the style from the target address or range.
1161
+ *
1162
+ * @privateRemarks
1163
+ * optimally this could be consolidated with the `GetRange` function, but
1164
+ * that requires some gymnastics to manage the return type which I'm not
1165
+ * willing (at the moment) to do.
1166
+ *
1167
+ * @param range - target range. leave undefined to use current selection
1168
+ * @param apply_theme - include theme defaults when returning style
1169
+ *
1170
+ */
1171
+ GetStyle(range?: RangeReference, apply_theme?: boolean): CellStyle | CellStyle[][] | undefined;
1172
+ /**
1173
+ * Set data in range.
1174
+ *
1175
+ * @param range target range. leave undefined to use current selection.
1176
+ *
1177
+ * @public
1178
+ */
1179
+ SetRange(range?: RangeReference, data?: CellValue | CellValue[][], options?: SetRangeOptions): void;
1180
+ /**
1181
+ * Subscribe to spreadsheet events
1182
+ * @param subscriber - callback function
1183
+ * @returns a token used to cancel the subscription
1184
+ */
1185
+ Subscribe(subscriber: (event: EmbeddedSheetEvent) => void): number;
1186
+ /**
1187
+ * Cancel subscription
1188
+ * @param token - the token returned from `Subscribe`
1189
+ */
1190
+ Cancel(token: number): void;
1191
+ /**
1192
+ * overload returns undefined if no range and no selection
1193
+ */
1194
+ protected RangeOrSelection(source: RangeReference | undefined): Area | undefined;
1195
+ /**
1196
+ * overload throws if no range and no selection (pass the error to throw)
1197
+ */
1198
+ protected RangeOrSelection(source: RangeReference | undefined, error: string): Area;
1199
+ /**
1200
+ * serialize data model. moved from grid/grid base. this is moved so we
1201
+ * have access to the calculator, which we want so we can do function
1202
+ * translation on some new functions that don't necessarily map 1:1 to
1203
+ * XLSX functions. we can also do cleanup on functions where we're less
1204
+ * strict about arguments (ROUND, for example).
1205
+ *
1206
+ */
1207
+ protected Serialize(options?: SerializeOptions): SerializedModel;
1208
+ /**
1209
+ *
1210
+ */
1211
+ protected ApplyConditionalFormats(sheet: Sheet, call_update: boolean): void;
1212
+ protected ResolveTable(reference: RangeReference): Table | undefined;
1213
+ /**
1214
+ * replacement for (the great) FileSaver lib. we can now rely on all
1215
+ * browsers to handle this properly (fingers crossed).
1216
+ *
1217
+ * @param blob
1218
+ * @param filename
1219
+ */
1220
+ protected SaveAs(blob: Blob, filename: string): void;
1221
+ protected Publish(event: EmbeddedSheetEvent): void;
1222
+ /**
1223
+ *
1224
+ */
1225
+ ImportXLSX(// data: string, source: LoadSource): Promise<Blob | void> {
1226
+ data: ArrayBuffer, source: LoadSource, path?: string): Promise<Blob | void>;
1227
+ /**
1228
+ * some local cleanup, gets called in various import/load/reset functions
1229
+ * this is shrinking to the point of being unecessary... although we are
1230
+ * possibly overloading it.
1231
+ */
1232
+ protected ResetInternal(): void;
1233
+ protected HandleCellEvent(event: CellEvent): void;
1234
+ protected OnSheetChange(event: SheetChangeEvent): void;
1235
+ protected HandleDrag(event: DragEvent): void;
1236
+ protected HandleDrop(event: DragEvent): void;
1237
+ /**
1238
+ * I'm restructuring the select file routine to simplify, in service
1239
+ * of figuring out what's going wrong in OSX/Chrome. the current routine
1240
+ * is unecssarily complicated.
1241
+ *
1242
+ * the original concern was that you don't receive a "cancel" event from
1243
+ * the file chooser dialog; but that is only relevant if you have ephemeral
1244
+ * dialogs. if you have a constant dialog (html input element) you don't need
1245
+ * to do this asynchronously because the dialog blocks.
1246
+ *
1247
+ * the downside is that you can't get a return value from 'LoadFile' or
1248
+ * 'InsertImage'. not sure how much of a problem that is. need to check
1249
+ * what RAW does.
1250
+ *
1251
+ *
1252
+ * @param accept
1253
+ */
1254
+ protected SelectFile2(accept: string, operation: FileChooserOperation): void;
1255
+ /**
1256
+ * Insert an image. This method will open a file chooser and (if an image
1257
+ * is selected) insert the image into the document.
1258
+ *
1259
+ * @privateRemarks
1260
+ *
1261
+ * Should we have a separate method that takes either an Image (node) or
1262
+ * a data URI?
1263
+ */
1264
+ protected InsertImageInternal(file: File): Promise<void>;
1265
+ /** called when we have a file to write to */
1266
+ protected LoadFileInternal(file: File, source: LoadSource, dialog?: boolean): Promise<void>;
1267
+ /** testing
1268
+ *
1269
+ * this is called after recalc, check any annotations
1270
+ * (just sparklines atm) and update if necessary.
1271
+ */
1272
+ protected UpdateAnnotations(): void;
1273
+ protected UpdateConnectedElements(): void;
1274
+ /**
1275
+ * this method should be called after changing the headless flag
1276
+ */
1277
+ protected RebuildAllAnnotations(): void;
1278
+ /**
1279
+ * inflate all annotations. intended to be called after a document
1280
+ * load (including undo), which does not send `create` events.
1281
+ *
1282
+ * FIXME: why is this public?
1283
+ */
1284
+ protected InflateAnnotations(): void;
1285
+ protected InflateAnnotation(annotation: Annotation): void;
1286
+ /**
1287
+ * save sheet to local storage and trigger (push) undo. our undo system
1288
+ * relies on tracking selection after storing the main data, and sometimes
1289
+ * we need to manage this explicitly: hence the parameter.
1290
+ *
1291
+ */
1292
+ protected DocumentChange(undo_selection?: string): void;
1293
+ /**
1294
+ * if we have a boolean for a storage key, generate a (weak) hash
1295
+ * based on document URI. use the prefix to create separate keys
1296
+ * when using the autogenerated key (uri hash)
1297
+ */
1298
+ protected ResolveStorageKey(key?: string | boolean, prefix?: string): string | undefined;
1299
+ /**
1300
+ *
1301
+ * @param json -- the serialized data is already calculated. that happens
1302
+ * when we are storing to localStorage as part of handling a change; since
1303
+ * we already have the json, we can pass it through. although we should
1304
+ * switch around the order, it would make it a little easier to manage.
1305
+ *
1306
+ * @param increment -- increment the file version. this is a parameter
1307
+ * so we can _not_ increment on the initial state push, on load.
1308
+ */
1309
+ protected PushUndo(json?: string, last_selection?: string, increment?: boolean): void;
1310
+ /**
1311
+ * clear the undo stack, and optionally push an initial state
1312
+ */
1313
+ protected FlushUndo(push?: boolean): void;
1314
+ /**
1315
+ * update selection: used for updating toolbar (i.e. highlight bold button)
1316
+ *
1317
+ * we can also use this to better manage selection in the undo system...
1318
+ *
1319
+ */
1320
+ protected UpdateSelection(selection: GridSelection, reason?: GridSelectionEvent['reason']): void;
1321
+ /** update selection style for the toolbar, when an annotation is selected. */
1322
+ protected UpdateSelectionStyleAnnotation(annotation: Annotation): void;
1323
+ /** update selection style for the toolbar */
1324
+ protected UpdateSelectionStyle(selection?: GridSelection): void;
1325
+ protected UpdateDocumentStyles(): void;
1326
+ /**
1327
+ * this function is called when the file locale (as indicated by the
1328
+ * decimal separator) is different than the current active locale.
1329
+ *
1330
+ * so we know that we want to translate. that's why there are no tests
1331
+ * in this function.
1332
+ */
1333
+ protected ConvertLocale(data: TREBDocument): void;
1334
+ /**
1335
+ * compare two semantic versions. returns an object indicating
1336
+ * the greater version (or equal), plus individual component comparisons.
1337
+ *
1338
+ * FIXME: move to util lib?
1339
+ */
1340
+ protected CompareVersions(a?: string, b?: string): SemanticVersionComparison;
1341
+ /**
1342
+ * import data from serialized document, doing locale conversion if necessary
1343
+ */
1344
+ protected ImportDocumentData(data: TREBDocument, override_sheet?: string): void;
1345
+ /**
1346
+ * switching to worker proxy so we can support node
1347
+ * FIXME: type
1348
+ */
1349
+ protected LoadWorker(): Promise<WorkerProxy<ImportExportMessages.RXMessages, ImportExportMessages.TXMessages>>;
1350
+ /**
1351
+ * handle key down to intercept ctrl+z (undo)
1352
+ * UPDATE: we're also handling F9 for recalc (optionally)
1353
+ *
1354
+ * FIXME: redo (ctrl+y or ctrl+shift+z)
1355
+ */
1356
+ protected HandleKeyDown(event: KeyboardEvent): void;
1357
+ }
1358
+ export {};