@cj-tech-master/excelts 9.2.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/README_zh.md +29 -6
- package/dist/browser/index.browser.d.ts +1 -1
- package/dist/browser/index.browser.js +4 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +4 -0
- package/dist/browser/modules/excel/cell.d.ts +17 -3
- package/dist/browser/modules/excel/cell.js +170 -22
- package/dist/browser/modules/excel/defined-names.d.ts +96 -1
- package/dist/browser/modules/excel/defined-names.js +411 -21
- package/dist/browser/modules/excel/image.d.ts +11 -0
- package/dist/browser/modules/excel/image.js +24 -1
- package/dist/browser/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/browser/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/browser/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/browser/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/browser/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/browser/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/browser/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/browser/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/browser/modules/excel/table.js +15 -2
- package/dist/browser/modules/excel/types.d.ts +133 -2
- package/dist/browser/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/browser/modules/excel/utils/col-cache.js +15 -0
- package/dist/browser/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/browser/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/browser/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/browser/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/browser/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/browser/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/browser/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/browser/modules/excel/utils/shared-strings.js +21 -2
- package/dist/browser/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/browser/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/browser/modules/excel/workbook.browser.js +318 -34
- package/dist/browser/modules/excel/workbook.d.ts +1 -1
- package/dist/browser/modules/excel/worksheet.d.ts +3 -1
- package/dist/browser/modules/excel/worksheet.js +21 -2
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/browser/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/browser/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/browser/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/browser/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/browser/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/browser/modules/formula/compile/address-utils.js +83 -0
- package/dist/browser/modules/formula/compile/binder.d.ts +42 -0
- package/dist/browser/modules/formula/compile/binder.js +487 -0
- package/dist/browser/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/browser/modules/formula/compile/bound-ast.js +80 -0
- package/dist/browser/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/browser/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/browser/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/browser/modules/formula/default-syntax-probe.js +83 -0
- package/dist/browser/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/browser/modules/formula/functions/_date-context.js +29 -0
- package/dist/browser/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/browser/modules/formula/functions/_shared.js +381 -0
- package/dist/browser/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/browser/modules/formula/functions/conditional.js +343 -0
- package/dist/browser/modules/formula/functions/database.d.ts +37 -0
- package/dist/browser/modules/formula/functions/database.js +274 -0
- package/dist/browser/modules/formula/functions/date.d.ts +61 -0
- package/dist/browser/modules/formula/functions/date.js +855 -0
- package/dist/browser/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/browser/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/browser/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/browser/modules/formula/functions/engineering.js +1128 -0
- package/dist/browser/modules/formula/functions/financial.d.ts +202 -0
- package/dist/browser/modules/formula/functions/financial.js +2296 -0
- package/dist/browser/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/browser/modules/formula/functions/lookup.js +886 -0
- package/dist/browser/modules/formula/functions/math.d.ts +114 -0
- package/dist/browser/modules/formula/functions/math.js +1406 -0
- package/dist/browser/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/browser/modules/formula/functions/statistical.js +3390 -0
- package/dist/browser/modules/formula/functions/text.d.ts +86 -0
- package/dist/browser/modules/formula/functions/text.js +1845 -0
- package/dist/browser/modules/formula/host-registry.d.ts +53 -0
- package/dist/browser/modules/formula/host-registry.js +69 -0
- package/dist/browser/modules/formula/index.d.ts +39 -0
- package/dist/browser/modules/formula/index.js +49 -0
- package/dist/browser/modules/formula/install.d.ts +62 -0
- package/dist/browser/modules/formula/install.js +88 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/browser/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/browser/modules/formula/integration/formula-instance.js +79 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/browser/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/browser/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/browser/modules/formula/materialize/types.d.ts +179 -0
- package/dist/browser/modules/formula/materialize/types.js +29 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/browser/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/browser/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/browser/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/browser/modules/formula/runtime/function-registry.js +840 -0
- package/dist/browser/modules/formula/runtime/values.d.ts +211 -0
- package/dist/browser/modules/formula/runtime/values.js +385 -0
- package/dist/browser/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/browser/modules/formula/syntax/ast.js +28 -0
- package/dist/browser/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/browser/modules/formula/syntax/parser.js +439 -0
- package/dist/browser/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/browser/modules/formula/syntax/token-types.js +59 -0
- package/dist/browser/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/dist/browser/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/browser/modules/pdf/excel-bridge.js +9 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/modules/excel/cell.js +170 -22
- package/dist/cjs/modules/excel/defined-names.js +411 -21
- package/dist/cjs/modules/excel/image.js +24 -1
- package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/cjs/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/cjs/modules/excel/table.js +15 -2
- package/dist/cjs/modules/excel/utils/col-cache.js +15 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/cjs/modules/excel/utils/external-link-formula.js +212 -0
- package/dist/cjs/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +42 -2
- package/dist/cjs/modules/excel/utils/shared-strings.js +21 -2
- package/dist/cjs/modules/excel/utils/workbook-protection.js +33 -0
- package/dist/cjs/modules/excel/workbook.browser.js +318 -34
- package/dist/cjs/modules/excel/worksheet.js +20 -1
- package/dist/cjs/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +333 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/external-reference-xform.js +27 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-protection-xform.js +69 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +18 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/metadata-xform.js +161 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +108 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/cjs/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +83 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/cjs/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +408 -18
- package/dist/cjs/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/cjs/modules/formula/compile/address-utils.js +89 -0
- package/dist/cjs/modules/formula/compile/binder.js +489 -0
- package/dist/cjs/modules/formula/compile/bound-ast.js +68 -0
- package/dist/cjs/modules/formula/compile/compiled-formula.js +387 -0
- package/dist/cjs/modules/formula/compile/dependency-analysis.js +437 -0
- package/dist/cjs/modules/formula/compile/structured-ref-utils.js +141 -0
- package/dist/cjs/modules/formula/default-syntax-probe.js +87 -0
- package/dist/cjs/modules/formula/functions/_date-context.js +33 -0
- package/dist/cjs/modules/formula/functions/_shared.js +396 -0
- package/dist/cjs/modules/formula/functions/conditional.js +354 -0
- package/dist/cjs/modules/formula/functions/database.js +288 -0
- package/dist/cjs/modules/formula/functions/date.js +883 -0
- package/dist/cjs/modules/formula/functions/dynamic-array.js +881 -0
- package/dist/cjs/modules/formula/functions/engineering.js +1183 -0
- package/dist/cjs/modules/formula/functions/financial.js +2348 -0
- package/dist/cjs/modules/formula/functions/lookup.js +902 -0
- package/dist/cjs/modules/formula/functions/math.js +1487 -0
- package/dist/cjs/modules/formula/functions/statistical.js +3488 -0
- package/dist/cjs/modules/formula/functions/text.js +1889 -0
- package/dist/cjs/modules/formula/host-registry.js +75 -0
- package/dist/cjs/modules/formula/index.js +58 -0
- package/dist/cjs/modules/formula/install.js +93 -0
- package/dist/cjs/modules/formula/integration/apply-writeback-plan.js +213 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas-impl.js +619 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas.js +71 -0
- package/dist/cjs/modules/formula/integration/formula-instance.js +82 -0
- package/dist/cjs/modules/formula/integration/workbook-adapter.js +327 -0
- package/dist/cjs/modules/formula/integration/workbook-snapshot.js +84 -0
- package/dist/cjs/modules/formula/materialize/build-writeback-plan.js +475 -0
- package/dist/cjs/modules/formula/materialize/spill-engine.js +42 -0
- package/dist/cjs/modules/formula/materialize/types.js +32 -0
- package/dist/cjs/modules/formula/materialize/writeback-plan.js +28 -0
- package/dist/cjs/modules/formula/runtime/evaluator.js +2298 -0
- package/dist/cjs/modules/formula/runtime/function-registry.js +846 -0
- package/dist/cjs/modules/formula/runtime/values.js +385 -0
- package/dist/cjs/modules/formula/syntax/ast.js +8 -0
- package/dist/cjs/modules/formula/syntax/parser.js +440 -0
- package/dist/cjs/modules/formula/syntax/token-types.js +32 -0
- package/dist/cjs/modules/formula/syntax/tokenizer.js +1076 -0
- package/dist/cjs/modules/pdf/excel-bridge.js +9 -0
- package/dist/esm/index.browser.js +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/modules/excel/cell.js +170 -22
- package/dist/esm/modules/excel/defined-names.js +411 -21
- package/dist/esm/modules/excel/image.js +24 -1
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/esm/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/esm/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/esm/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/esm/modules/excel/table.js +15 -2
- package/dist/esm/modules/excel/utils/col-cache.js +15 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/esm/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/esm/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/esm/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/esm/modules/excel/utils/shared-strings.js +21 -2
- package/dist/esm/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/esm/modules/excel/workbook.browser.js +318 -34
- package/dist/esm/modules/excel/worksheet.js +21 -2
- package/dist/esm/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/esm/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/esm/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/esm/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/esm/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/esm/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/esm/modules/formula/compile/address-utils.js +83 -0
- package/dist/esm/modules/formula/compile/binder.js +487 -0
- package/dist/esm/modules/formula/compile/bound-ast.js +80 -0
- package/dist/esm/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/esm/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/esm/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/esm/modules/formula/default-syntax-probe.js +83 -0
- package/dist/esm/modules/formula/functions/_date-context.js +29 -0
- package/dist/esm/modules/formula/functions/_shared.js +381 -0
- package/dist/esm/modules/formula/functions/conditional.js +343 -0
- package/dist/esm/modules/formula/functions/database.js +274 -0
- package/dist/esm/modules/formula/functions/date.js +855 -0
- package/dist/esm/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/esm/modules/formula/functions/engineering.js +1128 -0
- package/dist/esm/modules/formula/functions/financial.js +2296 -0
- package/dist/esm/modules/formula/functions/lookup.js +886 -0
- package/dist/esm/modules/formula/functions/math.js +1406 -0
- package/dist/esm/modules/formula/functions/statistical.js +3390 -0
- package/dist/esm/modules/formula/functions/text.js +1845 -0
- package/dist/esm/modules/formula/host-registry.js +69 -0
- package/dist/esm/modules/formula/index.js +49 -0
- package/dist/esm/modules/formula/install.js +88 -0
- package/dist/esm/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/esm/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/esm/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/esm/modules/formula/integration/formula-instance.js +79 -0
- package/dist/esm/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/esm/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/esm/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/esm/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/esm/modules/formula/materialize/types.js +29 -0
- package/dist/esm/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/esm/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/esm/modules/formula/runtime/function-registry.js +840 -0
- package/dist/esm/modules/formula/runtime/values.js +385 -0
- package/dist/esm/modules/formula/syntax/ast.js +28 -0
- package/dist/esm/modules/formula/syntax/parser.js +439 -0
- package/dist/esm/modules/formula/syntax/token-types.js +59 -0
- package/dist/esm/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/esm/modules/pdf/excel-bridge.js +9 -0
- package/dist/iife/excelts.iife.js +2302 -373
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +34 -34
- package/dist/types/index.browser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/modules/excel/cell.d.ts +17 -3
- package/dist/types/modules/excel/defined-names.d.ts +96 -1
- package/dist/types/modules/excel/image.d.ts +11 -0
- package/dist/types/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/types/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/types/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/types/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/types/modules/excel/types.d.ts +133 -2
- package/dist/types/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/types/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/types/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/types/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/types/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/types/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/types/modules/excel/workbook.d.ts +1 -1
- package/dist/types/modules/excel/worksheet.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/types/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/types/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/types/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/types/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/types/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/types/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/types/modules/formula/compile/binder.d.ts +42 -0
- package/dist/types/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/types/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/types/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/types/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/types/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/types/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/types/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/types/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/types/modules/formula/functions/database.d.ts +37 -0
- package/dist/types/modules/formula/functions/date.d.ts +61 -0
- package/dist/types/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/types/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/types/modules/formula/functions/financial.d.ts +202 -0
- package/dist/types/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/types/modules/formula/functions/math.d.ts +114 -0
- package/dist/types/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/types/modules/formula/functions/text.d.ts +86 -0
- package/dist/types/modules/formula/host-registry.d.ts +53 -0
- package/dist/types/modules/formula/index.d.ts +39 -0
- package/dist/types/modules/formula/install.d.ts +62 -0
- package/dist/types/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/types/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/types/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/types/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/types/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/types/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/types/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/types/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/types/modules/formula/materialize/types.d.ts +179 -0
- package/dist/types/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/types/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/types/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/types/modules/formula/runtime/values.d.ts +211 -0
- package/dist/types/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/types/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/types/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/types/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/package.json +28 -28
|
@@ -239,11 +239,23 @@ export interface WorkbookView {
|
|
|
239
239
|
export interface WorkbookProperties {
|
|
240
240
|
date1904: boolean;
|
|
241
241
|
}
|
|
242
|
+
export interface WorkbookProtection {
|
|
243
|
+
lockStructure: boolean;
|
|
244
|
+
lockWindows: boolean;
|
|
245
|
+
lockRevision: boolean;
|
|
246
|
+
spinCount: number;
|
|
247
|
+
}
|
|
242
248
|
export interface CalculationProperties {
|
|
243
249
|
fullCalcOnLoad: boolean;
|
|
250
|
+
/** Enable iterative calculation for circular references */
|
|
251
|
+
iterate?: boolean;
|
|
252
|
+
/** Maximum number of iterations (default 100) */
|
|
253
|
+
iterateCount?: number;
|
|
254
|
+
/** Convergence threshold (default 0.001) */
|
|
255
|
+
iterateDelta?: number;
|
|
244
256
|
}
|
|
245
257
|
export interface CellErrorValue {
|
|
246
|
-
error: "#N/A" | "#REF!" | "#NAME?" | "#DIV/0!" | "#NULL!" | "#VALUE!" | "#NUM!";
|
|
258
|
+
error: "#N/A" | "#REF!" | "#NAME?" | "#DIV/0!" | "#NULL!" | "#VALUE!" | "#NUM!" | "#SPILL!" | "#CALC!";
|
|
247
259
|
}
|
|
248
260
|
export interface RichText {
|
|
249
261
|
text: string;
|
|
@@ -253,7 +265,58 @@ export interface CellRichTextValue {
|
|
|
253
265
|
richText: RichText[];
|
|
254
266
|
}
|
|
255
267
|
export interface CellHyperlinkValue {
|
|
268
|
+
/**
|
|
269
|
+
* Plain-text display for the hyperlink. Always a string.
|
|
270
|
+
*
|
|
271
|
+
* When `richText` is also set, this field mirrors the concatenated
|
|
272
|
+
* `.text` of every run in `richText` (flattened representation).
|
|
273
|
+
*/
|
|
274
|
+
text: string;
|
|
275
|
+
/**
|
|
276
|
+
* Optional rich-text runs providing formatted display for the hyperlink.
|
|
277
|
+
* When present, `text` must equal the concatenation of each run's `.text`.
|
|
278
|
+
*/
|
|
279
|
+
richText?: RichText[];
|
|
280
|
+
hyperlink: string;
|
|
281
|
+
tooltip?: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Input shape for assigning a hyperlink cell value.
|
|
285
|
+
*
|
|
286
|
+
* Accepts either:
|
|
287
|
+
* - a plain-text hyperlink (`text + hyperlink`), OR
|
|
288
|
+
* - a rich-text hyperlink (`richText + hyperlink`) — `text` is auto-derived
|
|
289
|
+
* by flattening the runs, so callers do not have to repeat it.
|
|
290
|
+
*
|
|
291
|
+
* The output shape (`CellHyperlinkValue` returned from `cell.value`) always
|
|
292
|
+
* has `text: string` populated.
|
|
293
|
+
*/
|
|
294
|
+
export type CellHyperlinkValueInput = {
|
|
256
295
|
text: string;
|
|
296
|
+
richText?: RichText[];
|
|
297
|
+
hyperlink: string;
|
|
298
|
+
tooltip?: string;
|
|
299
|
+
} | {
|
|
300
|
+
text?: string;
|
|
301
|
+
richText: RichText[];
|
|
302
|
+
hyperlink: string;
|
|
303
|
+
tooltip?: string;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* Input shape for assigning a formula cell that also carries a hyperlink.
|
|
307
|
+
*
|
|
308
|
+
* Loaded workbooks may present a formula cell with an attached hyperlink
|
|
309
|
+
* (e.g. `=HYPERLINK(...)` style or a `<hyperlink ref="..."/>` entry pointing
|
|
310
|
+
* at a formula cell). On the public surface such cells are classified as
|
|
311
|
+
* Hyperlink (`cell.type === ValueType.Hyperlink`) with the formula's result
|
|
312
|
+
* as display text, while `cell.model.formula` is preserved for round-trip.
|
|
313
|
+
*
|
|
314
|
+
* Use this shape to construct that combination directly without going
|
|
315
|
+
* through `cell.model`.
|
|
316
|
+
*/
|
|
317
|
+
export interface CellFormulaHyperlinkValue {
|
|
318
|
+
formula: string;
|
|
319
|
+
result?: number | string | boolean | Date | CellErrorValue;
|
|
257
320
|
hyperlink: string;
|
|
258
321
|
tooltip?: string;
|
|
259
322
|
}
|
|
@@ -270,6 +333,14 @@ export interface CellArrayFormulaValue {
|
|
|
270
333
|
shareType: "array";
|
|
271
334
|
/** The range this array formula applies to, e.g. "A1:B2" */
|
|
272
335
|
ref: string;
|
|
336
|
+
/**
|
|
337
|
+
* Mark this as an Excel 365 dynamic array formula (FILTER, SORT, UNIQUE, etc.).
|
|
338
|
+
* Dynamic array formulas differ from legacy CSE (Ctrl+Shift+Enter) array formulas:
|
|
339
|
+
* - The `ref` typically points to the formula cell itself (spill is dynamic)
|
|
340
|
+
* - Excel writes a `cm` attribute on the `<c>` element linking to `xl/metadata.xml`
|
|
341
|
+
* - The metadata marks the formula with `<xda:dynamicArrayProperties fDynamic="1"/>`
|
|
342
|
+
*/
|
|
343
|
+
isDynamicArray?: boolean;
|
|
273
344
|
}
|
|
274
345
|
export interface CellSharedFormulaValue {
|
|
275
346
|
sharedFormula: string;
|
|
@@ -282,6 +353,18 @@ export interface CellCheckboxValue {
|
|
|
282
353
|
checkbox: boolean;
|
|
283
354
|
}
|
|
284
355
|
export type CellValue = null | number | string | boolean | Date | undefined | CellErrorValue | CellRichTextValue | CellHyperlinkValue | CellFormulaValue | CellArrayFormulaValue | CellSharedFormulaValue | CellCheckboxValue;
|
|
356
|
+
/**
|
|
357
|
+
* Input variant of {@link CellValue} used when assigning to `cell.value`.
|
|
358
|
+
*
|
|
359
|
+
* Accepts the same shapes as `CellValue` plus more permissive forms that
|
|
360
|
+
* the runtime normalizes:
|
|
361
|
+
* - `CellHyperlinkValueInput` — rich-text hyperlinks may omit `text`
|
|
362
|
+
* (it will be derived from `richText`).
|
|
363
|
+
* - `CellFormulaHyperlinkValue` — formula cells may carry a `hyperlink`.
|
|
364
|
+
*
|
|
365
|
+
* `cell.value` (the getter) still returns the canonical `CellValue` shape.
|
|
366
|
+
*/
|
|
367
|
+
export type CellValueInput = null | number | string | boolean | Date | undefined | CellErrorValue | CellRichTextValue | CellHyperlinkValueInput | CellFormulaValue | CellArrayFormulaValue | CellSharedFormulaValue | CellCheckboxValue | CellFormulaHyperlinkValue;
|
|
285
368
|
export interface CommentMargins {
|
|
286
369
|
insetmode: "auto" | "custom";
|
|
287
370
|
inset: number[];
|
|
@@ -363,6 +446,22 @@ export type AddImageRange = string | {
|
|
|
363
446
|
hyperlink?: string;
|
|
364
447
|
tooltip?: string;
|
|
365
448
|
};
|
|
449
|
+
} | {
|
|
450
|
+
/** Absolute position in pixels — mutually exclusive with tl/br. */
|
|
451
|
+
pos: {
|
|
452
|
+
x: number;
|
|
453
|
+
y: number;
|
|
454
|
+
};
|
|
455
|
+
/** Image dimensions in pixels (required for absolute positioning). */
|
|
456
|
+
ext: {
|
|
457
|
+
width: number;
|
|
458
|
+
height: number;
|
|
459
|
+
};
|
|
460
|
+
/** Hyperlink for the image */
|
|
461
|
+
hyperlinks?: {
|
|
462
|
+
hyperlink?: string;
|
|
463
|
+
tooltip?: string;
|
|
464
|
+
};
|
|
366
465
|
};
|
|
367
466
|
export interface ImageHyperlinkValue {
|
|
368
467
|
hyperlink: string;
|
|
@@ -521,6 +620,10 @@ export interface DataBarRuleType extends ConditionalFormattingBaseRule {
|
|
|
521
620
|
direction?: "context" | "leftToRight" | "rightToLeft";
|
|
522
621
|
cfvo?: Cvfo[];
|
|
523
622
|
color?: Partial<Color>;
|
|
623
|
+
negativeFillColor?: Partial<Color>;
|
|
624
|
+
borderColor?: Partial<Color>;
|
|
625
|
+
negativeBorderColor?: Partial<Color>;
|
|
626
|
+
axisColor?: Partial<Color>;
|
|
524
627
|
}
|
|
525
628
|
export type ConditionalFormattingRule = ExpressionRuleType | CellIsRuleType | Top10RuleType | AboveAverageRuleType | ColorScaleRuleType | IconSetRuleType | ContainsTextRuleType | TimePeriodRuleType | DataBarRuleType;
|
|
526
629
|
export interface ConditionalFormattingOptions {
|
|
@@ -563,7 +666,13 @@ export interface TableProperties {
|
|
|
563
666
|
qualifyImplicitStructuredReferences?: boolean;
|
|
564
667
|
style?: TableStyleProperties;
|
|
565
668
|
columns: TableColumnProperties[];
|
|
566
|
-
|
|
669
|
+
/**
|
|
670
|
+
* Table data rows. Each row is an array of cell values aligned with
|
|
671
|
+
* `columns`. A cell may be any `CellValue` (scalars, dates, rich text,
|
|
672
|
+
* hyperlinks, error values, ...) or a `CellFormulaValue` when the cell
|
|
673
|
+
* stores a formula.
|
|
674
|
+
*/
|
|
675
|
+
rows: Array<Array<CellValue | CellFormulaValue>>;
|
|
567
676
|
}
|
|
568
677
|
export type TableColumn = Required<TableColumnProperties>;
|
|
569
678
|
export interface Media {
|
|
@@ -600,4 +709,26 @@ export interface ColBreak {
|
|
|
600
709
|
min?: number;
|
|
601
710
|
man: number;
|
|
602
711
|
}
|
|
712
|
+
export interface IgnoredError {
|
|
713
|
+
/** Cell reference range, e.g. "A1:B10" or "A1:XFD1048576" */
|
|
714
|
+
ref: string;
|
|
715
|
+
/** Ignore "Number Stored as Text" errors (green triangle) */
|
|
716
|
+
numberStoredAsText?: boolean;
|
|
717
|
+
/** Ignore formula errors */
|
|
718
|
+
formula?: boolean;
|
|
719
|
+
/** Ignore formula range errors */
|
|
720
|
+
formulaRange?: boolean;
|
|
721
|
+
/** Ignore unlocked formula errors */
|
|
722
|
+
unlockedFormula?: boolean;
|
|
723
|
+
/** Ignore empty cell reference errors */
|
|
724
|
+
emptyCellReference?: boolean;
|
|
725
|
+
/** Ignore list data validation errors */
|
|
726
|
+
listDataValidation?: boolean;
|
|
727
|
+
/** Ignore calculated column errors */
|
|
728
|
+
calculatedColumn?: boolean;
|
|
729
|
+
/** Ignore eval errors */
|
|
730
|
+
evalError?: boolean;
|
|
731
|
+
/** Ignore two-digit text year errors */
|
|
732
|
+
twoDigitTextYear?: boolean;
|
|
733
|
+
}
|
|
603
734
|
export {};
|
|
@@ -31,6 +31,7 @@ interface ColCache {
|
|
|
31
31
|
decodeEx(value: string): DecodeExResult;
|
|
32
32
|
encodeAddress(row: number, col: number): string;
|
|
33
33
|
encode(...args: number[]): string;
|
|
34
|
+
compareAddress(a: string, b: string): number;
|
|
34
35
|
inRange(range: number[], address: number[]): boolean;
|
|
35
36
|
}
|
|
36
37
|
declare const colCache: ColCache;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This eliminates the duplicated anchor/rel building logic and provides
|
|
6
6
|
* a single, correct image-rel deduplication strategy.
|
|
7
7
|
*/
|
|
8
|
-
interface DrawingAnchor {
|
|
8
|
+
export interface DrawingAnchor {
|
|
9
9
|
picture: {
|
|
10
10
|
rId: string;
|
|
11
11
|
hyperlinks?: {
|
|
@@ -17,13 +17,13 @@ interface DrawingAnchor {
|
|
|
17
17
|
};
|
|
18
18
|
range: any;
|
|
19
19
|
}
|
|
20
|
-
interface DrawingRel {
|
|
20
|
+
export interface DrawingRel {
|
|
21
21
|
Id: string;
|
|
22
22
|
Type: string;
|
|
23
23
|
Target: string;
|
|
24
24
|
TargetMode?: string;
|
|
25
25
|
}
|
|
26
|
-
interface DrawingModel {
|
|
26
|
+
export interface DrawingModel {
|
|
27
27
|
anchors: DrawingAnchor[];
|
|
28
28
|
rels: DrawingRel[];
|
|
29
29
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for manipulating the external-workbook prefix in formula strings.
|
|
3
|
+
*
|
|
4
|
+
* Excel formula strings containing external workbook references have the
|
|
5
|
+
* shape `[<workbook>]Sheet!Ref` where `<workbook>` is either
|
|
6
|
+
*
|
|
7
|
+
* - a 1-based numeric index — `[1]Sheet1!A1` (the canonical on-disk form
|
|
8
|
+
* stored inside `<f>` elements of worksheet XML), or
|
|
9
|
+
* - a filename / relative path — `[测试.xlsx]Sheet1!A1` (what Excel
|
|
10
|
+
* displays in the formula bar; not part of the OOXML storage contract,
|
|
11
|
+
* but produced by hand-written formulas and some older tools).
|
|
12
|
+
*
|
|
13
|
+
* When writing, excelts always emits the numeric form — indices map
|
|
14
|
+
* positionally into the workbook's `<externalReferences>` list. When a
|
|
15
|
+
* formula arrives with the filename form, the writer assigns (or reuses) an
|
|
16
|
+
* ExternalLinkModel with that filename as its `target` and rewrites the
|
|
17
|
+
* formula to the numeric form. This matches how Excel itself stores formulas
|
|
18
|
+
* and makes them round-trippable.
|
|
19
|
+
*
|
|
20
|
+
* The quoted variant `'[file.xlsx]Sheet with space'!A1` is handled too — Excel
|
|
21
|
+
* wraps the `[name]Sheet` segment in single quotes when the sheet name needs
|
|
22
|
+
* quoting. The matching logic here recognises both the unquoted and quoted
|
|
23
|
+
* forms, rewriting inside the quotes when needed.
|
|
24
|
+
*
|
|
25
|
+
* Edge cases we explicitly *do not* treat as external refs:
|
|
26
|
+
* - `[@Column]`, `[#Headers]`, `[Column Name]` — table structured refs
|
|
27
|
+
* (no `]Sheet!` tail). The regex requires the `]<sheet>!` follow-up,
|
|
28
|
+
* which structured refs never have.
|
|
29
|
+
* - Array literals `{1,2;3,4}` use `{}`, not `[]`.
|
|
30
|
+
* - String literals `"[Book]Sheet!A1"` — handled by scanning only outside
|
|
31
|
+
* string literal regions.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* A single match of an external reference inside a formula string. The
|
|
35
|
+
* writer uses `workbook` to find/create an ExternalLinkModel and `sheet`
|
|
36
|
+
* for reporting / sheet-name upsert. `replacement` is the substring that
|
|
37
|
+
* should replace `match` in the final formula (with the workbook token
|
|
38
|
+
* rewritten to a numeric index).
|
|
39
|
+
*/
|
|
40
|
+
export interface ExternalRefMatch {
|
|
41
|
+
/** Full matched prefix including trailing `!`, e.g. `[测试.xlsx]Sheet1!`. */
|
|
42
|
+
match: string;
|
|
43
|
+
/** The workbook token inside `[]` — either numeric or a filename/path. */
|
|
44
|
+
workbook: string;
|
|
45
|
+
/** Whether the workbook token was already a numeric index. */
|
|
46
|
+
numeric: boolean;
|
|
47
|
+
/** The 1-based numeric index parsed from the workbook token, if numeric. */
|
|
48
|
+
index: number | null;
|
|
49
|
+
/** The sheet name (unquoted). */
|
|
50
|
+
sheet: string;
|
|
51
|
+
/** Whether the match came from the quoted variant `'[..]..'!`. */
|
|
52
|
+
quoted: boolean;
|
|
53
|
+
/** Start offset in the source formula. */
|
|
54
|
+
start: number;
|
|
55
|
+
/** End offset (exclusive) in the source formula. */
|
|
56
|
+
end: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Scan a formula string for all external-workbook references. String
|
|
60
|
+
* literals (inside `"..."`) are skipped so that a string value like
|
|
61
|
+
* `"[Book]Sheet!A1"` is not misidentified as a ref.
|
|
62
|
+
*
|
|
63
|
+
* The returned matches are in source order. If a formula contains no
|
|
64
|
+
* external refs, the array is empty.
|
|
65
|
+
*/
|
|
66
|
+
export declare function findExternalRefs(formula: string): ExternalRefMatch[];
|
|
67
|
+
/**
|
|
68
|
+
* Replace every external-workbook token in `formula` using the supplied
|
|
69
|
+
* resolver. The resolver is called once per match and returns the numeric
|
|
70
|
+
* index to substitute; returning `null` leaves the match unchanged (useful
|
|
71
|
+
* when the caller cannot resolve a particular filename).
|
|
72
|
+
*
|
|
73
|
+
* Returns the rewritten formula. Offsets inside the original formula are
|
|
74
|
+
* adjusted correctly even when multiple rewrites change the total length.
|
|
75
|
+
*/
|
|
76
|
+
export declare function rewriteExternalRefs(formula: string, resolve: (match: ExternalRefMatch) => number | null): string;
|
|
@@ -3,12 +3,18 @@ interface EventEmitterLike {
|
|
|
3
3
|
on(event: string, listener: Listener): this;
|
|
4
4
|
removeListener(event: string, listener: Listener): this;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Minimal readable-stream shape consumed by {@link iterateStream}.
|
|
8
|
+
* Intentionally structural so it matches Node `Readable`, zip entry streams,
|
|
9
|
+
* object-mode streams that yield zip entries, and any third-party emitter
|
|
10
|
+
* that raises `data`/`end`/`error`.
|
|
11
|
+
*/
|
|
12
|
+
export interface IterableStreamLike<T = unknown> extends EventEmitterLike {
|
|
7
13
|
resume(): void;
|
|
8
14
|
pause(): void;
|
|
9
|
-
on(event: "data", listener: (chunk:
|
|
15
|
+
on(event: "data", listener: (chunk: T) => void): this;
|
|
10
16
|
on(event: "end", listener: () => void): this;
|
|
11
17
|
on(event: "error", listener: (err: Error) => void): this;
|
|
12
18
|
}
|
|
13
|
-
declare function iterateStream(stream:
|
|
19
|
+
declare function iterateStream<T = Uint8Array | string>(stream: IterableStreamLike<T>): AsyncGenerator<T>;
|
|
14
20
|
export { iterateStream };
|
|
@@ -9,6 +9,7 @@ export declare const OOXML_PATHS: {
|
|
|
9
9
|
readonly xlStyles: "xl/styles.xml";
|
|
10
10
|
readonly xlTheme1: "xl/theme/theme1.xml";
|
|
11
11
|
readonly xlFeaturePropertyBag: "xl/featurePropertyBag/featurePropertyBag.xml";
|
|
12
|
+
readonly xlMetadata: "xl/metadata.xml";
|
|
12
13
|
};
|
|
13
14
|
export declare function normalizeZipPath(path: string): string;
|
|
14
15
|
export declare function getWorksheetNoFromWorksheetPath(path: string): number | undefined;
|
|
@@ -29,6 +30,16 @@ export declare function getPivotTableNameFromRelsPath(path: string): string | un
|
|
|
29
30
|
export declare function getPivotCacheDefinitionNameFromPath(path: string): string | undefined;
|
|
30
31
|
export declare function getPivotCacheDefinitionNameFromRelsPath(path: string): string | undefined;
|
|
31
32
|
export declare function getPivotCacheRecordsNameFromPath(path: string): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Extract the 1-based index `N` from `xl/externalLinks/externalLink{N}.xml`.
|
|
35
|
+
* Returns the raw integer (e.g. `1` for externalLink1.xml) or undefined.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getExternalLinkIndexFromPath(path: string): number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Extract the 1-based index `N` from
|
|
40
|
+
* `xl/externalLinks/_rels/externalLink{N}.xml.rels`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getExternalLinkIndexFromRelsPath(path: string): number | undefined;
|
|
32
43
|
export declare function toContentTypesPartName(zipPath: string): string;
|
|
33
44
|
export declare function themePath(themeName: string): string;
|
|
34
45
|
export declare function mediaPath(filename: string): string;
|
|
@@ -49,12 +60,20 @@ export declare function pivotCacheRecordsPath(n: number | string): string;
|
|
|
49
60
|
export declare function pivotCacheRecordsRelTarget(n: number | string): string;
|
|
50
61
|
export declare function pivotTablePath(n: number | string): string;
|
|
51
62
|
export declare function pivotTableRelsPath(n: number | string): string;
|
|
63
|
+
export declare function externalLinkPath(n: number | string): string;
|
|
64
|
+
export declare function externalLinkRelsPath(n: number | string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Build the `Target` value for an externalLink relationship inside
|
|
67
|
+
* `xl/_rels/workbook.xml.rels` (base: `xl/`).
|
|
68
|
+
*/
|
|
69
|
+
export declare function externalLinkRelTargetFromWorkbook(n: number | string): string;
|
|
52
70
|
export declare function pivotCacheDefinitionRelTargetFromPivotTable(n: number | string): string;
|
|
53
71
|
export declare const OOXML_REL_TARGETS: {
|
|
54
72
|
readonly workbookStyles: "styles.xml";
|
|
55
73
|
readonly workbookSharedStrings: "sharedStrings.xml";
|
|
56
74
|
readonly workbookTheme1: "theme/theme1.xml";
|
|
57
75
|
readonly workbookFeaturePropertyBag: "featurePropertyBag/featurePropertyBag.xml";
|
|
76
|
+
readonly workbookMetadata: "metadata.xml";
|
|
58
77
|
};
|
|
59
78
|
export declare function pivotCacheDefinitionRelTargetFromWorkbook(n: number | string): string;
|
|
60
79
|
export declare function commentsRelTargetFromWorksheet(sheetId: number | string): string;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import type { RichText } from "../types.js";
|
|
2
|
+
/** A shared-string entry may be a plain string or a rich-text payload. */
|
|
3
|
+
export type SharedStringValue = string | {
|
|
4
|
+
richText: RichText[];
|
|
5
|
+
};
|
|
1
6
|
declare class SharedStrings {
|
|
2
7
|
private _values;
|
|
3
8
|
private _totalRefs;
|
|
4
9
|
private _hash;
|
|
5
10
|
constructor();
|
|
6
11
|
get count(): number;
|
|
7
|
-
get values():
|
|
12
|
+
get values(): SharedStringValue[];
|
|
8
13
|
get totalRefs(): number;
|
|
9
|
-
getString(index: number):
|
|
10
|
-
add(value:
|
|
14
|
+
getString(index: number): SharedStringValue;
|
|
15
|
+
add(value: SharedStringValue): number;
|
|
11
16
|
}
|
|
12
17
|
export { SharedStrings };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of applying workbook protection — contains the fields that both
|
|
3
|
+
* Workbook and WorkbookWriter need to persist.
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkbookProtectionHash {
|
|
6
|
+
lockStructure?: boolean;
|
|
7
|
+
lockWindows?: boolean;
|
|
8
|
+
lockRevision?: boolean;
|
|
9
|
+
algorithmName?: string;
|
|
10
|
+
hashValue?: string;
|
|
11
|
+
saltValue?: string;
|
|
12
|
+
spinCount?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build a workbook-protection object with optional password hashing.
|
|
16
|
+
*
|
|
17
|
+
* This is the shared implementation used by both `Workbook.protect()` and
|
|
18
|
+
* `WorkbookWriter.protect()`. The caller is responsible for assigning the
|
|
19
|
+
* result to its own `protection` field.
|
|
20
|
+
*
|
|
21
|
+
* @param password - Optional password to hash
|
|
22
|
+
* @param options - Optional protection flags (lockStructure, lockWindows, lockRevision, spinCount)
|
|
23
|
+
* @returns A fully-populated workbook-protection object
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildWorkbookProtection(password?: string, options?: {
|
|
26
|
+
lockStructure?: boolean;
|
|
27
|
+
lockWindows?: boolean;
|
|
28
|
+
lockRevision?: boolean;
|
|
29
|
+
spinCount?: number;
|
|
30
|
+
}): Promise<WorkbookProtectionHash>;
|