@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.
- package/api-config.json +1 -1
- package/build/package.json +119 -0
- package/build/treb-base-types/src/api_types.d.ts +11 -0
- package/build/treb-base-types/src/api_types.js +22 -0
- package/build/treb-base-types/src/api_types.js.map +1 -0
- package/build/treb-base-types/src/area-utils.d.ts +9 -0
- package/build/treb-base-types/src/area-utils.js +50 -0
- package/build/treb-base-types/src/area-utils.js.map +1 -0
- package/build/treb-base-types/src/area.d.ts +182 -0
- package/build/treb-base-types/src/area.js +715 -0
- package/build/treb-base-types/src/area.js.map +1 -0
- package/build/treb-base-types/src/basic_types.d.ts +20 -0
- package/build/treb-base-types/src/basic_types.js +22 -0
- package/build/treb-base-types/src/basic_types.js.map +1 -0
- package/build/treb-base-types/src/cell.d.ts +167 -0
- package/build/treb-base-types/src/cell.js +432 -0
- package/build/treb-base-types/src/cell.js.map +1 -0
- package/build/treb-base-types/src/cells.d.ts +251 -0
- package/build/treb-base-types/src/cells.js +1136 -0
- package/build/treb-base-types/src/cells.js.map +1 -0
- package/build/treb-base-types/src/color.d.ts +35 -0
- package/build/treb-base-types/src/color.js +162 -0
- package/build/treb-base-types/src/color.js.map +1 -0
- package/build/treb-base-types/src/dom-utilities.d.ts +70 -0
- package/build/treb-base-types/src/dom-utilities.js +144 -0
- package/build/treb-base-types/src/dom-utilities.js.map +1 -0
- package/build/treb-base-types/src/evaluate-options.d.ts +35 -0
- package/build/treb-base-types/src/evaluate-options.js +22 -0
- package/build/treb-base-types/src/evaluate-options.js.map +1 -0
- package/build/treb-base-types/src/font-stack.d.ts +37 -0
- package/build/treb-base-types/src/font-stack.js +93 -0
- package/build/treb-base-types/src/font-stack.js.map +1 -0
- package/build/treb-base-types/src/gradient.d.ts +18 -0
- package/build/treb-base-types/src/gradient.js +86 -0
- package/build/treb-base-types/src/gradient.js.map +1 -0
- package/build/treb-base-types/src/import.d.ts +48 -0
- package/build/treb-base-types/src/import.js +22 -0
- package/build/treb-base-types/src/import.js.map +1 -0
- package/build/treb-base-types/src/index-standalone.d.ts +6 -0
- package/build/treb-base-types/src/index-standalone.js +27 -0
- package/build/treb-base-types/src/index-standalone.js.map +1 -0
- package/build/treb-base-types/src/index.d.ts +22 -0
- package/build/treb-base-types/src/index.js +45 -0
- package/build/treb-base-types/src/index.js.map +1 -0
- package/build/treb-base-types/src/layout.d.ts +22 -0
- package/build/treb-base-types/src/layout.js +22 -0
- package/build/treb-base-types/src/layout.js.map +1 -0
- package/build/treb-base-types/src/localization.d.ts +37 -0
- package/build/treb-base-types/src/localization.js +157 -0
- package/build/treb-base-types/src/localization.js.map +1 -0
- package/build/treb-base-types/src/rectangle.d.ts +51 -0
- package/build/treb-base-types/src/rectangle.js +123 -0
- package/build/treb-base-types/src/rectangle.js.map +1 -0
- package/build/treb-base-types/src/render_text.d.ts +34 -0
- package/build/treb-base-types/src/render_text.js +22 -0
- package/build/treb-base-types/src/render_text.js.map +1 -0
- package/build/treb-base-types/src/style.d.ts +214 -0
- package/build/treb-base-types/src/style.js +373 -0
- package/build/treb-base-types/src/style.js.map +1 -0
- package/build/treb-base-types/src/table.d.ts +58 -0
- package/build/treb-base-types/src/table.js +27 -0
- package/build/treb-base-types/src/table.js.map +1 -0
- package/build/treb-base-types/src/text_part.d.ts +26 -0
- package/build/treb-base-types/src/text_part.js +47 -0
- package/build/treb-base-types/src/text_part.js.map +1 -0
- package/build/treb-base-types/src/theme.d.ts +120 -0
- package/build/treb-base-types/src/theme.js +460 -0
- package/build/treb-base-types/src/theme.js.map +1 -0
- package/build/treb-base-types/src/union.d.ts +73 -0
- package/build/treb-base-types/src/union.js +61 -0
- package/build/treb-base-types/src/union.js.map +1 -0
- package/build/treb-base-types/src/value-type.d.ts +86 -0
- package/build/treb-base-types/src/value-type.js +168 -0
- package/build/treb-base-types/src/value-type.js.map +1 -0
- package/build/treb-base-types/src/worker-proxy.d.ts +95 -0
- package/build/treb-base-types/src/worker-proxy.js +221 -0
- package/build/treb-base-types/src/worker-proxy.js.map +1 -0
- package/build/treb-calculator/src/calculator.d.ts +249 -0
- package/build/treb-calculator/src/calculator.js +2755 -0
- package/build/treb-calculator/src/calculator.js.map +1 -0
- package/build/treb-calculator/src/complex-math.d.ts +75 -0
- package/build/treb-calculator/src/complex-math.js +559 -0
- package/build/treb-calculator/src/complex-math.js.map +1 -0
- package/build/treb-calculator/src/dag/array-vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/array-vertex.js +156 -0
- package/build/treb-calculator/src/dag/array-vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.d.ts +48 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js +84 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/graph.d.ts +134 -0
- package/build/treb-calculator/src/dag/graph.js +842 -0
- package/build/treb-calculator/src/dag/graph.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.d.ts +58 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js +232 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.d.ts +20 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js +25 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js.map +1 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.d.ts +43 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js +81 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/vertex.js +274 -0
- package/build/treb-calculator/src/dag/vertex.js.map +1 -0
- package/build/treb-calculator/src/descriptors.d.ts +189 -0
- package/build/treb-calculator/src/descriptors.js +22 -0
- package/build/treb-calculator/src/descriptors.js.map +1 -0
- package/build/treb-calculator/src/expression-calculator.d.ts +127 -0
- package/build/treb-calculator/src/expression-calculator.js +1033 -0
- package/build/treb-calculator/src/expression-calculator.js.map +1 -0
- package/build/treb-calculator/src/function-error.d.ts +35 -0
- package/build/treb-calculator/src/function-error.js +85 -0
- package/build/treb-calculator/src/function-error.js.map +1 -0
- package/build/treb-calculator/src/function-library.d.ts +22 -0
- package/build/treb-calculator/src/function-library.js +96 -0
- package/build/treb-calculator/src/function-library.js.map +1 -0
- package/build/treb-calculator/src/functions/base-functions.d.ts +7 -0
- package/build/treb-calculator/src/functions/base-functions.js +2611 -0
- package/build/treb-calculator/src/functions/base-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/beta.d.ts +17 -0
- package/build/treb-calculator/src/functions/beta.js +201 -0
- package/build/treb-calculator/src/functions/beta.js.map +1 -0
- package/build/treb-calculator/src/functions/checkbox.d.ts +3 -0
- package/build/treb-calculator/src/functions/checkbox.js +128 -0
- package/build/treb-calculator/src/functions/checkbox.js.map +1 -0
- package/build/treb-calculator/src/functions/complex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/complex-functions.js +217 -0
- package/build/treb-calculator/src/functions/complex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/date-utils.d.ts +3 -0
- package/build/treb-calculator/src/functions/date-utils.js +59 -0
- package/build/treb-calculator/src/functions/date-utils.js.map +1 -0
- package/build/treb-calculator/src/functions/finance-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/finance-functions.js +547 -0
- package/build/treb-calculator/src/functions/finance-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/fp.d.ts +2 -0
- package/build/treb-calculator/src/functions/fp.js +463 -0
- package/build/treb-calculator/src/functions/fp.js.map +1 -0
- package/build/treb-calculator/src/functions/function-utilities.d.ts +2 -0
- package/build/treb-calculator/src/functions/function-utilities.js +36 -0
- package/build/treb-calculator/src/functions/function-utilities.js.map +1 -0
- package/build/treb-calculator/src/functions/gamma.d.ts +20 -0
- package/build/treb-calculator/src/functions/gamma.js +142 -0
- package/build/treb-calculator/src/functions/gamma.js.map +1 -0
- package/build/treb-calculator/src/functions/information-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/information-functions.js +71 -0
- package/build/treb-calculator/src/functions/information-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/lambda-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/lambda-functions.js +85 -0
- package/build/treb-calculator/src/functions/lambda-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/matrix-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/matrix-functions.js +144 -0
- package/build/treb-calculator/src/functions/matrix-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/normal.d.ts +2 -0
- package/build/treb-calculator/src/functions/normal.js +32 -0
- package/build/treb-calculator/src/functions/normal.js.map +1 -0
- package/build/treb-calculator/src/functions/regex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/regex-functions.js +188 -0
- package/build/treb-calculator/src/functions/regex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/sparkline.d.ts +37 -0
- package/build/treb-calculator/src/functions/sparkline.js +264 -0
- package/build/treb-calculator/src/functions/sparkline.js.map +1 -0
- package/build/treb-calculator/src/functions/statistics-functions.d.ts +6 -0
- package/build/treb-calculator/src/functions/statistics-functions.js +989 -0
- package/build/treb-calculator/src/functions/statistics-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/students-t.d.ts +3 -0
- package/build/treb-calculator/src/functions/students-t.js +64 -0
- package/build/treb-calculator/src/functions/students-t.js.map +1 -0
- package/build/treb-calculator/src/functions/text-functions.d.ts +3 -0
- package/build/treb-calculator/src/functions/text-functions.js +320 -0
- package/build/treb-calculator/src/functions/text-functions.js.map +1 -0
- package/build/treb-calculator/src/index.d.ts +2 -0
- package/build/treb-calculator/src/index.js +22 -0
- package/build/treb-calculator/src/index.js.map +1 -0
- package/build/treb-calculator/src/notifier-types.d.ts +26 -0
- package/build/treb-calculator/src/notifier-types.js +22 -0
- package/build/treb-calculator/src/notifier-types.js.map +1 -0
- package/build/treb-calculator/src/primitives.d.ts +15 -0
- package/build/treb-calculator/src/primitives.js +398 -0
- package/build/treb-calculator/src/primitives.js.map +1 -0
- package/build/treb-calculator/src/utilities.d.ts +68 -0
- package/build/treb-calculator/src/utilities.js +324 -0
- package/build/treb-calculator/src/utilities.js.map +1 -0
- package/build/treb-charts/src/chart-functions.d.ts +8 -0
- package/build/treb-charts/src/chart-functions.js +209 -0
- package/build/treb-charts/src/chart-functions.js.map +1 -0
- package/build/treb-charts/src/chart-types.d.ts +233 -0
- package/build/treb-charts/src/chart-types.js +57 -0
- package/build/treb-charts/src/chart-types.js.map +1 -0
- package/build/treb-charts/src/chart-utils.d.ts +106 -0
- package/build/treb-charts/src/chart-utils.js +1060 -0
- package/build/treb-charts/src/chart-utils.js.map +1 -0
- package/build/treb-charts/src/chart.d.ts +23 -0
- package/build/treb-charts/src/chart.js +94 -0
- package/build/treb-charts/src/chart.js.map +1 -0
- package/build/treb-charts/src/default-chart-renderer.d.ts +16 -0
- package/build/treb-charts/src/default-chart-renderer.js +533 -0
- package/build/treb-charts/src/default-chart-renderer.js.map +1 -0
- package/build/treb-charts/src/index.d.ts +5 -0
- package/build/treb-charts/src/index.js +24 -0
- package/build/treb-charts/src/index.js.map +1 -0
- package/build/treb-charts/src/main.d.ts +1 -0
- package/build/treb-charts/src/main.js +34 -0
- package/build/treb-charts/src/main.js.map +1 -0
- package/build/treb-charts/src/quicksort.d.ts +1 -0
- package/build/treb-charts/src/quicksort.js +49 -0
- package/build/treb-charts/src/quicksort.js.map +1 -0
- package/build/treb-charts/src/rectangle.d.ts +18 -0
- package/build/treb-charts/src/rectangle.js +41 -0
- package/build/treb-charts/src/rectangle.js.map +1 -0
- package/build/treb-charts/src/renderer-type.d.ts +24 -0
- package/build/treb-charts/src/renderer-type.js +22 -0
- package/build/treb-charts/src/renderer-type.js.map +1 -0
- package/build/treb-charts/src/renderer.d.ts +127 -0
- package/build/treb-charts/src/renderer.js +1518 -0
- package/build/treb-charts/src/renderer.js.map +1 -0
- package/build/treb-charts/src/util.d.ts +18 -0
- package/build/treb-charts/src/util.js +71 -0
- package/build/treb-charts/src/util.js.map +1 -0
- package/build/treb-data-model/src/annotation.d.ts +167 -0
- package/build/treb-data-model/src/annotation.js +120 -0
- package/build/treb-data-model/src/annotation.js.map +1 -0
- package/build/treb-data-model/src/conditional_format.d.ts +155 -0
- package/build/treb-data-model/src/conditional_format.js +62 -0
- package/build/treb-data-model/src/conditional_format.js.map +1 -0
- package/build/treb-data-model/src/data-validation.d.ts +28 -0
- package/build/treb-data-model/src/data-validation.js +22 -0
- package/build/treb-data-model/src/data-validation.js.map +1 -0
- package/build/treb-data-model/src/data_model.d.ts +173 -0
- package/build/treb-data-model/src/data_model.js +637 -0
- package/build/treb-data-model/src/data_model.js.map +1 -0
- package/build/treb-data-model/src/index.d.ts +13 -0
- package/build/treb-data-model/src/index.js +28 -0
- package/build/treb-data-model/src/index.js.map +1 -0
- package/build/treb-data-model/src/language-model.d.ts +22 -0
- package/build/treb-data-model/src/language-model.js +22 -0
- package/build/treb-data-model/src/language-model.js.map +1 -0
- package/build/treb-data-model/src/named.d.ts +124 -0
- package/build/treb-data-model/src/named.js +372 -0
- package/build/treb-data-model/src/named.js.map +1 -0
- package/build/treb-data-model/src/serialize_options.d.ts +49 -0
- package/build/treb-data-model/src/serialize_options.js +22 -0
- package/build/treb-data-model/src/serialize_options.js.map +1 -0
- package/build/treb-data-model/src/sheet.d.ts +499 -0
- package/build/treb-data-model/src/sheet.js +2904 -0
- package/build/treb-data-model/src/sheet.js.map +1 -0
- package/build/treb-data-model/src/sheet_collection.d.ts +58 -0
- package/build/treb-data-model/src/sheet_collection.js +112 -0
- package/build/treb-data-model/src/sheet_collection.js.map +1 -0
- package/build/treb-data-model/src/sheet_selection.d.ts +42 -0
- package/build/treb-data-model/src/sheet_selection.js +39 -0
- package/build/treb-data-model/src/sheet_selection.js.map +1 -0
- package/build/treb-data-model/src/sheet_types.d.ts +104 -0
- package/build/treb-data-model/src/sheet_types.js +22 -0
- package/build/treb-data-model/src/sheet_types.js.map +1 -0
- package/build/treb-data-model/src/types.d.ts +59 -0
- package/build/treb-data-model/src/types.js +22 -0
- package/build/treb-data-model/src/types.js.map +1 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.d.ts +75 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js +1144 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-global.d.ts +36 -0
- package/build/treb-embed/src/custom-element/treb-global.js +64 -0
- package/build/treb-embed/src/custom-element/treb-global.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.d.ts +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js +61 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js.map +1 -0
- package/build/treb-embed/src/embedded-spreadsheet.d.ts +1358 -0
- package/build/treb-embed/src/embedded-spreadsheet.js +5205 -0
- package/build/treb-embed/src/embedded-spreadsheet.js.map +1 -0
- package/build/treb-embed/src/index.d.ts +12 -0
- package/build/treb-embed/src/index.js +34 -0
- package/build/treb-embed/src/index.js.map +1 -0
- package/build/treb-embed/src/options.d.ts +266 -0
- package/build/treb-embed/src/options.js +56 -0
- package/build/treb-embed/src/options.js.map +1 -0
- package/build/treb-embed/src/plugin.d.ts +9 -0
- package/build/treb-embed/src/plugin.js +22 -0
- package/build/treb-embed/src/plugin.js.map +1 -0
- package/build/treb-embed/src/progress-dialog.d.ts +49 -0
- package/build/treb-embed/src/progress-dialog.js +178 -0
- package/build/treb-embed/src/progress-dialog.js.map +1 -0
- package/build/treb-embed/src/selection-state.d.ts +15 -0
- package/build/treb-embed/src/selection-state.js +22 -0
- package/build/treb-embed/src/selection-state.js.map +1 -0
- package/build/treb-embed/src/spinner.d.ts +8 -0
- package/build/treb-embed/src/spinner.js +40 -0
- package/build/treb-embed/src/spinner.js.map +1 -0
- package/build/treb-embed/src/toolbar-message.d.ts +72 -0
- package/build/treb-embed/src/toolbar-message.js +22 -0
- package/build/treb-embed/src/toolbar-message.js.map +1 -0
- package/build/treb-embed/src/types.d.ts +185 -0
- package/build/treb-embed/src/types.js +45 -0
- package/build/treb-embed/src/types.js.map +1 -0
- package/build/treb-embed/tsconfig.tsbuildinfo +1 -0
- package/build/treb-export/src/address-type.d.ts +34 -0
- package/build/treb-export/src/address-type.js +53 -0
- package/build/treb-export/src/address-type.js.map +1 -0
- package/build/treb-export/src/base-template.d.ts +1 -0
- package/build/treb-export/src/base-template.js +22 -0
- package/build/treb-export/src/base-template.js.map +1 -0
- package/build/treb-export/src/column-width.d.ts +2 -0
- package/build/treb-export/src/column-width.js +80 -0
- package/build/treb-export/src/column-width.js.map +1 -0
- package/build/treb-export/src/drawing/bubble-chart-template.d.ts +514 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js +544 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js.map +1 -0
- package/build/treb-export/src/drawing/chart-template-components2.d.ts +365 -0
- package/build/treb-export/src/drawing/chart-template-components2.js +386 -0
- package/build/treb-export/src/drawing/chart-template-components2.js.map +1 -0
- package/build/treb-export/src/drawing/chart.d.ts +26 -0
- package/build/treb-export/src/drawing/chart.js +247 -0
- package/build/treb-export/src/drawing/chart.js.map +1 -0
- package/build/treb-export/src/drawing/column-chart-template2.d.ts +490 -0
- package/build/treb-export/src/drawing/column-chart-template2.js +518 -0
- package/build/treb-export/src/drawing/column-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/donut-chart-template2.d.ts +272 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js +293 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/drawing.d.ts +49 -0
- package/build/treb-export/src/drawing/drawing.js +193 -0
- package/build/treb-export/src/drawing/drawing.js.map +1 -0
- package/build/treb-export/src/drawing/embedded-image.d.ts +12 -0
- package/build/treb-export/src/drawing/embedded-image.js +54 -0
- package/build/treb-export/src/drawing/embedded-image.js.map +1 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.d.ts +520 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js +551 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js.map +1 -0
- package/build/treb-export/src/export.d.ts +72 -0
- package/build/treb-export/src/export.js +2039 -0
- package/build/treb-export/src/export.js.map +1 -0
- package/build/treb-export/src/import-export-messages.d.ts +31 -0
- package/build/treb-export/src/import-export-messages.js +22 -0
- package/build/treb-export/src/import-export-messages.js.map +1 -0
- package/build/treb-export/src/import.d.ts +33 -0
- package/build/treb-export/src/import.js +1258 -0
- package/build/treb-export/src/import.js.map +1 -0
- package/build/treb-export/src/index.worker.d.ts +1 -0
- package/build/treb-export/src/index.worker.js +93 -0
- package/build/treb-export/src/index.worker.js.map +1 -0
- package/build/treb-export/src/metadata.d.ts +51 -0
- package/build/treb-export/src/metadata.js +153 -0
- package/build/treb-export/src/metadata.js.map +1 -0
- package/build/treb-export/src/ooxml.d.ts +7 -0
- package/build/treb-export/src/ooxml.js +41 -0
- package/build/treb-export/src/ooxml.js.map +1 -0
- package/build/treb-export/src/relationship.d.ts +8 -0
- package/build/treb-export/src/relationship.js +27 -0
- package/build/treb-export/src/relationship.js.map +1 -0
- package/build/treb-export/src/shared-strings.d.ts +11 -0
- package/build/treb-export/src/shared-strings.js +105 -0
- package/build/treb-export/src/shared-strings.js.map +1 -0
- package/build/treb-export/src/template-2.d.ts +1 -0
- package/build/treb-export/src/template-2.js +22 -0
- package/build/treb-export/src/template-2.js.map +1 -0
- package/build/treb-export/src/unescape_xml.d.ts +1 -0
- package/build/treb-export/src/unescape_xml.js +61 -0
- package/build/treb-export/src/unescape_xml.js.map +1 -0
- package/build/treb-export/src/workbook-sheet.d.ts +75 -0
- package/build/treb-export/src/workbook-sheet.js +128 -0
- package/build/treb-export/src/workbook-sheet.js.map +1 -0
- package/build/treb-export/src/workbook-style.d.ts +110 -0
- package/build/treb-export/src/workbook-style.js +1134 -0
- package/build/treb-export/src/workbook-style.js.map +1 -0
- package/build/treb-export/src/workbook-theme.d.ts +13 -0
- package/build/treb-export/src/workbook-theme.js +85 -0
- package/build/treb-export/src/workbook-theme.js.map +1 -0
- package/build/treb-export/src/workbook.d.ts +123 -0
- package/build/treb-export/src/workbook.js +644 -0
- package/build/treb-export/src/workbook.js.map +1 -0
- package/build/treb-export/src/xml-test.d.ts +9 -0
- package/build/treb-export/src/xml-test.js +52 -0
- package/build/treb-export/src/xml-test.js.map +1 -0
- package/build/treb-export/src/xml-utils.d.ts +76 -0
- package/build/treb-export/src/xml-utils.js +223 -0
- package/build/treb-export/src/xml-utils.js.map +1 -0
- package/build/treb-export/src/zip-wrapper.d.ts +22 -0
- package/build/treb-export/src/zip-wrapper.js +93 -0
- package/build/treb-export/src/zip-wrapper.js.map +1 -0
- package/build/treb-format/src/format.d.ts +130 -0
- package/build/treb-format/src/format.js +805 -0
- package/build/treb-format/src/format.js.map +1 -0
- package/build/treb-format/src/format_cache.d.ts +55 -0
- package/build/treb-format/src/format_cache.js +166 -0
- package/build/treb-format/src/format_cache.js.map +1 -0
- package/build/treb-format/src/format_parser.d.ts +70 -0
- package/build/treb-format/src/format_parser.js +618 -0
- package/build/treb-format/src/format_parser.js.map +1 -0
- package/build/treb-format/src/index.d.ts +4 -0
- package/build/treb-format/src/index.js +25 -0
- package/build/treb-format/src/index.js.map +1 -0
- package/build/treb-format/src/number_format_section.d.ts +58 -0
- package/build/treb-format/src/number_format_section.js +78 -0
- package/build/treb-format/src/number_format_section.js.map +1 -0
- package/build/treb-format/src/value_parser.d.ts +48 -0
- package/build/treb-format/src/value_parser.js +244 -0
- package/build/treb-format/src/value_parser.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete.d.ts +39 -0
- package/build/treb-grid/src/editors/autocomplete.js +316 -0
- package/build/treb-grid/src/editors/autocomplete.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.d.ts +74 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js +212 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js.map +1 -0
- package/build/treb-grid/src/editors/editor.d.ts +214 -0
- package/build/treb-grid/src/editors/editor.js +879 -0
- package/build/treb-grid/src/editors/editor.js.map +1 -0
- package/build/treb-grid/src/editors/external_editor.d.ts +11 -0
- package/build/treb-grid/src/editors/external_editor.js +118 -0
- package/build/treb-grid/src/editors/external_editor.js.map +1 -0
- package/build/treb-grid/src/editors/formula_bar.d.ts +85 -0
- package/build/treb-grid/src/editors/formula_bar.js +444 -0
- package/build/treb-grid/src/editors/formula_bar.js.map +1 -0
- package/build/treb-grid/src/editors/overlay_editor.d.ts +85 -0
- package/build/treb-grid/src/editors/overlay_editor.js +353 -0
- package/build/treb-grid/src/editors/overlay_editor.js.map +1 -0
- package/build/treb-grid/src/index.d.ts +12 -0
- package/build/treb-grid/src/index.js +28 -0
- package/build/treb-grid/src/index.js.map +1 -0
- package/build/treb-grid/src/layout/base_layout.d.ts +346 -0
- package/build/treb-grid/src/layout/base_layout.js +2050 -0
- package/build/treb-grid/src/layout/base_layout.js.map +1 -0
- package/build/treb-grid/src/layout/grid_layout.d.ts +19 -0
- package/build/treb-grid/src/layout/grid_layout.js +235 -0
- package/build/treb-grid/src/layout/grid_layout.js.map +1 -0
- package/build/treb-grid/src/layout/mock-layout.d.ts +10 -0
- package/build/treb-grid/src/layout/mock-layout.js +37 -0
- package/build/treb-grid/src/layout/mock-layout.js.map +1 -0
- package/build/treb-grid/src/render/selection-renderer.d.ts +97 -0
- package/build/treb-grid/src/render/selection-renderer.js +315 -0
- package/build/treb-grid/src/render/selection-renderer.js.map +1 -0
- package/build/treb-grid/src/render/svg_header_overlay.d.ts +20 -0
- package/build/treb-grid/src/render/svg_header_overlay.js +76 -0
- package/build/treb-grid/src/render/svg_header_overlay.js.map +1 -0
- package/build/treb-grid/src/render/svg_selection_block.d.ts +27 -0
- package/build/treb-grid/src/render/svg_selection_block.js +106 -0
- package/build/treb-grid/src/render/svg_selection_block.js.map +1 -0
- package/build/treb-grid/src/render/tile_renderer.d.ts +121 -0
- package/build/treb-grid/src/render/tile_renderer.js +1609 -0
- package/build/treb-grid/src/render/tile_renderer.js.map +1 -0
- package/build/treb-grid/src/types/border_constants.d.ts +9 -0
- package/build/treb-grid/src/types/border_constants.js +34 -0
- package/build/treb-grid/src/types/border_constants.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data.d.ts +11 -0
- package/build/treb-grid/src/types/clipboard_data.js +22 -0
- package/build/treb-grid/src/types/clipboard_data.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data2.d.ts +46 -0
- package/build/treb-grid/src/types/clipboard_data2.js +22 -0
- package/build/treb-grid/src/types/clipboard_data2.js.map +1 -0
- package/build/treb-grid/src/types/drag_mask.d.ts +10 -0
- package/build/treb-grid/src/types/drag_mask.js +78 -0
- package/build/treb-grid/src/types/drag_mask.js.map +1 -0
- package/build/treb-grid/src/types/external_editor_config.d.ts +33 -0
- package/build/treb-grid/src/types/external_editor_config.js +22 -0
- package/build/treb-grid/src/types/external_editor_config.js.map +1 -0
- package/build/treb-grid/src/types/grid.d.ts +806 -0
- package/build/treb-grid/src/types/grid.js +6410 -0
- package/build/treb-grid/src/types/grid.js.map +1 -0
- package/build/treb-grid/src/types/grid_base.d.ts +442 -0
- package/build/treb-grid/src/types/grid_base.js +3523 -0
- package/build/treb-grid/src/types/grid_base.js.map +1 -0
- package/build/treb-grid/src/types/grid_command.d.ts +408 -0
- package/build/treb-grid/src/types/grid_command.js +75 -0
- package/build/treb-grid/src/types/grid_command.js.map +1 -0
- package/build/treb-grid/src/types/grid_events.d.ts +93 -0
- package/build/treb-grid/src/types/grid_events.js +36 -0
- package/build/treb-grid/src/types/grid_events.js.map +1 -0
- package/build/treb-grid/src/types/grid_options.d.ts +50 -0
- package/build/treb-grid/src/types/grid_options.js +34 -0
- package/build/treb-grid/src/types/grid_options.js.map +1 -0
- package/build/treb-grid/src/types/scale-control.d.ts +21 -0
- package/build/treb-grid/src/types/scale-control.js +148 -0
- package/build/treb-grid/src/types/scale-control.js.map +1 -0
- package/build/treb-grid/src/types/set_range_options.d.ts +24 -0
- package/build/treb-grid/src/types/set_range_options.js +22 -0
- package/build/treb-grid/src/types/set_range_options.js.map +1 -0
- package/build/treb-grid/src/types/tab_bar.d.ts +84 -0
- package/build/treb-grid/src/types/tab_bar.js +426 -0
- package/build/treb-grid/src/types/tab_bar.js.map +1 -0
- package/build/treb-grid/src/types/tile.d.ts +29 -0
- package/build/treb-grid/src/types/tile.js +22 -0
- package/build/treb-grid/src/types/tile.js.map +1 -0
- package/build/treb-grid/src/types/update_flags.d.ts +48 -0
- package/build/treb-grid/src/types/update_flags.js +22 -0
- package/build/treb-grid/src/types/update_flags.js.map +1 -0
- package/build/treb-grid/src/util/fontmetrics.d.ts +21 -0
- package/build/treb-grid/src/util/fontmetrics.js +82 -0
- package/build/treb-grid/src/util/fontmetrics.js.map +1 -0
- package/build/treb-grid/src/util/ua.d.ts +33 -0
- package/build/treb-grid/src/util/ua.js +86 -0
- package/build/treb-grid/src/util/ua.js.map +1 -0
- package/build/treb-parser/src/csv-parser.d.ts +13 -0
- package/build/treb-parser/src/csv-parser.js +107 -0
- package/build/treb-parser/src/csv-parser.js.map +1 -0
- package/build/treb-parser/src/index.d.ts +4 -0
- package/build/treb-parser/src/index.js +25 -0
- package/build/treb-parser/src/index.js.map +1 -0
- package/build/treb-parser/src/md-parser.d.ts +97 -0
- package/build/treb-parser/src/md-parser.js +403 -0
- package/build/treb-parser/src/md-parser.js.map +1 -0
- package/build/treb-parser/src/parser-types.d.ts +345 -0
- package/build/treb-parser/src/parser-types.js +53 -0
- package/build/treb-parser/src/parser-types.js.map +1 -0
- package/build/treb-parser/src/parser.d.ts +422 -0
- package/build/treb-parser/src/parser.js +2418 -0
- package/build/treb-parser/src/parser.js.map +1 -0
- package/build/treb-utils/src/event_source.d.ts +34 -0
- package/build/treb-utils/src/event_source.js +110 -0
- package/build/treb-utils/src/event_source.js.map +1 -0
- package/build/treb-utils/src/ievent_source.d.ts +9 -0
- package/build/treb-utils/src/ievent_source.js +22 -0
- package/build/treb-utils/src/ievent_source.js.map +1 -0
- package/build/treb-utils/src/index.d.ts +6 -0
- package/build/treb-utils/src/index.js +30 -0
- package/build/treb-utils/src/index.js.map +1 -0
- package/build/treb-utils/src/measurement.d.ts +42 -0
- package/build/treb-utils/src/measurement.js +145 -0
- package/build/treb-utils/src/measurement.js.map +1 -0
- package/build/treb-utils/src/scale.d.ts +16 -0
- package/build/treb-utils/src/scale.js +106 -0
- package/build/treb-utils/src/scale.js.map +1 -0
- package/build/treb-utils/src/serialize_html.d.ts +5 -0
- package/build/treb-utils/src/serialize_html.js +128 -0
- package/build/treb-utils/src/serialize_html.js.map +1 -0
- package/build/treb-utils/src/validate_uri.d.ts +20 -0
- package/build/treb-utils/src/validate_uri.js +55 -0
- package/build/treb-utils/src/validate_uri.js.map +1 -0
- package/dist/{chunk-Z4XFMZ2X.mjs → chunk-E35ONJUS.mjs} +1 -1
- package/dist/treb-export-worker.mjs +2 -2
- package/dist/treb-spreadsheet.mjs +4 -4
- package/dist/treb.d.ts +1 -1
- package/esbuild-composite.mjs +5 -1
- package/package.json +67 -3
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +7 -3
- package/treb-embed/src/embedded-spreadsheet.ts +1 -1
- package/treb-grid/src/types/grid_options.ts +1 -1
- package/tsproject.json +1 -2
- package/dist/chunk-43DLP2OX.mjs +0 -11
- package/dist/chunk-4CKS56PE.mjs +0 -11
- package/dist/chunk-75PARUQE.mjs +0 -11
- package/dist/chunk-7QD63AZS.mjs +0 -24601
- package/dist/chunk-A55ARVRD.mjs +0 -11
- package/dist/chunk-DESAKYW4.mjs +0 -11
- package/dist/chunk-EQ2R5W6P.mjs +0 -24565
- package/dist/chunk-IYJU2J6D.mjs +0 -24601
- package/dist/chunk-KSJFPGXT.mjs +0 -11
- package/dist/chunk-MQK4DNXI.mjs +0 -11
- package/dist/chunk-ORQFKLXM.mjs +0 -24601
- package/dist/chunk-SFDNNDHY.mjs +0 -11
- package/dist/chunk-T47DX5MI.mjs +0 -11
- package/dist/chunk-T6ILBVEX.mjs +0 -11
- package/dist/chunk-TPRCDYYG.mjs +0 -11
- package/dist/chunk-YAHNOOHO.mjs +0 -11
- package/dist/chunk-YLCFKX2G.mjs +0 -24601
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* colors for the CLRS color algorithm.
|
|
23
|
+
*
|
|
24
|
+
* these colors are useful because gray is "in between" white and black, but
|
|
25
|
+
* (outside of the general move away from using white/black as identifiers) it
|
|
26
|
+
* might be easier to conceptualize with descriptive labels like "untested"
|
|
27
|
+
* (white), "being tested", (gray) and "testing complete" (black).
|
|
28
|
+
*/
|
|
29
|
+
export var Color;
|
|
30
|
+
(function (Color) {
|
|
31
|
+
Color[Color["white"] = 0] = "white";
|
|
32
|
+
Color[Color["gray"] = 1] = "gray";
|
|
33
|
+
Color[Color["black"] = 2] = "black";
|
|
34
|
+
})(Color || (Color = {}));
|
|
35
|
+
export class Vertex {
|
|
36
|
+
/**
|
|
37
|
+
* vertex and its subclasses have a type parameter for type
|
|
38
|
+
* guards/reflection; each instance has a type that is set
|
|
39
|
+
* to the static class type.
|
|
40
|
+
*/
|
|
41
|
+
static type = 'vertex';
|
|
42
|
+
// --- members ---
|
|
43
|
+
type = Vertex.type; // for type guard
|
|
44
|
+
color = Color.white; // for loop check
|
|
45
|
+
/** dependencies */
|
|
46
|
+
// public edges_in: Vertex[] = [];
|
|
47
|
+
edges_in = new Set();
|
|
48
|
+
/** dependents */
|
|
49
|
+
// public edges_out: Vertex[] = [];
|
|
50
|
+
edges_out = new Set();
|
|
51
|
+
// --- accessors ---
|
|
52
|
+
get has_inbound_edges() { return this.edges_in.size > 0; }
|
|
53
|
+
get has_outbound_edges() { return this.edges_out.size > 0; }
|
|
54
|
+
// --- cleanup operations ---
|
|
55
|
+
/** reset this node */
|
|
56
|
+
Reset() {
|
|
57
|
+
for (const edge of this.edges_out) {
|
|
58
|
+
edge.RemoveDependency(this);
|
|
59
|
+
}
|
|
60
|
+
for (const edge of this.edges_in) {
|
|
61
|
+
edge.RemoveDependent(this);
|
|
62
|
+
}
|
|
63
|
+
//this.edges_out = [];
|
|
64
|
+
this.edges_out.clear();
|
|
65
|
+
//this.edges_in = [];
|
|
66
|
+
this.edges_in.clear();
|
|
67
|
+
}
|
|
68
|
+
/** removes all inbound edges (dependencies) */
|
|
69
|
+
ClearDependencies() {
|
|
70
|
+
for (const edge of this.edges_in) {
|
|
71
|
+
edge.RemoveDependent(this);
|
|
72
|
+
// testing inline...
|
|
73
|
+
// edge.edges_out = edge.edges_out.filter(check => check !== this);
|
|
74
|
+
}
|
|
75
|
+
// this.edges_in = [];
|
|
76
|
+
this.edges_in.clear();
|
|
77
|
+
}
|
|
78
|
+
// --- basic node operations ---
|
|
79
|
+
/** add a dependent. doesn't add if already in the list */
|
|
80
|
+
AddDependent(edge) {
|
|
81
|
+
if (edge === this)
|
|
82
|
+
return; // circular
|
|
83
|
+
if (this.edges_out.has(edge)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
/*
|
|
87
|
+
for (const check of this.edges_out) {
|
|
88
|
+
if (check === edge) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
*/
|
|
93
|
+
//this.edges_out.push(edge);
|
|
94
|
+
this.edges_out.add(edge);
|
|
95
|
+
}
|
|
96
|
+
/** remove a dependent */
|
|
97
|
+
RemoveDependent(edge) {
|
|
98
|
+
// this.edges_out = this.edges_out.filter((check) => check !== edge);
|
|
99
|
+
// updated for performance.
|
|
100
|
+
// this seems to be faster than any other method of removing an item.
|
|
101
|
+
// (also tried: temp loop and copy non-matching).
|
|
102
|
+
// this does assume that edges can't be in the list twice, but that
|
|
103
|
+
// should already be true (it would cause all sorts of other problems).
|
|
104
|
+
// actually does this just win because we break the loop earlier?
|
|
105
|
+
// (presumably in 50% of cases)? even if so, if the splice is not
|
|
106
|
+
// more expensive this is a win.
|
|
107
|
+
// splice should be expensive, though... weird. because what splice
|
|
108
|
+
// does (AIUI) is reassign array indexes above the delete index.
|
|
109
|
+
// it would be better if we could get rid of indexes altogether, perhaps
|
|
110
|
+
// using a set?
|
|
111
|
+
// note: tried to improve on splice with some direct methods, nothing
|
|
112
|
+
// seemed to work any better (not worse, either, but if there's no
|
|
113
|
+
// improvement we should use the native method).
|
|
114
|
+
/*
|
|
115
|
+
for (let i = 0; i < this.edges_out.length; i++) {
|
|
116
|
+
if (this.edges_out[i] === edge) {
|
|
117
|
+
this.edges_out.splice(i, 1);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
*/
|
|
122
|
+
this.edges_out.delete(edge);
|
|
123
|
+
}
|
|
124
|
+
/** add a dependency. doesn't add if already in the list */
|
|
125
|
+
AddDependency(edge) {
|
|
126
|
+
if (edge === this)
|
|
127
|
+
return; // circular
|
|
128
|
+
/*
|
|
129
|
+
for (const check of this.edges_in) {
|
|
130
|
+
if (check === edge) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
*/
|
|
135
|
+
if (this.edges_in.has(edge)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
//this.edges_in.push(edge);
|
|
139
|
+
this.edges_in.add(edge);
|
|
140
|
+
}
|
|
141
|
+
/** remove a dependency */
|
|
142
|
+
RemoveDependency(edge) {
|
|
143
|
+
// this.edges_in = this.edges_in.filter((check) => check !== edge);
|
|
144
|
+
this.edges_in.delete(edge);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* this is a composite operation, because the operations are always called
|
|
148
|
+
* in pairs. this means create a pair of links such that _edge_ depends on
|
|
149
|
+
* _this_.
|
|
150
|
+
*/
|
|
151
|
+
LinkTo(edge) {
|
|
152
|
+
this.AddDependent(edge);
|
|
153
|
+
edge.AddDependency(this);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* this is an alteranate formulation that may make more intuitive sense.
|
|
157
|
+
* it creates a pair of forward/backward links, such that _this_ depends
|
|
158
|
+
* on _edge_.
|
|
159
|
+
*/
|
|
160
|
+
DependsOn(edge) {
|
|
161
|
+
this.AddDependency(edge);
|
|
162
|
+
edge.AddDependent(this);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* this is called during calculation (if necessary). on a hit (loop), we
|
|
166
|
+
* reset the color of this, the test node, to white. there are two reasons
|
|
167
|
+
* for this:
|
|
168
|
+
*
|
|
169
|
+
* one, we want subsequent tests to also find the hit. in some cases we may
|
|
170
|
+
* not be marking the node as a loop (if it precedes the backref in the graph),
|
|
171
|
+
* so we want subsequent nodes to also hit the loop. [Q: this makes no sense,
|
|
172
|
+
* because this would still hit if the node were marked grey, assuming you
|
|
173
|
+
* test for that].
|
|
174
|
+
*
|
|
175
|
+
* two, if you fix the loop, on a subsequent call we want to force a re-check,
|
|
176
|
+
* which we can do if the vertex is marked white. [Q: could also be done on
|
|
177
|
+
* gray?]
|
|
178
|
+
*
|
|
179
|
+
* [A: logically you are correct, but this works, and matching grey does not].
|
|
180
|
+
*/
|
|
181
|
+
LoopCheck() {
|
|
182
|
+
const stack = [this];
|
|
183
|
+
while (stack.length) {
|
|
184
|
+
// note peek: we leave it on the stack
|
|
185
|
+
const v = stack[stack.length - 1];
|
|
186
|
+
// state flag: unset if we have edges we need to check
|
|
187
|
+
let complete = true;
|
|
188
|
+
// skip this vertex if it's clean
|
|
189
|
+
if (v.color !== Color.black) {
|
|
190
|
+
v.color = Color.gray; // set here, not top of function
|
|
191
|
+
for (const edge of v.edges_out) {
|
|
192
|
+
if (edge.color === Color.gray) {
|
|
193
|
+
this.color = Color.white; // note: this, not v
|
|
194
|
+
return true; // found a loop
|
|
195
|
+
}
|
|
196
|
+
// if (edge.color === Color.white && edge.edges_out.length) {
|
|
197
|
+
if (edge.color === Color.white && edge.edges_out.size) {
|
|
198
|
+
stack.push(edge);
|
|
199
|
+
complete = false;
|
|
200
|
+
// the only thing this break does is add loops. we can
|
|
201
|
+
// safely add all (white) edges as long as we don't color
|
|
202
|
+
// them here -- that was the issue in the last version.
|
|
203
|
+
// break; // ?
|
|
204
|
+
// if you really want fidelity with the recursive version
|
|
205
|
+
// you could reverse the order, but the order is arbitrary
|
|
206
|
+
// anyway so it makes no difference.
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (complete) {
|
|
211
|
+
v.color = Color.black;
|
|
212
|
+
stack.pop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/*
|
|
216
|
+
this.color = Color.gray;
|
|
217
|
+
|
|
218
|
+
// switch to stack algorithm. see the method in Graph for details.
|
|
219
|
+
|
|
220
|
+
// NOTE: this is bugged. need to rewrite. it's generating false positives
|
|
221
|
+
// where the recursive version still works.
|
|
222
|
+
|
|
223
|
+
const stack: Vertex[] = [this];
|
|
224
|
+
|
|
225
|
+
while (stack.length) {
|
|
226
|
+
|
|
227
|
+
const v = stack[stack.length - 1];
|
|
228
|
+
let completed = true;
|
|
229
|
+
|
|
230
|
+
if (v.color !== Color.black) {
|
|
231
|
+
|
|
232
|
+
for (const edge of v.edges_out) {
|
|
233
|
+
|
|
234
|
+
if (edge.color === Color.gray) {
|
|
235
|
+
|
|
236
|
+
// this is different than the graph algo, here we reset the
|
|
237
|
+
// color when we hit a loop.
|
|
238
|
+
|
|
239
|
+
this.color = Color.white; // someone else can test
|
|
240
|
+
return true; // loop
|
|
241
|
+
|
|
242
|
+
}
|
|
243
|
+
else if (edge.color === Color.white) {
|
|
244
|
+
edge.color = Color.gray;
|
|
245
|
+
stack.push(edge);
|
|
246
|
+
completed = false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (completed) {
|
|
254
|
+
stack.pop();
|
|
255
|
+
v.color = Color.black;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
*/
|
|
260
|
+
/*
|
|
261
|
+
// the old recursive version
|
|
262
|
+
|
|
263
|
+
for (const edge of this.edges_out) {
|
|
264
|
+
if (edge.color === Color.gray || (edge.color === Color.white && edge.LoopCheck())) {
|
|
265
|
+
this.color = Color.white; // someone else can test
|
|
266
|
+
return true; // loop
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
*/
|
|
270
|
+
this.color = Color.black;
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=vertex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex.js","sourceRoot":"","sources":["../../../../treb-calculator/src/dag/vertex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,KAEX;AAFD,WAAY,KAAK;IACf,mCAAK,CAAA;IAAE,iCAAI,CAAA;IAAE,mCAAK,CAAA;AACpB,CAAC,EAFW,KAAK,KAAL,KAAK,QAEhB;AAED,MAAM,OAAO,MAAM;IAEjB;;;;OAIG;IACI,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IAE9B,kBAAkB;IAEX,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB;IAErC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,iBAAiB;IAE7C,mBAAmB;IACnB,kCAAkC;IAC3B,QAAQ,GAAgB,IAAI,GAAG,EAAE,CAAC;IAEzC,iBAAiB;IACjB,mCAAmC;IAC5B,SAAS,GAAgB,IAAI,GAAG,EAAE,CAAC;IAE1C,oBAAoB;IAEpB,IAAI,iBAAiB,KAAc,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IAEnE,IAAI,kBAAkB,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IAErE,6BAA6B;IAE7B,sBAAsB;IACf,KAAK;QAEV,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAED,sBAAsB;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,qBAAqB;QACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAExB,CAAC;IAED,+CAA+C;IACxC,iBAAiB;QACtB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAE3B,oBAAoB;YACpB,yEAAyE;QAE3E,CAAC;QACD,sBAAsB;QACtB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,gCAAgC;IAEhC,0DAA0D;IACnD,YAAY,CAAC,IAAY;QAC9B,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,CAAC,WAAW;QAEtC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QAED;;;;;;UAME;QAEF,4BAA4B;QAC5B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,yBAAyB;IAClB,eAAe,CAAC,IAAY;QAEjC,qEAAqE;QAErE,2BAA2B;QAE3B,qEAAqE;QACrE,iDAAiD;QAEjD,mEAAmE;QACnE,uEAAuE;QAEvE,iEAAiE;QACjE,kEAAkE;QAClE,gCAAgC;QAEhC,mEAAmE;QACnE,gEAAgE;QAChE,wEAAwE;QACxE,eAAe;QAEf,qEAAqE;QACrE,mEAAmE;QACnE,gDAAgD;QAEhD;;;;;;;UAOE;QACH,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7B,CAAC;IAED,2DAA2D;IACpD,aAAa,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,CAAC,WAAW;QAEtC;;;;;;UAME;QACH,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAC,CAAC;YAC5B,OAAO;QACR,CAAC;QAEA,2BAA2B;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,0BAA0B;IACnB,gBAAgB,CAAC,IAAY;QAClC,mEAAmE;QACnE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,IAAY;QACxB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,IAAY;QAC3B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,SAAS;QAGd,MAAM,KAAK,GAAa,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;YAEpB,sCAAsC;YACtC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAElC,sDAAsD;YACtD,IAAI,QAAQ,GAAG,IAAI,CAAC;YAEpB,iCAAiC;YACjC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;gBAE5B,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,gCAAgC;gBAEtD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;oBAE/B,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;wBAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,oBAAoB;wBAC9C,OAAO,IAAI,CAAC,CAAC,eAAe;oBAC9B,CAAC;oBAED,6DAA6D;oBAC7D,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;wBACtD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBACjB,QAAQ,GAAG,KAAK,CAAC;wBAEjB,uDAAuD;wBACvD,0DAA0D;wBAC1D,uDAAuD;wBAEvD,cAAc;wBAEd,yDAAyD;wBACzD,0DAA0D;wBAC1D,oCAAoC;oBAEtC,CAAC;gBAEH,CAAC;YAEH,CAAC;YAED,IAAI,QAAQ,EAAE,CAAC;gBACb,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;gBACtB,KAAK,CAAC,GAAG,EAAE,CAAC;YACd,CAAC;QAEH,CAAC;QAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4CE;QAEF;;;;;;;;;UASE;QAEF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { RenderFunction, ClickFunction, UnionValue, ICellAddress, IArea, FunctionUnion } from 'treb-base-types';
|
|
2
|
+
import type { ExpressionUnit } from 'treb-parser';
|
|
3
|
+
/**
|
|
4
|
+
* FIXME: possible to add stuff in here if we need it
|
|
5
|
+
*/
|
|
6
|
+
export interface FunctionContext {
|
|
7
|
+
address: ICellAddress;
|
|
8
|
+
area?: IArea;
|
|
9
|
+
/** application function for fp functions */
|
|
10
|
+
apply?: (fn: FunctionUnion, args: UnionValue[]) => UnionValue;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* descriptor for an individual argument
|
|
14
|
+
*/
|
|
15
|
+
export interface ArgumentDescriptor {
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
default?: number | string | boolean;
|
|
19
|
+
/** @internal TODO: rename */
|
|
20
|
+
passthrough?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* allows error values to propagate. otherwise, a function will
|
|
23
|
+
* return an #ARG error if any arguments contain errors. used for
|
|
24
|
+
* IsError and IfError, atm.
|
|
25
|
+
*
|
|
26
|
+
* UPDATE: also used in IF.
|
|
27
|
+
*/
|
|
28
|
+
allow_error?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* this argument (reference) should be treated as an address, not resolved.
|
|
31
|
+
* it's used for identifying multivariate groups.
|
|
32
|
+
*
|
|
33
|
+
* UPDATE: this is used in reference + lookup functions (Offset, specifically)
|
|
34
|
+
* so don't move to MC lib.
|
|
35
|
+
*/
|
|
36
|
+
address?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* require the argument to be a union
|
|
39
|
+
*/
|
|
40
|
+
boxed?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* this argument repeasts. this has no impact on the function descriptor
|
|
43
|
+
* but it's useful to know for clients. UPDATE: going to use this for
|
|
44
|
+
* let, which repeats arguments at the front. not sure what that's going
|
|
45
|
+
* to do to clients. maybe it will just magically work!
|
|
46
|
+
*/
|
|
47
|
+
repeat?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* similar to collector, this flag will return metadata about the cell
|
|
50
|
+
*
|
|
51
|
+
* supported in annotations only, not spreadsheet cells (atm)
|
|
52
|
+
*
|
|
53
|
+
* returns cell data type defined in chart (FIXME: move)
|
|
54
|
+
*/
|
|
55
|
+
metadata?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* new flag for automating array application. set this flag to allow
|
|
58
|
+
* unrolling of array parameters. @see ApplyArray in `utilities.ts`.
|
|
59
|
+
*
|
|
60
|
+
* if this flag is set in any argument descriptor in a function, we'll
|
|
61
|
+
* apply arrays. that's done when the function is installed.
|
|
62
|
+
*
|
|
63
|
+
* FIXME: this should maybe be the default, and we have an !unroll flag
|
|
64
|
+
*/
|
|
65
|
+
unroll?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export interface ContextResult {
|
|
71
|
+
context: Record<string, ExpressionUnit>;
|
|
72
|
+
/**
|
|
73
|
+
* rewrite args
|
|
74
|
+
*/
|
|
75
|
+
args: any[];
|
|
76
|
+
/** possibly rewrite argument descriptors, not required */
|
|
77
|
+
argument_descriptors?: ArgumentDescriptor[];
|
|
78
|
+
}
|
|
79
|
+
export type FunctionImplementation = (this: FunctionContext | undefined, ...args: any[]) => UnionValue;
|
|
80
|
+
/**
|
|
81
|
+
* merging the old function descriptor and decorated function types, since
|
|
82
|
+
* there's a good deal of overlap and we spend a lot of effort keeping them
|
|
83
|
+
* in sync.
|
|
84
|
+
*
|
|
85
|
+
* this is a wrapper object that contains the function and (mostly optional)
|
|
86
|
+
* metadata.
|
|
87
|
+
*/
|
|
88
|
+
export interface CompositeFunctionDescriptor {
|
|
89
|
+
/**
|
|
90
|
+
* description for the function wizard
|
|
91
|
+
*/
|
|
92
|
+
description?: string;
|
|
93
|
+
/**
|
|
94
|
+
* list of arguments, for the function wizard and tooltip
|
|
95
|
+
*/
|
|
96
|
+
arguments?: ArgumentDescriptor[];
|
|
97
|
+
/**
|
|
98
|
+
* volatile: value changes on every recalc, even if dependencies
|
|
99
|
+
* don't change
|
|
100
|
+
*/
|
|
101
|
+
volatile?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* FIXME: we need to unify type with what's in the cell class
|
|
104
|
+
*/
|
|
105
|
+
render?: RenderFunction;
|
|
106
|
+
click?: ClickFunction;
|
|
107
|
+
/**
|
|
108
|
+
* the actual function. if this is an object member and needs access
|
|
109
|
+
* to the containing instance, make sure to bind it to that instance.
|
|
110
|
+
*
|
|
111
|
+
* otherwise, `this` will be bound to a `CalculationContext` object
|
|
112
|
+
* if your function is defined as a function (i.e. not an arrow function).
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
fn: FunctionImplementation;
|
|
116
|
+
/**
|
|
117
|
+
* limited visibility
|
|
118
|
+
*
|
|
119
|
+
* internal functions do not show up in the spreadsheet. we have an
|
|
120
|
+
* annotation value which should be usef in the future but it's not
|
|
121
|
+
* implemented yet.
|
|
122
|
+
*
|
|
123
|
+
* should we allow these functions to be used, and just not tooltip them;
|
|
124
|
+
* or block them entirely? for now we'll do the former as it's helpful to
|
|
125
|
+
* defug.
|
|
126
|
+
*/
|
|
127
|
+
visibility?: 'internal' | 'annotation';
|
|
128
|
+
/**
|
|
129
|
+
* for the future
|
|
130
|
+
*/
|
|
131
|
+
category?: string[];
|
|
132
|
+
extension?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* there is some set of functions that need an "_xlfn." prefix on export.
|
|
135
|
+
* I'm not sure why or where the list comes from, but we want to flag
|
|
136
|
+
* those functions so we can export them properly.
|
|
137
|
+
*/
|
|
138
|
+
xlfn?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* support returning references. 'value' is default. FIXME: could just be a bool?
|
|
141
|
+
*/
|
|
142
|
+
return_type?: 'reference' | 'value';
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
export?: (...args: any[]) => string;
|
|
147
|
+
/**
|
|
148
|
+
* pass through UI functions, if possible. this is for lambda and let; we
|
|
149
|
+
* want to pass through sparklines, if a sparkline is the first function call
|
|
150
|
+
*
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
pass_through_ui?: 'direct' | 'indirect';
|
|
154
|
+
/**
|
|
155
|
+
* flag indicating we've unrolled this function. it's possible functions
|
|
156
|
+
* will run through the registration process more than once and we don't
|
|
157
|
+
* want to have extra depth.
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
unrolled?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* this is new: custom binding context for lambda functions (lambda, let,
|
|
164
|
+
* and maybe others?) still working out the semantics of this.
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
create_binding_context?: (context: {
|
|
169
|
+
args: ExpressionUnit[];
|
|
170
|
+
descriptors: ArgumentDescriptor[];
|
|
171
|
+
}) => ContextResult | undefined;
|
|
172
|
+
/** flag indicating this function needs fp support */
|
|
173
|
+
fp?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface FunctionMap {
|
|
176
|
+
[index: string]: CompositeFunctionDescriptor;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* the stored value also includes a canonical name. this used to be separate
|
|
180
|
+
* from the registered name (because those were functions, and had to adhere
|
|
181
|
+
* to language rules) but now we use arbitrary tokens, so we can consolidate.
|
|
182
|
+
*/
|
|
183
|
+
export interface ExtendedFunctionDescriptor extends CompositeFunctionDescriptor {
|
|
184
|
+
canonical_name: string;
|
|
185
|
+
}
|
|
186
|
+
export interface ExtendedFunctionMap {
|
|
187
|
+
[index: string]: ExtendedFunctionDescriptor;
|
|
188
|
+
}
|
|
189
|
+
export type IntrinsicValue = number | string | boolean | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=descriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptors.js","sourceRoot":"","sources":["../../../treb-calculator/src/descriptors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { FunctionLibrary } from './function-library';
|
|
2
|
+
import type { Cell, ICellAddress, UnionValue, CellValue, ArrayUnion, IArea, FunctionUnion } from 'treb-base-types';
|
|
3
|
+
import { ValueType } from 'treb-base-types';
|
|
4
|
+
import type { Parser, ExpressionUnit, UnitBinary, UnitIdentifier, UnitGroup, UnitUnary, UnitAddress, UnitCall, UnitDimensionedQuantity, UnitStructuredReference, UnitImplicitCall } from 'treb-parser';
|
|
5
|
+
import type { DataModel, MacroFunction } from 'treb-data-model';
|
|
6
|
+
import * as Primitives from './primitives';
|
|
7
|
+
/**
|
|
8
|
+
* dynamically adding a user data field to the expression so we can
|
|
9
|
+
* cache a function call, avoiding type switching and function lookups.
|
|
10
|
+
*
|
|
11
|
+
* we use the generic type so we can cover the composite type as well
|
|
12
|
+
* before specifying
|
|
13
|
+
*/
|
|
14
|
+
type AttachCachedFunction<T> = (T & {
|
|
15
|
+
fn: (arg0: T) => UnionValue;
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* expression unit with cached function
|
|
19
|
+
*/
|
|
20
|
+
type ExpressionWithCachedFunction<T extends ExpressionUnit> = T extends {
|
|
21
|
+
type: T['type'];
|
|
22
|
+
} ? AttachCachedFunction<T> : never;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export type ExtendedExpressionUnit = ExpressionWithCachedFunction<ExpressionUnit>;
|
|
27
|
+
export declare const UnionIsExpressionUnit: (test: UnionValue) => test is {
|
|
28
|
+
type: ValueType.object;
|
|
29
|
+
value: ExpressionUnit;
|
|
30
|
+
};
|
|
31
|
+
export declare const UnionIsMetadata: (test: UnionValue) => test is {
|
|
32
|
+
type: ValueType.object;
|
|
33
|
+
value: ReferenceMetadata;
|
|
34
|
+
};
|
|
35
|
+
export interface ReferenceMetadata {
|
|
36
|
+
type: 'metadata';
|
|
37
|
+
address: UnitAddress;
|
|
38
|
+
value: CellValue;
|
|
39
|
+
format?: string;
|
|
40
|
+
}
|
|
41
|
+
export type BindingFrame = Record<string, ExpressionUnit>;
|
|
42
|
+
export type PositionalFrame = ExpressionUnit[];
|
|
43
|
+
export interface CalculationContext {
|
|
44
|
+
address: ICellAddress;
|
|
45
|
+
area?: IArea;
|
|
46
|
+
volatile: boolean;
|
|
47
|
+
/** new for lambdas */
|
|
48
|
+
bindings: BindingFrame[];
|
|
49
|
+
}
|
|
50
|
+
export declare class ExpressionCalculator {
|
|
51
|
+
protected readonly data_model: DataModel;
|
|
52
|
+
protected readonly library: FunctionLibrary;
|
|
53
|
+
protected readonly parser: Parser;
|
|
54
|
+
context: CalculationContext;
|
|
55
|
+
constructor(data_model: DataModel, library: FunctionLibrary, parser: Parser);
|
|
56
|
+
/**
|
|
57
|
+
* there's a case where we are calling this from within a function
|
|
58
|
+
* (which is weird, but hey) and to do that we need to preserve flags.
|
|
59
|
+
*/
|
|
60
|
+
Calculate(expr: ExpressionUnit, addr: ICellAddress, area?: IArea, preserve_flags?: boolean): {
|
|
61
|
+
value: UnionValue;
|
|
62
|
+
volatile: boolean;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* resolve value from cell. returns a function bound to specific cell.
|
|
66
|
+
*/
|
|
67
|
+
protected CellFunction2(expr: UnitAddress): () => UnionValue;
|
|
68
|
+
/**
|
|
69
|
+
* returns range as union type. returns a single value for a single cell,
|
|
70
|
+
* or a 2d array (never a 1d array)
|
|
71
|
+
*/
|
|
72
|
+
protected CellFunction4(start: ICellAddress, end: ICellAddress): UnionValue;
|
|
73
|
+
/** breaking this out to de-dupe */
|
|
74
|
+
protected GetMetadata<T>(arg: ExpressionUnit, transform: (cell_data: Cell, address: ICellAddress) => T): UnionValue;
|
|
75
|
+
protected RewriteMacro(unit: ExpressionUnit, names: Record<string, ExpressionUnit>): ExpressionUnit;
|
|
76
|
+
protected CallMacro(outer: UnitCall, macro: MacroFunction): (expr: UnitCall) => UnionValue;
|
|
77
|
+
/**
|
|
78
|
+
* split out from ImplicitCall so we can reuse
|
|
79
|
+
*/
|
|
80
|
+
ImplicitCallTail(result: FunctionUnion, args: ExpressionUnit[]): UnionValue;
|
|
81
|
+
/**
|
|
82
|
+
* an FP call will need to set bindings and call an expression,
|
|
83
|
+
* possibly multiple times. this is a support function for that.
|
|
84
|
+
*/
|
|
85
|
+
protected Apply(fn: FunctionUnion, args: UnionValue[]): UnionValue;
|
|
86
|
+
/**
|
|
87
|
+
* this method can take a `call` type if it looked like a call at
|
|
88
|
+
* the parsing stage, it's a simple translation between the two
|
|
89
|
+
*/
|
|
90
|
+
protected ImplicitCall(): (expr: UnitImplicitCall | UnitCall) => UnionValue;
|
|
91
|
+
protected NormalizeBindings(context: BindingFrame): Record<string, ExpressionUnit>;
|
|
92
|
+
/**
|
|
93
|
+
* excute a function call
|
|
94
|
+
*/
|
|
95
|
+
protected CallExpression(outer: UnitCall, return_reference?: boolean): (expr: UnitCall) => UnionValue;
|
|
96
|
+
protected ResolveStructuredReference(expr: UnitStructuredReference): () => UnionValue;
|
|
97
|
+
protected ResolveDimensionedQuantity(): (exp: UnitDimensionedQuantity) => UnionValue;
|
|
98
|
+
protected UnaryExpression(x: UnitUnary, return_reference?: boolean): (expr: UnitUnary) => UnionValue;
|
|
99
|
+
/**
|
|
100
|
+
* expands the size of an array by recycling values in columns and rows
|
|
101
|
+
*
|
|
102
|
+
* FIXME: seems like this is more a generic thing, -> utils lib
|
|
103
|
+
*
|
|
104
|
+
* @param arr 2d array
|
|
105
|
+
* @param columns target columns
|
|
106
|
+
* @param rows target rows
|
|
107
|
+
*/
|
|
108
|
+
protected RecycleArray<T>(arr: T[][], columns: number, rows: number): T[][];
|
|
109
|
+
protected ElementwiseBinaryExpression(fn: Primitives.PrimitiveBinaryExpression, left: ArrayUnion, right: ArrayUnion): ArrayUnion;
|
|
110
|
+
/**
|
|
111
|
+
* convert expr to a cell address, possibly calculating the contents.
|
|
112
|
+
* returns single address only (ranges with len > 1 will fail)
|
|
113
|
+
*/
|
|
114
|
+
protected AsReference(expr: ExpressionUnit): ICellAddress | undefined;
|
|
115
|
+
protected BinaryExpression(x: UnitBinary): (expr: UnitBinary) => UnionValue;
|
|
116
|
+
protected Identifier(expr: UnitIdentifier): () => UnionValue;
|
|
117
|
+
/**
|
|
118
|
+
* look up an identifier in any binding frames. we do LIFO binding.
|
|
119
|
+
*
|
|
120
|
+
* @param name
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
protected LookupBinding(name: string): ExpressionUnit | undefined;
|
|
124
|
+
protected GroupExpression(x: UnitGroup): (expr: UnitGroup) => UnionValue;
|
|
125
|
+
protected CalculateExpression(expr: ExtendedExpressionUnit, return_reference?: boolean): UnionValue;
|
|
126
|
+
}
|
|
127
|
+
export {};
|