@sheetxl/io-xlsx 0.7.23-beta.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/LICENSE.md +11 -0
- package/README.md +23 -0
- package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +1 -0
- package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +1 -0
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +1 -0
- package/browser/cjs/BE7AtU1GCShmJ8Yu.cjs +1 -0
- package/browser/cjs/CIpMN7SDVREKQUQE.cjs +6 -0
- package/browser/cjs/Chkqh5BZ-MJjAcPF.cjs +5 -0
- package/browser/cjs/D-8WoJkvdPf-79sB.cjs +2 -0
- package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +2 -0
- package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +1 -0
- package/browser/cjs/index.cjs +1 -0
- package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +1 -0
- package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +1 -0
- package/browser/esm/B20zuEvdeypuSU5s.mjs +3851 -0
- package/browser/esm/BVAAJynubTdvPOQA.mjs +24 -0
- package/browser/esm/CLo2oPoIised6GbD.mjs +3617 -0
- package/browser/esm/COSdjubnJ_UgB-Gr.mjs +111 -0
- package/browser/esm/CS1t46OUALKkZxTa.mjs +494 -0
- package/browser/esm/CS8eRkAhoCN8KdGO.mjs +52 -0
- package/browser/esm/CcXnQZ4Fk_nkbq2G.mjs +99 -0
- package/browser/esm/Ch5gA6g56cOtRvJA.mjs +2193 -0
- package/browser/esm/DRuB-nlH4kq_OQJ5.mjs +196 -0
- package/browser/esm/DoKP-E832M9vPWgU.mjs +4675 -0
- package/browser/esm/XoDWB6uCJVrra-pE.mjs +2623 -0
- package/browser/esm/index.mjs +8 -0
- package/licenses/dependencies.txt +60 -0
- package/node/esm/B3Hb3GSFs_FIoXoI.mjs +209 -0
- package/node/esm/BqwG-e5ddQ45fg8w.mjs +2702 -0
- package/node/esm/C81WoKHbCRwhcHWd.mjs +2413 -0
- package/node/esm/CIzCy_gyysEIa_HI.mjs +3700 -0
- package/node/esm/CL8002u21KKQkkL0.mjs +108 -0
- package/node/esm/DF893ovKIDS88O7b.mjs +2237 -0
- package/node/esm/DTuPlHBTHnbLGvxd.mjs +504 -0
- package/node/esm/DVJuJqAXDwgA-ge8.mjs +118 -0
- package/node/esm/index.mjs +52 -0
- package/package.json +55 -0
- package/types/index.d.ts +2 -0
- package/types/src/ConditionalFormatRules.d.ts +86 -0
- package/types/src/ConditionalFormatRules.d.ts.map +1 -0
- package/types/src/DataValidationRules.d.ts +59 -0
- package/types/src/DataValidationRules.d.ts.map +1 -0
- package/types/src/ExcelCompat.d.ts +142 -0
- package/types/src/ExcelCompat.d.ts.map +1 -0
- package/types/src/ExcelFunctionFacts.d.ts +375 -0
- package/types/src/ExcelFunctionFacts.d.ts.map +1 -0
- package/types/src/ExcelReservedNames.d.ts +67 -0
- package/types/src/ExcelReservedNames.d.ts.map +1 -0
- package/types/src/LegacyFormula.d.ts +74 -0
- package/types/src/LegacyFormula.d.ts.map +1 -0
- package/types/src/OOXMLEscape.d.ts +28 -0
- package/types/src/OOXMLEscape.d.ts.map +1 -0
- package/types/src/OOXMLExtensions.d.ts +53 -0
- package/types/src/OOXMLExtensions.d.ts.map +1 -0
- package/types/src/OperandLiterals.d.ts +34 -0
- package/types/src/OperandLiterals.d.ts.map +1 -0
- package/types/src/Plugin.d.ts +16 -0
- package/types/src/Plugin.d.ts.map +1 -0
- package/types/src/SourcePackage.d.ts +76 -0
- package/types/src/SourcePackage.d.ts.map +1 -0
- package/types/src/Types.d.ts +44 -0
- package/types/src/Types.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileReader.d.ts +73 -0
- package/types/src/cfb/CompoundFileReader.d.ts.map +1 -0
- package/types/src/cfb/CompoundFileWriter.d.ts +57 -0
- package/types/src/cfb/CompoundFileWriter.d.ts.map +1 -0
- package/types/src/cfb/index.d.ts +3 -0
- package/types/src/cfb/index.d.ts.map +1 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts +8 -0
- package/types/src/legacyChart/OOXMLMappings.d.ts.map +1 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts +78 -0
- package/types/src/legacyChart/OOXMLUtils.d.ts.map +1 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts +30 -0
- package/types/src/legacyChart/ToOOXMLConverter.d.ts.map +1 -0
- package/types/src/offcrypto/AgileCrypto.d.ts +85 -0
- package/types/src/offcrypto/AgileCrypto.d.ts.map +1 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts +109 -0
- package/types/src/offcrypto/EncryptionInfo.d.ts.map +1 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts +18 -0
- package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts +15 -0
- package/types/src/offcrypto/OffCryptoEncryption.d.ts.map +1 -0
- package/types/src/offcrypto/index.d.ts +5 -0
- package/types/src/offcrypto/index.d.ts.map +1 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts +58 -0
- package/types/src/reader/DummyFunctionUnwrap.d.ts.map +1 -0
- package/types/src/reader/ReaderProfiler.d.ts +45 -0
- package/types/src/reader/ReaderProfiler.d.ts.map +1 -0
- package/types/src/reader/ReaderUtils.d.ts +66 -0
- package/types/src/reader/ReaderUtils.d.ts.map +1 -0
- package/types/src/reader/XLSXReader.d.ts +11 -0
- package/types/src/reader/XLSXReader.d.ts.map +1 -0
- package/types/src/reader/ZipReader.d.ts +62 -0
- package/types/src/reader/ZipReader.d.ts.map +1 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +22 -0
- package/types/src/reader/dom/DOMTransformer.d.ts.map +1 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts +8 -0
- package/types/src/reader/dom/DefaultVisitor.d.ts.map +1 -0
- package/types/src/reader/dom/ExecutionContext.d.ts +78 -0
- package/types/src/reader/dom/ExecutionContext.d.ts.map +1 -0
- package/types/src/reader/dom/NumberUtils.d.ts +17 -0
- package/types/src/reader/dom/NumberUtils.d.ts.map +1 -0
- package/types/src/reader/dom/Types.d.ts +27 -0
- package/types/src/reader/dom/Types.d.ts.map +1 -0
- package/types/src/reader/dom/VisitContext.d.ts +10 -0
- package/types/src/reader/dom/VisitContext.d.ts.map +1 -0
- package/types/src/reader/dom/Visitor.d.ts +23 -0
- package/types/src/reader/dom/Visitor.d.ts.map +1 -0
- package/types/src/reader/dom/VisitorUtils.d.ts +16 -0
- package/types/src/reader/dom/VisitorUtils.d.ts.map +1 -0
- package/types/src/reader/dom/index.d.ts +7 -0
- package/types/src/reader/dom/index.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +25 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts +12 -0
- package/types/src/reader/domVisitors/AxisVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ChartVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +37 -0
- package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/CommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DataPointVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/DrawingVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +32 -0
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +22 -0
- package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LayoutVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/LegendVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/MarkerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts +104 -0
- package/types/src/reader/domVisitors/MetadataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts +3 -0
- package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PersonListVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/RelsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SeriesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +28 -0
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +20 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -0
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts +8 -0
- package/types/src/reader/domVisitors/SortStateVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts +10 -0
- package/types/src/reader/domVisitors/TableVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts +6 -0
- package/types/src/reader/domVisitors/TableX14Visitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +11 -0
- package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThemeVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +6 -0
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts +9 -0
- package/types/src/reader/domVisitors/TitleVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +30 -0
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts.map +1 -0
- package/types/src/reader/domVisitors/index.d.ts +101 -0
- package/types/src/reader/domVisitors/index.d.ts.map +1 -0
- package/types/src/reader/sax/SaxParser.d.ts +34 -0
- package/types/src/reader/sax/SaxParser.d.ts.map +1 -0
- package/types/src/reader/sax/SaxVisitor.d.ts +59 -0
- package/types/src/reader/sax/SaxVisitor.d.ts.map +1 -0
- package/types/src/reader/sax/Saxes.d.ts +641 -0
- package/types/src/reader/sax/Saxes.d.ts.map +1 -0
- package/types/src/reader/sax/index.d.ts +3 -0
- package/types/src/reader/sax/index.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts +32 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts +52 -0
- package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts +74 -0
- package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts.map +1 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts +29 -0
- package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +54 -0
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +22 -0
- package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts.map +1 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +25 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts.map +1 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts +37 -0
- package/types/src/vba/CompoundDocumentCompression.d.ts.map +1 -0
- package/types/src/vba/VBAProject.d.ts +47 -0
- package/types/src/vba/VBAProject.d.ts.map +1 -0
- package/types/src/vba/index.d.ts +3 -0
- package/types/src/vba/index.d.ts.map +1 -0
- package/types/src/writer/XLSXWriter.d.ts +4 -0
- package/types/src/writer/XLSXWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ContentTypes.d.ts +18 -0
- package/types/src/writer/builder/ContentTypes.d.ts.map +1 -0
- package/types/src/writer/builder/Emitter.d.ts +25 -0
- package/types/src/writer/builder/Emitter.d.ts.map +1 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts +29 -0
- package/types/src/writer/builder/EmitterRegistry.d.ts.map +1 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts +26 -0
- package/types/src/writer/builder/OpcXmlUtils.d.ts.map +1 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +148 -0
- package/types/src/writer/builder/PackageBuilder.d.ts.map +1 -0
- package/types/src/writer/builder/PartWriter.d.ts +24 -0
- package/types/src/writer/builder/PartWriter.d.ts.map +1 -0
- package/types/src/writer/builder/RelationshipSet.d.ts +18 -0
- package/types/src/writer/builder/RelationshipSet.d.ts.map +1 -0
- package/types/src/writer/builder/Types.d.ts +311 -0
- package/types/src/writer/builder/Types.d.ts.map +1 -0
- package/types/src/writer/builder/Utils.d.ts +63 -0
- package/types/src/writer/builder/Utils.d.ts.map +1 -0
- package/types/src/writer/builder/XmlWriter.d.ts +3 -0
- package/types/src/writer/builder/XmlWriter.d.ts.map +1 -0
- package/types/src/writer/builder/ZipBackend.d.ts +21 -0
- package/types/src/writer/builder/ZipBackend.d.ts.map +1 -0
- package/types/src/writer/builder/_Types.d.ts +102 -0
- package/types/src/writer/builder/_Types.d.ts.map +1 -0
- package/types/src/writer/builder/index.d.ts +6 -0
- package/types/src/writer/builder/index.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts +7 -0
- package/types/src/writer/emitters/ChartColorsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts +14 -0
- package/types/src/writer/emitters/ChartEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts +46 -0
- package/types/src/writer/emitters/ChartStyleEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts +15 -0
- package/types/src/writer/emitters/DrawingEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts +8 -0
- package/types/src/writer/emitters/MetadataEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts +12 -0
- package/types/src/writer/emitters/PropsAppEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -0
- package/types/src/writer/emitters/PropsCoreEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts +8 -0
- package/types/src/writer/emitters/RichValueEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +28 -0
- package/types/src/writer/emitters/RichValueStructureEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +10 -0
- package/types/src/writer/emitters/RichValueTypesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts +13 -0
- package/types/src/writer/emitters/SharedStringsEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +17 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
- package/types/src/writer/emitters/TableEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts +16 -0
- package/types/src/writer/emitters/ThemeEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +11 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts +18 -0
- package/types/src/writer/emitters/WorksheetEmitter.d.ts.map +1 -0
- package/types/src/writer/emitters/index.d.ts +3 -0
- package/types/src/writer/emitters/index.d.ts.map +1 -0
- package/types/src/writer/utils/AutoFilter.d.ts +15 -0
- package/types/src/writer/utils/AutoFilter.d.ts.map +1 -0
- package/types/src/writer/utils/ColorUtils.d.ts +46 -0
- package/types/src/writer/utils/ColorUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts +26 -0
- package/types/src/writer/utils/DrawMLUtils.d.ts.map +1 -0
- package/types/src/writer/utils/DummyFunction.d.ts +66 -0
- package/types/src/writer/utils/DummyFunction.d.ts.map +1 -0
- package/types/src/writer/utils/DxfCollector.d.ts +22 -0
- package/types/src/writer/utils/DxfCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts +3 -0
- package/types/src/writer/utils/ExtLstUtils.d.ts.map +1 -0
- package/types/src/writer/utils/IDUtils.d.ts +2 -0
- package/types/src/writer/utils/IDUtils.d.ts.map +1 -0
- package/types/src/writer/utils/MetadataCollector.d.ts +146 -0
- package/types/src/writer/utils/MetadataCollector.d.ts.map +1 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts +3 -0
- package/types/src/writer/utils/ProtectionUtils.d.ts.map +1 -0
- package/types/src/writer/utils/RichValueCollector.d.ts +200 -0
- package/types/src/writer/utils/RichValueCollector.d.ts.map +1 -0
- package/types/src/writer/utils/TextUtils.d.ts +8 -0
- package/types/src/writer/utils/TextUtils.d.ts.map +1 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts +19 -0
- package/types/src/writer/utils/UnsupportedFunctions.d.ts.map +1 -0
- package/types/src/writer/utils/VersionUtils.d.ts +26 -0
- package/types/src/writer/utils/VersionUtils.d.ts.map +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Scalar } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The OOXML `<formula>` operand fold, shared by the two condition borders
|
|
4
|
+
* ({@link ConditionalFormatRules} and {@link DataValidationRules}).
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* A `cellIs` operand and a DV comparison bound are stored by OOXML as formula TEXT. Most of the
|
|
8
|
+
* time that text is a literal — `5`, `"abc"`, `TRUE`, `#N/A` — and the SDK's condition param wants
|
|
9
|
+
* the value, not the spelling. Anything else is a real formula, and the param carries it as
|
|
10
|
+
* `'=' + text`: the leading `=` is the one discriminator between text and formula (the same
|
|
11
|
+
* convention `Sheet` entry parsing uses), and it is what lets the writer quote text correctly on
|
|
12
|
+
* the way back out.
|
|
13
|
+
*
|
|
14
|
+
* What counts as a literal is the calculation compiler's own answer
|
|
15
|
+
* ({@link parseFormulaLiteral}), not a parallel grammar — which is also what folds quoted before
|
|
16
|
+
* numeric, so `"5"` stays the text five.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Folds OOXML formula text into a condition param: a literal becomes its value, anything else is a
|
|
20
|
+
* formula and returns as `'=' + text`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formulaTextToParam(text: string | undefined): Scalar | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The exact inverse of {@link formulaTextToParam}: a condition param as OOXML formula text.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* `undefined`/`null` return `undefined` — the caller decides whether an absent operand is an
|
|
28
|
+
* omitted element (DV) or an empty one (CF). NOT for the typed slots (`expression` param, `inSet`
|
|
29
|
+
* items, cfvo stops): those are formula text by TYPE and carry no `=` marker.
|
|
30
|
+
*/
|
|
31
|
+
export declare function paramToFormulaText(param: unknown): string | undefined;
|
|
32
|
+
/** A formula string literal, with embedded quotes doubled. */
|
|
33
|
+
export declare function quote(text: string): string;
|
|
34
|
+
//# sourceMappingURL=OperandLiterals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperandLiterals.d.ts","sourceRoot":"","sources":["../../../src/OperandLiterals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9E;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM/E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkBrE;AAED,8DAA8D;AAC9D,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IWorkbookIO } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The registry key both formats below share. Also the "same package family" test at the writer's
|
|
4
|
+
* source-package seam (`XLSXWriter.ts`) — an origin only ever gets a retained `SourcePackage` by
|
|
5
|
+
* successfully zip-parsing under {@link ReadFormat}'s handler, so this key alone is enough to tell
|
|
6
|
+
* a genuine xlsx/xlsm round trip from a `.sxl`/`.csv` origin, without needing path/extension info a
|
|
7
|
+
* server-side buffer read may not have. See `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
|
|
8
|
+
*/
|
|
9
|
+
export declare const XLSX_FORMAT_KEY = "Excel";
|
|
10
|
+
/**
|
|
11
|
+
* Registers all built-in read and write formats with the provided WorkbookIO registry.
|
|
12
|
+
*
|
|
13
|
+
* @param registry - The WorkbookIO instance to register formats with. Defaults to the global WorkbookIO.
|
|
14
|
+
*/
|
|
15
|
+
export declare const IOPlugin: IWorkbookIO.Plugin;
|
|
16
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,cAAc,CAAC;AAQhE;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,UAAU,CAAC;AAiCvC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,MAkBlC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { IWorkbookIO } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The default upper bound, in decompressed bytes, on what a {@link SourcePackage} will retain.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Applies to the retained parts only — worksheet/chartsheet bodies and shared strings are never
|
|
7
|
+
* retained (they are always model-owned and rewritten on every save), so this is not the file's
|
|
8
|
+
* uncompressed size, just the "side parts" (styles, drawings, media, printer settings, …) that
|
|
9
|
+
* would otherwise be copied through untouched. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SOURCE_PACKAGE_MAX_BYTES: number;
|
|
12
|
+
/**
|
|
13
|
+
* A part's still-compressed bytes, sliced directly out of the source zip's local file header —
|
|
14
|
+
* never inflated on read, never re-deflated on a pass-through write. See `ZipReader.getRawEntry`.
|
|
15
|
+
*/
|
|
16
|
+
export interface SourcePackageRawPart {
|
|
17
|
+
readonly compressedData: Uint8Array;
|
|
18
|
+
readonly compressionMethod: number;
|
|
19
|
+
/** CRC32 of the uncompressed content. */
|
|
20
|
+
readonly signature: number;
|
|
21
|
+
}
|
|
22
|
+
/** One retained OPC part. */
|
|
23
|
+
export interface SourcePackagePart {
|
|
24
|
+
/** Already-decompressed bytes — always present; the fallback whenever {@link raw} isn't. */
|
|
25
|
+
readonly data: Uint8Array;
|
|
26
|
+
readonly uncompressedSize: number;
|
|
27
|
+
/** Present when the source's compressed bytes could be sliced out directly; see {@link SourcePackageRawPart}. */
|
|
28
|
+
readonly raw?: SourcePackageRawPart;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The parts of a source OOXML package that SheetXL read but does not model — retained verbatim so
|
|
32
|
+
* a save can pass them through instead of silently dropping them. See
|
|
33
|
+
* `DESIGN-PACKAGE-PASSTHROUGH.md`.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Not a residue map: this holds every non-streamed part from the source zip, decompressed. Which
|
|
37
|
+
* of those a save actually copies through (vs. an emitter claiming the path, vs. a drop-bucket
|
|
38
|
+
* rule) is decided at write time, not here.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SourcePackage {
|
|
41
|
+
private readonly _parts;
|
|
42
|
+
private readonly _totalBytes;
|
|
43
|
+
private _structurallyChanged;
|
|
44
|
+
constructor(parts: ReadonlyMap<string, SourcePackagePart>);
|
|
45
|
+
getNames(): string[];
|
|
46
|
+
has(name: string): boolean;
|
|
47
|
+
getPart(name: string): SourcePackagePart | null;
|
|
48
|
+
/** Sum of {@link SourcePackagePart.data}'s byte lengths across every retained part. */
|
|
49
|
+
getTotalBytes(): number;
|
|
50
|
+
/**
|
|
51
|
+
* A one-way latch: once true, stays true for this package's lifetime (i.e. until the origin is
|
|
52
|
+
* closed and a fresh read replaces it). Set by the reader when it detects a structural edit —
|
|
53
|
+
* sheet add/delete/reorder, row/column insert/delete — since the read that produced this package.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Deliberately never resets on an undo: an undo doesn't guarantee the exact original XML-level
|
|
57
|
+
* geometry a preserved part assumed, and the parts this gates (`DESIGN-PACKAGE-PASSTHROUGH.md`
|
|
58
|
+
* §4's drop-if-structure-changed bucket) are exactly the ones a wrong guess here would corrupt.
|
|
59
|
+
*/
|
|
60
|
+
hasStructuralChange(): boolean;
|
|
61
|
+
markStructuralChange(): void;
|
|
62
|
+
}
|
|
63
|
+
/** The package retained for `origin`, or `null` if none was retained (or `origin` is unset). */
|
|
64
|
+
export declare function getSourcePackage(origin: IWorkbookIO.Origin | null | undefined): SourcePackage | null;
|
|
65
|
+
/**
|
|
66
|
+
* Retain `sourcePackage` for `origin`, replacing anything previously retained for it.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Owned entirely by io-xlsx — the origin never learns this exists (no sdk change). Lifetime
|
|
70
|
+
* follows the origin: stable across a save, fresh (and empty) for a copy or a new workbook, and
|
|
71
|
+
* released via {@link releaseSourcePackage} on `IWorkbook.close()`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function setSourcePackage(origin: IWorkbookIO.Origin, sourcePackage: SourcePackage): void;
|
|
74
|
+
/** Release whatever is retained for `origin`, if anything. Safe to call unconditionally. */
|
|
75
|
+
export declare function releaseSourcePackage(origin: IWorkbookIO.Origin | null | undefined): void;
|
|
76
|
+
//# sourceMappingURL=SourcePackage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourcePackage.d.ts","sourceRoot":"","sources":["../../../src/SourcePackage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,QAAmB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,cAAc,EAAE,UAAU,CAAC;IACpC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,6BAA6B;AAC7B,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,iHAAiH;IACjH,QAAQ,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,oBAAoB,CAAS;gBAEzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAOzD,QAAQ,IAAI,MAAM,EAAE;IAIpB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAI/C,uFAAuF;IACvF,aAAa,IAAI,MAAM;IAIvB;;;;;;;;;OASG;IACH,mBAAmB,IAAI,OAAO;IAI9B,oBAAoB,IAAI,IAAI;CAG7B;AAID,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAGpG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI,CAE/F;AAED,4FAA4F;AAC5F,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAGxF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IWorkbookIO } from '@sheetxl/sdk';
|
|
2
|
+
import { VBAProject } from './vba';
|
|
3
|
+
import { ReaderProfiler } from './reader/ReaderProfiler';
|
|
4
|
+
/**
|
|
5
|
+
* Options for exporting to XLSX file format.
|
|
6
|
+
*/
|
|
7
|
+
export interface WriteXLSXOptions extends IWorkbookIO.WriteOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Callback invoked when a part is emitted.
|
|
10
|
+
*
|
|
11
|
+
* @param kind The kind of the part.
|
|
12
|
+
* @param path The path of the part.
|
|
13
|
+
* @param bytes The bytes of the emitted part.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Useful for logging or debugging emitted parts.
|
|
17
|
+
*/
|
|
18
|
+
onPartEmitted?: (kind: string, path: string, bytes: Uint8Array) => void | Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Options for importing from XLSX file format.
|
|
22
|
+
*/
|
|
23
|
+
export interface ReadXLSXOptions extends IWorkbookIO.ReadOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Callback invoked with the extracted VBA project if the workbook contains a `xl/vbaProject.bin`.
|
|
26
|
+
*
|
|
27
|
+
* @param project The decoded project: code page plus `{ name, code }` modules.
|
|
28
|
+
*/
|
|
29
|
+
onVBA?: (project: VBAProject.Project) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Capture per-phase time and JS heap usage while reading (development/diagnostics aid).
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue `false`
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* - `true` — logs a `console.table` of phase timings/heap deltas when the read completes.
|
|
37
|
+
* - a function — receives each {@link ReaderProfiler.Sample} as it is marked (custom sink).
|
|
38
|
+
*
|
|
39
|
+
* Heap numbers are sampled, not GC-fenced, so deltas indicate allocation pressure between
|
|
40
|
+
* phases rather than exact retained size. Off by default and zero-overhead when unset.
|
|
41
|
+
*/
|
|
42
|
+
profile?: boolean | ReaderProfiler.Sink;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW,CAAC,YAAY;IAehE;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW,CAAC,WAAW;IAK9D;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,KAAK,IAAI,CAAC;IAE9C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC;CACzC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal reader for the OLE Compound File Binary format (MS-CFB), the little FAT-based container
|
|
3
|
+
* Microsoft uses whenever a "file" is really several streams.
|
|
4
|
+
*
|
|
5
|
+
* @see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Two consumers, which is why this lives beside them rather than inside either:
|
|
9
|
+
* - **VBA** — `xl/vbaProject.bin` (`dir`, `VBA/*` module streams).
|
|
10
|
+
* - **Encryption** — a password-protected Office file is a CFB holding `EncryptionInfo` +
|
|
11
|
+
* `EncryptedPackage`, whatever format the payload happens to be.
|
|
12
|
+
*
|
|
13
|
+
* This logic was adapted from SheetJS's `XLSX.CFB.read`; we own the FAT / directory / mini-FAT
|
|
14
|
+
* walk. It is deliberately read-only and only as complete as those two cases need:
|
|
15
|
+
* - CFB v3 (512-byte sectors) and v4 (4096-byte sectors).
|
|
16
|
+
* - DIFAT both in the header (first 109 entries) and chained in extra sectors.
|
|
17
|
+
* - The mini-FAT / mini-stream for streams smaller than the cutoff (4096) — where every VBA stream
|
|
18
|
+
* in a typical project lives, and where `EncryptionInfo` lives too.
|
|
19
|
+
*
|
|
20
|
+
* Stream sizes are read as 32-bit (see {@link CompoundFileReader.Entry.size}).
|
|
21
|
+
*/
|
|
22
|
+
export declare class CompoundFileReader {
|
|
23
|
+
private static readonly SIGNATURE;
|
|
24
|
+
private static readonly ENDOFCHAIN;
|
|
25
|
+
private static readonly FREESECT;
|
|
26
|
+
private readonly buf;
|
|
27
|
+
private readonly dv;
|
|
28
|
+
private readonly sectorSize;
|
|
29
|
+
private readonly miniSectorSize;
|
|
30
|
+
private readonly miniStreamCutoff;
|
|
31
|
+
private readonly fat;
|
|
32
|
+
private readonly miniFat;
|
|
33
|
+
private readonly entries;
|
|
34
|
+
private readonly byName;
|
|
35
|
+
private readonly miniStream;
|
|
36
|
+
private constructor();
|
|
37
|
+
static read(buffer: Uint8Array | ArrayBuffer): CompoundFileReader;
|
|
38
|
+
private sectorOffset;
|
|
39
|
+
/** Walk a FAT sector chain, returning the concatenated (sector-aligned) bytes. */
|
|
40
|
+
private readChain;
|
|
41
|
+
private readChainSized;
|
|
42
|
+
/** Walk a mini-FAT chain out of the mini-stream. */
|
|
43
|
+
private readMiniChain;
|
|
44
|
+
private static concat;
|
|
45
|
+
/** Stream entries (type 2), in directory order. */
|
|
46
|
+
getStreamEntries(): readonly CompoundFileReader.Entry[];
|
|
47
|
+
has(name: string): boolean;
|
|
48
|
+
/** Decompressed bytes of a stream by (case-sensitive) name, or `null` if absent. */
|
|
49
|
+
readStream(name: string): Uint8Array | null;
|
|
50
|
+
readStreamEntry(entry: CompoundFileReader.Entry): Uint8Array;
|
|
51
|
+
}
|
|
52
|
+
export declare namespace CompoundFileReader {
|
|
53
|
+
/** A directory entry (storage or stream) in the compound file. */
|
|
54
|
+
interface Entry {
|
|
55
|
+
/** UTF-16 entry name (e.g. `Module1`, `dir`, `VBA`). */
|
|
56
|
+
name: string;
|
|
57
|
+
/** Object type: 1 storage, 2 stream, 5 root. */
|
|
58
|
+
type: number;
|
|
59
|
+
/** Starting sector (FAT sector for large streams, mini-FAT sector for small). */
|
|
60
|
+
startSector: number;
|
|
61
|
+
/**
|
|
62
|
+
* Stream size in bytes.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Only the low dword is read (it is always the whole size for v3, where the high dword must be
|
|
66
|
+
* zero). A v4 stream could in principle exceed 4 GB; neither a VBA module nor a workbook we can
|
|
67
|
+
* hold in memory does, and the reader buffers the whole file anyway — so a size that large is
|
|
68
|
+
* out of reach long before this truncates.
|
|
69
|
+
*/
|
|
70
|
+
size: number;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=CompoundFileReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompoundFileReader.d.ts","sourceRoot":"","sources":["../../../../src/cfb/CompoundFileReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAc;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAc;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAc;IAE9C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAW;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,OAAO;IAsFP,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,kBAAkB;IAKjE,OAAO,CAAC,YAAY;IAIpB,kFAAkF;IAClF,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,cAAc;IAItB,oDAAoD;IACpD,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,MAAM,CAAC,MAAM;IASrB,mDAAmD;IACnD,gBAAgB,IAAI,SAAS,kBAAkB,CAAC,KAAK,EAAE;IAIvD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,oFAAoF;IACpF,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAM3C,eAAe,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,GAAG,UAAU;CAK7D;AAED,yBAAiB,kBAAkB,CAAC;IAClC,kEAAkE;IAClE,UAAiB,KAAK;QACpB,wDAAwD;QACxD,IAAI,EAAE,MAAM,CAAC;QACb,gDAAgD;QAChD,IAAI,EAAE,MAAM,CAAC;QACb,iFAAiF;QACjF,WAAW,EAAE,MAAM,CAAC;QACpB;;;;;;;;WAQG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal writer for the OLE Compound File Binary format (MS-CFB) — the container a
|
|
3
|
+
* password-protected Office file is.
|
|
4
|
+
*
|
|
5
|
+
* @see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Deliberately narrow, and the counterpart to {@link CompoundFileReader}: it writes a **flat** file
|
|
9
|
+
* — one root storage holding a handful of streams, no nested storages, no incremental edit, no
|
|
10
|
+
* free-sector reuse. That is all an encryption container needs (`EncryptionInfo` +
|
|
11
|
+
* `EncryptedPackage`), and it keeps this at a few hundred lines instead of a general
|
|
12
|
+
* implementation.
|
|
13
|
+
*
|
|
14
|
+
* Two details are not optional despite looking like they might be:
|
|
15
|
+
* - **Streams smaller than 4096 bytes go in the mini stream.** Readers (including ours, and Excel)
|
|
16
|
+
* choose where to look by comparing the stream size against the header's cutoff, so a small
|
|
17
|
+
* stream written to the regular FAT is simply read from the wrong place.
|
|
18
|
+
* - **The DIFAT chains past 109 FAT sectors.** With 512-byte sectors that limit arrives at ~7MB —
|
|
19
|
+
* an ordinary workbook — so a writer that only fills the header's DIFAT array silently produces
|
|
20
|
+
* corrupt files once the payload is big enough.
|
|
21
|
+
*/
|
|
22
|
+
export declare class CompoundFileWriter {
|
|
23
|
+
private static readonly SIGNATURE;
|
|
24
|
+
private static readonly FATSECT;
|
|
25
|
+
private static readonly DIFSECT;
|
|
26
|
+
private static readonly ENDOFCHAIN;
|
|
27
|
+
private static readonly FREESECT;
|
|
28
|
+
private static readonly NOSTREAM;
|
|
29
|
+
/** v3: 512-byte sectors. Excel writes v3 for encryption containers, so we match it. */
|
|
30
|
+
private static readonly SECTOR_SIZE;
|
|
31
|
+
private static readonly MINI_SECTOR_SIZE;
|
|
32
|
+
private static readonly MINI_CUTOFF;
|
|
33
|
+
private static readonly DIR_ENTRY_SIZE;
|
|
34
|
+
/** FAT sector numbers that fit in the header before the DIFAT has to chain. */
|
|
35
|
+
private static readonly DIFAT_HEADER_COUNT;
|
|
36
|
+
/** Sector payloads, in allocation order; index === sector number. */
|
|
37
|
+
private readonly sectors;
|
|
38
|
+
/** `fat[i]` is the next sector after sector `i` (or a special value). */
|
|
39
|
+
private readonly fat;
|
|
40
|
+
private constructor();
|
|
41
|
+
/**
|
|
42
|
+
* Builds a compound file containing `entries` as streams of the root storage.
|
|
43
|
+
*
|
|
44
|
+
* @param entries Streams in the order they should appear in the directory. Names are compared
|
|
45
|
+
* case-insensitively by readers; duplicates are the caller's problem.
|
|
46
|
+
*/
|
|
47
|
+
static write(entries: readonly {
|
|
48
|
+
name: string;
|
|
49
|
+
data: Uint8Array;
|
|
50
|
+
}[]): Uint8Array;
|
|
51
|
+
/** Appends `data` as a fresh chain of whole sectors; returns its first sector number. */
|
|
52
|
+
private allocate;
|
|
53
|
+
private _build;
|
|
54
|
+
/** Builds one 128-byte directory entry. */
|
|
55
|
+
private _directoryEntry;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=CompoundFileWriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompoundFileWriter.d.ts","sourceRoot":"","sources":["../../../../src/cfb/CompoundFileWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAoD;IAErF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAc;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAc;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAc;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAc;IAC9C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAc;IAE9C,uFAAuF;IACvF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAO;IAC1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAM;IAC9C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAQ;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAO;IAC7C,+EAA+E;IAC/E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IAEjD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IAEpC,OAAO;IAEP;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,EAAE,GAAG,UAAU;IAIhF,yFAAyF;IACzF,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,MAAM;IA2Kd,2CAA2C;IAC3C,OAAO,CAAC,eAAe;CAqBxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cfb/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const toOOXMLLineCap: (value: string) => string | undefined;
|
|
2
|
+
export declare const toOOXMLAlign: (value: string) => string;
|
|
3
|
+
export declare const toOOXMLCompound: (value: string) => string;
|
|
4
|
+
export declare const toOOXMLGradientType: (value: string) => string;
|
|
5
|
+
export declare const toOOXMLPoints: (pixels: number) => number;
|
|
6
|
+
export declare const toPixelFromEmu: (emu: number) => number;
|
|
7
|
+
export declare const toOOXMLAngle: (deg: number) => number;
|
|
8
|
+
//# sourceMappingURL=OOXMLMappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OOXMLMappings.d.ts","sourceRoot":"","sources":["../../../../src/legacyChart/OOXMLMappings.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,SASvD,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAE5C,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,KAAG,MAK/C,CAAA;AAGD,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,MAWnD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,MAE9C,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAE5C,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAE1C,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const getAxisID: () => number;
|
|
2
|
+
export declare const isMultiLevel: (objChartSeries: any, pointCoord: any) => boolean;
|
|
3
|
+
export declare function getValues(objChartSeries: any, pointCoord: any, isMultiLevel?: boolean): {
|
|
4
|
+
isNumericList: boolean;
|
|
5
|
+
values: any[];
|
|
6
|
+
formatCodes: Map<any, any>;
|
|
7
|
+
listFormatCode: any;
|
|
8
|
+
allSameFormatCodes: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function getMultiLevelValues(objChartSeries: any, pointCoord: any): {
|
|
11
|
+
isNumericList: boolean;
|
|
12
|
+
values: number[][];
|
|
13
|
+
formatCodes: Map<any, any>;
|
|
14
|
+
listFormatCode: null;
|
|
15
|
+
allSameFormatCodes: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function createDataList(execContext: any, values: any, xmlNode: any, setFormatCodes?: boolean, formatCodes?: Map<number, string> | null): void;
|
|
18
|
+
export declare function getDPt(execContext: any, dPtNodes: any, idx: number): any;
|
|
19
|
+
export declare const builtInDisplayUnitsKeys: string[];
|
|
20
|
+
export declare const builtInDisplayUnits: {
|
|
21
|
+
none: {
|
|
22
|
+
description: string;
|
|
23
|
+
multi: number;
|
|
24
|
+
};
|
|
25
|
+
hundreds: {
|
|
26
|
+
description: string;
|
|
27
|
+
multi: number;
|
|
28
|
+
};
|
|
29
|
+
thousands: {
|
|
30
|
+
description: string;
|
|
31
|
+
multi: number;
|
|
32
|
+
};
|
|
33
|
+
tenThousands: {
|
|
34
|
+
description: string;
|
|
35
|
+
multi: number;
|
|
36
|
+
};
|
|
37
|
+
hundredThousands: {
|
|
38
|
+
description: string;
|
|
39
|
+
multi: number;
|
|
40
|
+
};
|
|
41
|
+
millions: {
|
|
42
|
+
description: string;
|
|
43
|
+
multi: number;
|
|
44
|
+
};
|
|
45
|
+
tenMillions: {
|
|
46
|
+
description: string;
|
|
47
|
+
multi: number;
|
|
48
|
+
};
|
|
49
|
+
hundredMillions: {
|
|
50
|
+
description: string;
|
|
51
|
+
multi: number;
|
|
52
|
+
};
|
|
53
|
+
billions: {
|
|
54
|
+
description: string;
|
|
55
|
+
multi: number;
|
|
56
|
+
};
|
|
57
|
+
trillions: {
|
|
58
|
+
description: string;
|
|
59
|
+
multi: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const isLineType: (chartType: string) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Create a string from an array of cells.
|
|
65
|
+
* @param cells
|
|
66
|
+
* @param separator
|
|
67
|
+
* This is being used by OOXML import from the charting code. Not sure what it is doing but it's incorrectly.
|
|
68
|
+
*/
|
|
69
|
+
export declare const stringFromCells: (cells: any[], separator?: string) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Rolls a potential 2d array into a single array.
|
|
72
|
+
* @param array
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* This is not recursive and only handles arrays of 2 levels deep.
|
|
76
|
+
*/
|
|
77
|
+
export declare function flatten2DArray<T = any>(array: readonly T[]): T[] | null;
|
|
78
|
+
//# sourceMappingURL=OOXMLUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OOXMLUtils.d.ts","sourceRoot":"","sources":["../../../../src/legacyChart/OOXMLUtils.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,QAAO,MAU5B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,gBAAgB,GAAG,EAAE,YAAY,GAAG,KAAG,OAWnE,CAAA;AAED,wBAAgB,SAAS,CAAC,cAAc,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,GAAE,OAAa;;;;;;EAM1F;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG;;;;;;EAuBvE;AAkED,wBAAgB,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAE,OAAa,EAAE,WAAW,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAS,GAAG,IAAI,CAY7J;AAED,wBAAgB,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,OAYlE;AAGD,eAAO,MAAM,uBAAuB,UAWnC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW/B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,OAK9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,GAAG,EAAE,EAAE,kBAAa,KAAG,MAW7D,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAerE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Document as PartialDocument, Element as PartialElement } from '@xmldom/xmldom';
|
|
2
|
+
export declare function getNativeClass(obj: any): string;
|
|
3
|
+
export declare function getAnyClass(obj: any): string;
|
|
4
|
+
export interface ToOOXMLContext {
|
|
5
|
+
}
|
|
6
|
+
export declare class ToOOXMLConverter {
|
|
7
|
+
visitHandlerRegistry: Record<string, any>;
|
|
8
|
+
rootModelObj: any;
|
|
9
|
+
rootXmlDoc: PartialDocument | null;
|
|
10
|
+
visitedModels: any[];
|
|
11
|
+
nodePath: PartialElement[];
|
|
12
|
+
axisIds: Map<number, any>;
|
|
13
|
+
c16UniqueIdCounter: number;
|
|
14
|
+
constructor();
|
|
15
|
+
setAttribute(xmlNode: PartialElement, attrName: string, attrValue: any): void;
|
|
16
|
+
createNode(xmlNodeName: string): PartialElement;
|
|
17
|
+
createChildNodes(xmlNode: PartialElement, xpath: string): PartialElement;
|
|
18
|
+
createTextNode(text: string): PartialElement;
|
|
19
|
+
createChildNode(xmlNode: PartialElement, childNodeName: string): PartialElement;
|
|
20
|
+
appendChildNode(xmlParentNode: PartialElement, xmlChildNode: PartialElement, condition?: boolean): void;
|
|
21
|
+
appendNonEmptyChildNode(xmlParentNode: PartialElement, xmlChildNode: PartialElement): void;
|
|
22
|
+
copyValue(modelObj: any, modelPropertyPath: string, xmlNode: PartialElement, xmlChildNodeName: string, setterFunction: any, copyCheck?: (prop: any) => boolean): void;
|
|
23
|
+
getNode(xmlNode: PartialElement, xpath: string): PartialElement | undefined;
|
|
24
|
+
visit(xmlNode: PartialElement, modelChildObj: any, xmlChildNodeName: string | null, visitorOverride?: any): PartialElement | null;
|
|
25
|
+
getParentNode(): PartialElement;
|
|
26
|
+
getParentModel(): any;
|
|
27
|
+
convert(chartShape: any, options?: any): string;
|
|
28
|
+
}
|
|
29
|
+
export type ToHandler<T = any> = (context: any, json: T, element: PartialElement) => void;
|
|
30
|
+
//# sourceMappingURL=ToOOXMLConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToOOXMLConverter.d.ts","sourceRoot":"","sources":["../../../../src/legacyChart/ToOOXMLConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,IAAI,eAAe,EAAE,KAAK,OAAO,IAAI,cAAc,EACjE,MAAM,gBAAgB,CAAC;AAkBxB,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAK/C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAI5C;AAED,MAAM,WAAW,cAAc;CAE9B;AAGD,qBAAa,gBAAgB;IAC3B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE1C,YAAY,EAAE,GAAG,CAAQ;IACzB,UAAU,EAAE,eAAe,GAAG,IAAI,CAAQ;IAC1C,aAAa,EAAE,GAAG,EAAE,CAAM;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAM;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAK;;IA8B/B,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI;IAM7E,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc;IAI/C,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc;IAgBxE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAI5C,eAAe,CAAC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,GAAG,cAAc;IAM/E,eAAe,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,UAAK,GAAG,IAAI;IAMlG,uBAAuB,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,GAAG,IAAI;IAI1F,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAC,CAAC,IAAI,EAAE,GAAG,KAAK,OAAwB;IAa7K,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAuB3E,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAAE,eAAe,CAAC,EAAE,GAAG,GAAG,cAAc,GAAG,IAAI;IA2BjI,aAAa;IAIb,cAAc;IASd,OAAO,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,GAAE,GAAQ;CAmD3C;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,GAAC,GAAG,IAAI,CAC7B,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,cAAc,KACpB,IAAI,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { EncryptionInfo } from './EncryptionInfo';
|
|
2
|
+
/**
|
|
3
|
+
* Key derivation and block decryption for MS-OFFCRYPTO **agile** encryption, over WebCrypto.
|
|
4
|
+
*
|
|
5
|
+
* @see https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto/a57cb947-554f-4e5e-b150-3f2978225e92
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* WebCrypto is used rather than a JS crypto library because the key derivation is `spinCount`
|
|
9
|
+
* (100 000 by default) *serial* hash rounds: native digests make that ~0.1s where pure JS makes it
|
|
10
|
+
* seconds, and it sits directly between the user and their file.
|
|
11
|
+
*/
|
|
12
|
+
export declare namespace AgileCrypto {
|
|
13
|
+
/**
|
|
14
|
+
* An `ArrayBuffer`-backed view. WebCrypto rejects `SharedArrayBuffer`-backed ones, and a
|
|
15
|
+
* `Uint8Array` sliced out of arbitrary input is only `ArrayBufferLike` — so every buffer handed to
|
|
16
|
+
* `subtle.*` is normalized through {@link owned} first.
|
|
17
|
+
*/
|
|
18
|
+
type Bytes = Uint8Array<ArrayBuffer>;
|
|
19
|
+
/**
|
|
20
|
+
* Verifies `password` against the verifier pair, and on success returns the payload's secret key.
|
|
21
|
+
*
|
|
22
|
+
* @returns The decrypted `encryptedKeyValue`, or `null` when the password is wrong.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* The verifier exists so a wrong password is detected in milliseconds against ~100 bytes, rather
|
|
26
|
+
* than by decrypting the whole file and finding garbage.
|
|
27
|
+
*/
|
|
28
|
+
export const resolveSecretKey: (info: EncryptionInfo.Agile, password: string) => Promise<Bytes | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Decrypts the `EncryptedPackage` stream: an 8-byte little-endian plaintext length followed by
|
|
31
|
+
* AES-CBC segments, each with its own IV derived from the segment index.
|
|
32
|
+
*/
|
|
33
|
+
export const decryptPackage: (info: EncryptionInfo.Agile, secretKey: Bytes, encryptedPackage: Uint8Array) => Promise<Bytes>;
|
|
34
|
+
/**
|
|
35
|
+
* Checks the `dataIntegrity` HMAC over the encrypted package.
|
|
36
|
+
*
|
|
37
|
+
* @returns `true` when it matches, or when the container carries no HMAC to check.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Agile encryption is AES-CBC — unauthenticated — so without this a tampered payload decrypts to
|
|
41
|
+
* plausible-looking garbage rather than being rejected. The HMAC key is itself wrapped with the
|
|
42
|
+
* package key, so only someone who supplied the right password can verify it.
|
|
43
|
+
*/
|
|
44
|
+
export const verifyIntegrity: (info: EncryptionInfo.Agile, secretKey: Bytes, encryptedPackage: Uint8Array) => Promise<boolean>;
|
|
45
|
+
/** The parameters Excel writes, and what we write too. */
|
|
46
|
+
export const DEFAULTS: {
|
|
47
|
+
readonly hashAlgorithm: "SHA512";
|
|
48
|
+
readonly cipherAlgorithm: "AES";
|
|
49
|
+
readonly cipherChaining: "ChainingModeCBC";
|
|
50
|
+
readonly saltSize: 16;
|
|
51
|
+
readonly blockSize: 16;
|
|
52
|
+
readonly keyBits: 256;
|
|
53
|
+
readonly hashSize: 64;
|
|
54
|
+
/** Excel writes 100000. The cost IS the protection, so this is not a knob to turn down. */
|
|
55
|
+
readonly spinCount: 100000;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The material a freshly encrypted package needs: the descriptor values that go into
|
|
59
|
+
* `EncryptionInfo`, plus the encrypted payload.
|
|
60
|
+
*/
|
|
61
|
+
export interface Encrypted {
|
|
62
|
+
keyDataSalt: Bytes;
|
|
63
|
+
encryptorSalt: Bytes;
|
|
64
|
+
encryptedVerifierHashInput: Bytes;
|
|
65
|
+
encryptedVerifierHashValue: Bytes;
|
|
66
|
+
encryptedKeyValue: Bytes;
|
|
67
|
+
encryptedHmacKey: Bytes;
|
|
68
|
+
encryptedHmacValue: Bytes;
|
|
69
|
+
encryptedPackage: Bytes;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Encrypts `payload` under `password`, producing everything the container needs.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Mirrors {@link resolveSecretKey} + {@link decryptPackage}. Two things are easy to omit and
|
|
76
|
+
* neither fails loudly:
|
|
77
|
+
* - the **`dataIntegrity` HMAC** — agile is AES-CBC, which is unauthenticated, so without it a
|
|
78
|
+
* tampered payload decrypts to garbage instead of being rejected;
|
|
79
|
+
* - the **8-byte length prefix** on `EncryptedPackage`, without which a reader cannot tell the
|
|
80
|
+
* plaintext from its block padding.
|
|
81
|
+
*/
|
|
82
|
+
export const encrypt: (payload: Uint8Array, password: string) => Promise<Encrypted>;
|
|
83
|
+
export {};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=AgileCrypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgileCrypto.d.ts","sourceRoot":"","sources":["../../../../src/offcrypto/AgileCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;GASG;AACH,yBAAiB,WAAW,CAAC;IAuC3B;;;;OAIG;IACH,KAAK,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IA8LrC;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,MAAM,cAAc,CAAC,KAAK,EAC1B,UAAU,MAAM,KACf,OAAO,CAAC,KAAK,GAAG,IAAI,CAoCtB,CAAA;IAgCD;;;OAGG;IACH,MAAM,CAAC,MAAM,cAAc,GACzB,MAAM,cAAc,CAAC,KAAK,EAC1B,WAAW,KAAK,EAChB,kBAAkB,UAAU,KAC3B,OAAO,CAAC,KAAK,CAoCf,CAAA;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,eAAe,GAC1B,MAAM,cAAc,CAAC,KAAK,EAC1B,WAAW,KAAK,EAChB,kBAAkB,UAAU,KAC3B,OAAO,CAAC,OAAO,CAwBjB,CAAA;IAED,0DAA0D;IAC1D,MAAM,CAAC,MAAM,QAAQ;;;;;;;;QAQnB,2FAA2F;;KAEnF,CAAC;IAEX;;;OAGG;IACH,MAAM,WAAW,SAAS;QACxB,WAAW,EAAE,KAAK,CAAC;QACnB,aAAa,EAAE,KAAK,CAAC;QACrB,0BAA0B,EAAE,KAAK,CAAC;QAClC,0BAA0B,EAAE,KAAK,CAAC;QAClC,iBAAiB,EAAE,KAAK,CAAC;QACzB,gBAAgB,EAAE,KAAK,CAAC;QACxB,kBAAkB,EAAE,KAAK,CAAC;QAC1B,gBAAgB,EAAE,KAAK,CAAC;KACzB;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,OAAO,GAAU,SAAS,UAAU,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,SAAS,CA4EtF,CAAA;;CACF"}
|