@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,148 @@
|
|
|
1
|
+
import { PackageBuilderOptions, PackagePart, ZipBackendCloseOptions, IZipBackend } from './Types';
|
|
2
|
+
import { EmitterRegistry } from './EmitterRegistry';
|
|
3
|
+
/**
|
|
4
|
+
* Orchestrates export by running registered {@link PartType} emitters and writing the resulting
|
|
5
|
+
* Open Packaging Convention (OPC) parts into a {@link IPartWriter}.
|
|
6
|
+
*
|
|
7
|
+
* ## What it does
|
|
8
|
+
* `PackageBuilder` is the “assembly engine” for your export:
|
|
9
|
+
*
|
|
10
|
+
* - Maintains a queue of scheduled parts (roots + children).
|
|
11
|
+
* - Creates an {@link EmitContext} for each scheduled part and invokes that part type’s `emit()`.
|
|
12
|
+
* - Provides `ctx.addPart()` helpers so emitters can:
|
|
13
|
+
* - create relationships (`rId1`, `rId2`, …) deterministically per source part, and
|
|
14
|
+
* - schedule additional parts without knowing how the package is stored or zipped.
|
|
15
|
+
* - Writes the produced bytes/XML into the underlying {@link IPartWriter} via `addPart()`.
|
|
16
|
+
*
|
|
17
|
+
* `PackageBuilder` is intentionally *format-agnostic*: it does not “know” what an XLSX workbook,
|
|
18
|
+
* worksheet, table, drawing, etc. is. Those semantics live entirely in your {@link PartType}s.
|
|
19
|
+
*
|
|
20
|
+
* ## What it does NOT do
|
|
21
|
+
* - It does not serialize ZIP entries itself (that is the responsibility of {@link IPartWriter}).
|
|
22
|
+
* - It does not manage `[Content_Types].xml` or `*.rels` files directly (also {@link IPartWriter}).
|
|
23
|
+
* - It does not precompute a “plan” or expose internal scheduling structures to emitters.
|
|
24
|
+
*
|
|
25
|
+
* ## Determinism guarantees
|
|
26
|
+
* - Part paths are determined by {@link PartType.path}. If paths are deterministic, output is stable.
|
|
27
|
+
* - Relationship IDs are allocated by the {@link IPartWriter.rels} implementation (typically
|
|
28
|
+
* `RelationshipSet`) in the order relationships are added within each source part.
|
|
29
|
+
* - Part emission order is deterministic given a deterministic traversal from roots (FIFO scheduling).
|
|
30
|
+
*
|
|
31
|
+
* ## Usage
|
|
32
|
+
* Typical usage is:
|
|
33
|
+
*
|
|
34
|
+
* 1. Create a registry and register {@link PartType}s.
|
|
35
|
+
* 2. Create a {@link PackageBuilder} with an {@link IPartWriter}.
|
|
36
|
+
* 3. Schedule one or more root parts (e.g. the workbook).
|
|
37
|
+
* 4. Call {@link PackageBuilder.build} to emit all parts and finalize the package.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const writer = new PartsWriter(/* Zip backend *\/);
|
|
41
|
+
* const registry = new PartRegistry();
|
|
42
|
+
* registry.register(WorkbookPart);
|
|
43
|
+
* registry.register(WorksheetPart);
|
|
44
|
+
*
|
|
45
|
+
* const builder = new PackageBuilder(writer, registry);
|
|
46
|
+
* builder.addPart("workbook", workbook, "/xl/workbook.xml");
|
|
47
|
+
*
|
|
48
|
+
* const bytes = await builder.build({ zip64: true });
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ## Concurrency model
|
|
52
|
+
* Each part is emitted sequentially (single-threaded) by default. Emitters may add children during
|
|
53
|
+
* emission, which are scheduled after the current part. If you later introduce parallel emission,
|
|
54
|
+
* it should only occur across independent parts after all required relationship IDs have been
|
|
55
|
+
* allocated and any shared global state (e.g. shared strings) is handled safely.
|
|
56
|
+
*/
|
|
57
|
+
export declare class PackageBuilder<Out> {
|
|
58
|
+
private _queue;
|
|
59
|
+
private _scheduledByNodeKey;
|
|
60
|
+
private _nodesByPath;
|
|
61
|
+
private _writtenPaths;
|
|
62
|
+
private _partWriter;
|
|
63
|
+
private _registry;
|
|
64
|
+
private _options;
|
|
65
|
+
private _sourcePackage;
|
|
66
|
+
private _explicitRelTargets;
|
|
67
|
+
private _mapState;
|
|
68
|
+
constructor(zip: IZipBackend<Out>, registry: EmitterRegistry, options?: PackageBuilderOptions);
|
|
69
|
+
/**
|
|
70
|
+
* Wait for all scheduled parts to be emitted.
|
|
71
|
+
*/
|
|
72
|
+
waitEmit(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Build the package by emitting all scheduled parts and finalizing the underlying ZIP.
|
|
75
|
+
*
|
|
76
|
+
* @param options Options for closing the ZIP backend.
|
|
77
|
+
* @returns The resulting package as a Uint8Array.
|
|
78
|
+
*/
|
|
79
|
+
build(options?: ZipBackendCloseOptions): Promise<Uint8Array>;
|
|
80
|
+
/**
|
|
81
|
+
* Copy through every source-package part no emitter claimed, once emission is complete and
|
|
82
|
+
* {@link _writtenPaths} is final. See `DESIGN-PACKAGE-PASSTHROUGH.md` §4 (bucket rules) and §6
|
|
83
|
+
* (the rels/content-types merge).
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* No re-fetch, no residue map: this only ever reads the bytes handed in via
|
|
87
|
+
* {@link PackageBuilderOptions.sourcePackage} — see the design doc's non-goals (§7).
|
|
88
|
+
*/
|
|
89
|
+
private _passthroughSourceParts;
|
|
90
|
+
/**
|
|
91
|
+
* Seed `sourcePart`'s {@link IRelationshipSet} with the source's edges: drop one whose target an
|
|
92
|
+
* emitter already claimed (that emitter made its own, correct edge already — keeping both would
|
|
93
|
+
* duplicate it), drop one whose target did not survive at all (§5), keep the rest verbatim. Always
|
|
94
|
+
* allocates a fresh rId (never the source's) — the edge is what matters, not its name, and reusing
|
|
95
|
+
* the source's `rIdN` strings would collide with whatever an emitter already allocated in this same
|
|
96
|
+
* set. Targets are carried forward as-is (still relative to the same referencing part, at the same
|
|
97
|
+
* OPC path) — nothing to recompute.
|
|
98
|
+
*/
|
|
99
|
+
private _mergeSourceRelsInto;
|
|
100
|
+
/**
|
|
101
|
+
* Add a root part to the package.
|
|
102
|
+
*
|
|
103
|
+
* @param kind The kind of the part to add.
|
|
104
|
+
* @param instance The instance of the part to add.
|
|
105
|
+
* @returns The path of the added root part.
|
|
106
|
+
*/
|
|
107
|
+
addPart<T = any>(kind: string, instance: T, pathTemplate?: string): PackagePart;
|
|
108
|
+
protected _addPartInternal<T = any>(currentPartPath: string, kind: string, instance: T, pathTemplate?: string): PackagePart;
|
|
109
|
+
/**
|
|
110
|
+
* Add a binary to the package.
|
|
111
|
+
*
|
|
112
|
+
* @param kind The kind of the part to add.
|
|
113
|
+
* @param instance The instance of the part to add.
|
|
114
|
+
* @param relTypeUri The relationship type URI for this binary part.
|
|
115
|
+
* @param pathTemplate The path template for this binary part.
|
|
116
|
+
* @param override Whether to override an existing part at the same path.
|
|
117
|
+
* @returns The path of the added root part.
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* Override is only used if the path is not a template
|
|
121
|
+
*/
|
|
122
|
+
addBinary(bytes: Uint8Array, contentType: string, relTypeUri: string, pathTemplate: string, override?: boolean): PackagePart;
|
|
123
|
+
protected _addBinaryInternal(currentPartPath: string, bytes: Uint8Array, contentType: string, relTypeUri: string, pathTemplate: string, override?: boolean): PackagePart;
|
|
124
|
+
/**
|
|
125
|
+
* Implements {@link EmitContext.forkPreservedPart}.
|
|
126
|
+
*
|
|
127
|
+
* @remarks
|
|
128
|
+
* The collision domain for the new path includes every name the source package could still emit
|
|
129
|
+
* via passthrough, not just what's already been written — `_passthroughSourceParts` (which is what
|
|
130
|
+
* actually registers the *original* target's own path into {@link _writtenPaths}) only runs after
|
|
131
|
+
* `waitEmit()` completes, so at fork time the source's own numbering (`chart2.xml` already existing
|
|
132
|
+
* as an unrelated real chart, say) isn't visible there yet.
|
|
133
|
+
*/
|
|
134
|
+
protected _forkPreservedPart(currentPartPath: string, sourcePartPath: string, contentType: string, relTypeUri: string, pathTemplate: string): PackagePart | null;
|
|
135
|
+
protected _waitForDescendants(parentPath: string): Promise<void>;
|
|
136
|
+
protected _processPart(node: Scheduled): Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
type Scheduled = {
|
|
139
|
+
kind: string;
|
|
140
|
+
key: string;
|
|
141
|
+
payload: any;
|
|
142
|
+
path: string;
|
|
143
|
+
contentType: string;
|
|
144
|
+
promise: Promise<void>;
|
|
145
|
+
resolve: () => void;
|
|
146
|
+
};
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=PackageBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PackageBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/PackageBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,qBAAqB,EAAoB,KAAK,WAAW,EAC9D,KAAK,sBAAsB,EAAE,KAAK,WAAW,EAC9C,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAwDzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBAAa,cAAc,CAAC,GAAG;IAC7B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,mBAAmB,CAAgC;IAG3D,OAAO,CAAC,YAAY,CAAkE;IAEtF,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,cAAc,CAAwB;IAG9C,OAAO,CAAC,mBAAmB,CAAqB;IAGhD,OAAO,CAAC,SAAS,CAAmB;gBAGlC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EACrB,QAAQ,EAAE,eAAe,EACzB,OAAO,CAAC,EAAE,qBAAqB;IASjC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B;;;;;OAKG;IACG,KAAK,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,U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AI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IZipBackend, ZipBackendCloseOptions, ZipAddOptions } from './Types';
|
|
2
|
+
import { IPartWriter, PartBody, IRelationshipSet } from './_Types';
|
|
3
|
+
/** @inheritdoc IPartWriter */
|
|
4
|
+
export declare class PartWriter<Out = any> implements IPartWriter<Out> {
|
|
5
|
+
private parts;
|
|
6
|
+
private relsRoot;
|
|
7
|
+
private relsByPart;
|
|
8
|
+
private contentTypes;
|
|
9
|
+
private readonly zip;
|
|
10
|
+
constructor(zip: IZipBackend<Out>);
|
|
11
|
+
/** @inheritdoc IPartWriter.addContentType */
|
|
12
|
+
addContentType(path: string, contentType: string): void;
|
|
13
|
+
/** @inheritdoc IPartWriter.addDefaultType */
|
|
14
|
+
addDefaultType(extension: string, contentType: string): void;
|
|
15
|
+
/** @inheritdoc IPartWriter.addPart */
|
|
16
|
+
addPart(path: string, body: PartBody, contentType: string, options?: ZipAddOptions): void;
|
|
17
|
+
/** @inheritdoc IPartWriter.rels */
|
|
18
|
+
rels(sourcePart: string): IRelationshipSet;
|
|
19
|
+
/** @inheritdoc IPartWriter.build */
|
|
20
|
+
emit(): Promise<void>;
|
|
21
|
+
/** @inheritdoc IPartWriter.build */
|
|
22
|
+
build(options?: ZipBackendCloseOptions): Promise<Out>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=PartWriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartWriter.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/PartWriter.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5F,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAMlF,8BAA8B;AAC9B,qBAAa,UAAU,CAAC,GAAG,GAAC,GAAG,CAAE,YAAW,WAAW,CAAC,GAAG,CAAC;IAC1D,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,UAAU,CAAsC;IACxD,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAmB;gBAE3B,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IAIjC,6CAA6C;IAC7C,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAKvD,6CAA6C;IAC7C,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAI5D,sCAAsC;IACtC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAQzF,mCAAmC;IACnC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAWxC,oCAAoC;IAChC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0C3B,oCAAoC;IAC9B,KAAK,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC;CAK5D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IRelationship, IRelationshipSet } from './_Types';
|
|
2
|
+
export declare class RelationshipSet implements IRelationshipSet {
|
|
3
|
+
readonly sourcePart: string;
|
|
4
|
+
private rels;
|
|
5
|
+
private usedIds;
|
|
6
|
+
private nextId;
|
|
7
|
+
constructor(sourcePart: string);
|
|
8
|
+
/** @inheritdoc IRelationshipSet.add */
|
|
9
|
+
add(type: string, target: string, opts?: {
|
|
10
|
+
external?: boolean;
|
|
11
|
+
idHint?: string;
|
|
12
|
+
}): string;
|
|
13
|
+
/** @inheritdoc IRelationshipSet.list */
|
|
14
|
+
list(): readonly IRelationship[];
|
|
15
|
+
toXmlBytes(): Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
export declare const NS_REL = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
18
|
+
//# sourceMappingURL=RelationshipSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipSet.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/RelationshipSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIrE,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,MAAM,CAAK;gBAEP,UAAU,EAAE,MAAM;IAI9B,uCAAuC;IACvC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAyBzF,wCAAwC;IACxC,IAAI,IAAI,SAAS,aAAa,EAAE;IAIhC,UAAU,IAAI,UAAU;CAkBzB;AAGD,eAAO,MAAM,MAAM,iEAAiE,CAAC"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
export type ZipEntrySource = Uint8Array | string | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
2
|
+
export interface ZipCreateOptions {
|
|
3
|
+
level?: number;
|
|
4
|
+
password?: string;
|
|
5
|
+
encryptionStrength?: 1 | 2 | 3;
|
|
6
|
+
zipCrypto?: boolean;
|
|
7
|
+
lastModDate?: Date;
|
|
8
|
+
keepOrder?: boolean;
|
|
9
|
+
dataDescriptor?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* `true` to write the data as-is without compressing it and without crypting it.
|
|
12
|
+
*/
|
|
13
|
+
passThrough?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The compression method (e.g. 8 for DEFLATE, 0 for STORE).
|
|
16
|
+
*/
|
|
17
|
+
compressionMethod?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The uncompressed size of the entry. Required when using level:0 for Excel compatibility.
|
|
20
|
+
*/
|
|
21
|
+
uncompressedSize?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ZipAddOptions extends ZipCreateOptions {
|
|
24
|
+
/**
|
|
25
|
+
* The comment of the entry.
|
|
26
|
+
*/
|
|
27
|
+
comment?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The signature (CRC32 checksum) of the content. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
|
|
30
|
+
*/
|
|
31
|
+
signature?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ZipBackendCloseOptions {
|
|
34
|
+
comment?: Uint8Array;
|
|
35
|
+
}
|
|
36
|
+
export interface IZipBackend<Out> {
|
|
37
|
+
add(path: string, source: ZipEntrySource, options?: ZipAddOptions): Promise<void>;
|
|
38
|
+
close(options?: ZipBackendCloseOptions): Promise<Out>;
|
|
39
|
+
}
|
|
40
|
+
export interface IXmlWriter {
|
|
41
|
+
/**
|
|
42
|
+
* Writes the XML declaration.
|
|
43
|
+
*/
|
|
44
|
+
decl(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the default namespace for subsequent tags.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* This affects tags that do not have a prefix.
|
|
50
|
+
*
|
|
51
|
+
* @param ns The namespace prefix to set as default.
|
|
52
|
+
*/
|
|
53
|
+
pushDefaultNamespace(ns: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the current default namespace.
|
|
56
|
+
*/
|
|
57
|
+
getDefaultNamespace(): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Clears the default namespace.
|
|
60
|
+
*/
|
|
61
|
+
popDefaultNamespace(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Starts an XML tag.
|
|
64
|
+
*/
|
|
65
|
+
start(tag: string, attrs?: Record<string, string | number | boolean | undefined>): void;
|
|
66
|
+
/**
|
|
67
|
+
* Writes an empty XML tag (self-closing).
|
|
68
|
+
*
|
|
69
|
+
* @param tag
|
|
70
|
+
* @param attrs
|
|
71
|
+
*/
|
|
72
|
+
empty(tag: string, attrs?: Record<string, string | number | boolean | undefined>): void;
|
|
73
|
+
/**
|
|
74
|
+
* Writes text content.
|
|
75
|
+
*/
|
|
76
|
+
text(value: string | number | boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* Writes raw text with no escaping.
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* This is useful for writing prebuilt XML fragments.
|
|
82
|
+
*/
|
|
83
|
+
raw(xml: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Ends an XML tag.
|
|
86
|
+
*/
|
|
87
|
+
end(tag: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Disables or enables validation of XML tags.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* Disabling validation can improve performance when writing large XML documents,
|
|
93
|
+
* but it is the caller's responsibility to ensure well-formed XML.
|
|
94
|
+
*/
|
|
95
|
+
setValidationDisabled(disabled: boolean): void;
|
|
96
|
+
/**
|
|
97
|
+
* Closes the XML writer, flushing any remaining data.
|
|
98
|
+
*/
|
|
99
|
+
close(): void;
|
|
100
|
+
}
|
|
101
|
+
export interface IBinaryWriter {
|
|
102
|
+
write(bytes: Uint8Array): void;
|
|
103
|
+
}
|
|
104
|
+
export interface ITextWriter {
|
|
105
|
+
write(text: string): void | Promise<void>;
|
|
106
|
+
close?(): void | Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Passed to emitters
|
|
110
|
+
*/
|
|
111
|
+
export interface EmitContext {
|
|
112
|
+
/**
|
|
113
|
+
* XML writer for this part.
|
|
114
|
+
*/
|
|
115
|
+
getXMLWriter(): IXmlWriter;
|
|
116
|
+
/**
|
|
117
|
+
* Add a part at a path.
|
|
118
|
+
*
|
|
119
|
+
* @param kind The part kind/type to add as child.
|
|
120
|
+
* @param instance The instance to add as child.
|
|
121
|
+
* @param pathTemplate This is a relative path from the package root
|
|
122
|
+
* @returns The rId if the part has a relationship.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* When adding a path a specific identifier can be used to
|
|
126
|
+
* indicating that the name will use an incrementing number if
|
|
127
|
+
* the folder already has a part with the same name. For example,
|
|
128
|
+
* "worksheets/sheet{n}.xml" will create "worksheets/sheet1.xml",
|
|
129
|
+
* "worksheets/sheet2.xml", etc.
|
|
130
|
+
* This can also be used for folder names such as
|
|
131
|
+
* "charts/chart{n}/chart1.xml".
|
|
132
|
+
*/
|
|
133
|
+
addPart<T = any>(kind: string, instance: T, pathTemplate?: string): PackagePart;
|
|
134
|
+
/**
|
|
135
|
+
* Adds a binary part at a path.
|
|
136
|
+
*
|
|
137
|
+
* @param bytes: Uint8Array;
|
|
138
|
+
* @param contentType The content type for the extension.
|
|
139
|
+
* @param relTypeUri The relationship type URI.
|
|
140
|
+
* @param pathTemplate This is a relative path from the package root
|
|
141
|
+
*/
|
|
142
|
+
addBinary(bytes: Uint8Array, contentType: string, relTypeUri: string, pathTemplate: string, override?: boolean): PackagePart;
|
|
143
|
+
/**
|
|
144
|
+
* Adds an external relationship to the current part.
|
|
145
|
+
*
|
|
146
|
+
* @param relTypeUri The relationship type URI.
|
|
147
|
+
* @param targetUrl The target URL.
|
|
148
|
+
*
|
|
149
|
+
* @returns The rId of the added relationship.
|
|
150
|
+
*/
|
|
151
|
+
addExternal(relTypeUri: string, targetUrl: string): PackagePart;
|
|
152
|
+
/**
|
|
153
|
+
* Adds a relationship from the current part to an existing part in the source package that no
|
|
154
|
+
* emitter claims — the bytes are supplied later by the generic passthrough mechanism, not by the
|
|
155
|
+
* caller. Unlike `addPart`/`addBinary`, this references content rather than creating it.
|
|
156
|
+
*
|
|
157
|
+
* @param relTypeUri The relationship type URI.
|
|
158
|
+
* @param targetPartPath The target's absolute path (relative to the package root, no leading `/`).
|
|
159
|
+
* @param idHint A preferred id (e.g. the source's own original rId) — used only if it does not
|
|
160
|
+
* collide with an id already assigned in this part's relationship set; falls back silently to an
|
|
161
|
+
* auto-generated id otherwise, so a caller that needs the id to line up with something it already
|
|
162
|
+
* wrote (e.g. a captured raw fragment referencing this target) must use the returned value, not
|
|
163
|
+
* assume the hint was honored.
|
|
164
|
+
* @returns The id actually assigned.
|
|
165
|
+
*/
|
|
166
|
+
addPreservedRelationship(relTypeUri: string, targetPartPath: string, idHint?: string): string;
|
|
167
|
+
/**
|
|
168
|
+
* Mints an independent copy of a source-package part's bytes under a fresh path, and adds a
|
|
169
|
+
* relationship from the current part to that copy. For when a source part must never be shared by
|
|
170
|
+
* more than one reference — unlike `addPreservedRelationship`, which links to the one shared
|
|
171
|
+
* target — e.g. a chart part, which a same-source movable copy would otherwise leave two anchors
|
|
172
|
+
* both pointing at (see `DESIGN-PACKAGE-PASSTHROUGH.md` §11.2). The copy's own relationships (if
|
|
173
|
+
* it has a `.rels` part in the source) are carried forward verbatim to the new path, so nested
|
|
174
|
+
* references inside the copied bytes (e.g. a chart's colors/style/embedded data) keep resolving.
|
|
175
|
+
*
|
|
176
|
+
* @param sourcePartPath The absolute path of the source part to copy (no leading `/`).
|
|
177
|
+
* @param contentType The content type for the copy.
|
|
178
|
+
* @param relTypeUri The relationship type URI.
|
|
179
|
+
* @param pathTemplate The path template for the copy — same `{n}` rules as `addBinary`.
|
|
180
|
+
* @returns The new part, or `null` if there is no source package or the source part is missing.
|
|
181
|
+
*/
|
|
182
|
+
forkPreservedPart(sourcePartPath: string, contentType: string, relTypeUri: string, pathTemplate: string): PackagePart | null;
|
|
183
|
+
/**
|
|
184
|
+
* Waits for all dependants to be emitted.
|
|
185
|
+
*/
|
|
186
|
+
waitEmit(): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Useful for debugging.
|
|
189
|
+
*/
|
|
190
|
+
getPath(): string;
|
|
191
|
+
/**
|
|
192
|
+
* Returns a map that can be used across emitters to share state.
|
|
193
|
+
*/
|
|
194
|
+
getSharedStates(): Map<string, any>;
|
|
195
|
+
/**
|
|
196
|
+
* Warns that something is not quite right.
|
|
197
|
+
*/
|
|
198
|
+
warn(message: string, context?: any): void;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* A part emitter knows how to write a specific part type to XML (or binary).
|
|
202
|
+
*/
|
|
203
|
+
export interface IEmitter<T = any> {
|
|
204
|
+
/**
|
|
205
|
+
* The type/kind of this part emitter
|
|
206
|
+
*/
|
|
207
|
+
readonly kind: string;
|
|
208
|
+
/**
|
|
209
|
+
* Used to populate the [Content_Types].xml for THIS kind
|
|
210
|
+
*/
|
|
211
|
+
readonly contentType: string;
|
|
212
|
+
/**
|
|
213
|
+
* Used to populate the (_rels/.rels) for THIS kind
|
|
214
|
+
* @remarks
|
|
215
|
+
* If not specified, this part will not be listed in the .rels
|
|
216
|
+
*/
|
|
217
|
+
readonly relTypeUri: string;
|
|
218
|
+
/**
|
|
219
|
+
* The function that emits this part
|
|
220
|
+
*/
|
|
221
|
+
emit: (instance: T, ctx: EmitContext) => Promise<void> | void;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the default path for this part instance.
|
|
224
|
+
*
|
|
225
|
+
* @param instance
|
|
226
|
+
*
|
|
227
|
+
* @remarks
|
|
228
|
+
* This is relative to the package root. So for example, for a worksheet part,
|
|
229
|
+
* it might return something like "../worksheets/sheet{n}.xml".
|
|
230
|
+
*/
|
|
231
|
+
getPath?: (instance: T) => string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Options for PackageBuilder
|
|
235
|
+
*/
|
|
236
|
+
export interface PackageBuilderOptions {
|
|
237
|
+
/**
|
|
238
|
+
* if true, throw if same child (kind+key) is scheduled twice from the same parent
|
|
239
|
+
*/
|
|
240
|
+
strictDuplicateChildren?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* A map that can be used across emitters to share state.
|
|
243
|
+
*/
|
|
244
|
+
mapState?: Map<string, any>;
|
|
245
|
+
/**
|
|
246
|
+
* The source package to seed the build from, if the destination is being saved back into the same
|
|
247
|
+
* OOXML package family it was read from. Parts no emitter claims are copied through verbatim
|
|
248
|
+
* instead of being dropped. See `DESIGN-PACKAGE-PASSTHROUGH.md`.
|
|
249
|
+
*/
|
|
250
|
+
sourcePackage?: ISourcePackage | null;
|
|
251
|
+
/**
|
|
252
|
+
* Callback invoked when a part is emitted.
|
|
253
|
+
*
|
|
254
|
+
* @param kind The kind of the part.
|
|
255
|
+
* @param path The path of the part.
|
|
256
|
+
* @param bytes The bytes of the emitted part.
|
|
257
|
+
*
|
|
258
|
+
* @remarks
|
|
259
|
+
* Useful for logging or debugging emitted parts.
|
|
260
|
+
*/
|
|
261
|
+
onPartEmitted?: (kind: string, path: string, bytes: Uint8Array) => void | Promise<void>;
|
|
262
|
+
/**
|
|
263
|
+
* Called when an error occurs during part emission.
|
|
264
|
+
* @param kind The kind of the part.
|
|
265
|
+
* @param path The path of the part.
|
|
266
|
+
* @param error The error that occurred.
|
|
267
|
+
*/
|
|
268
|
+
onPartError?: (kind: string, path: string, error: any) => void | Promise<void>;
|
|
269
|
+
}
|
|
270
|
+
/** A part's still-compressed bytes — structurally matches `../SourcePackage.SourcePackageRawPart`. */
|
|
271
|
+
export interface ISourcePackageRawPart {
|
|
272
|
+
readonly compressedData: Uint8Array;
|
|
273
|
+
readonly compressionMethod: number;
|
|
274
|
+
/** CRC32 of the uncompressed content. */
|
|
275
|
+
readonly signature: number;
|
|
276
|
+
}
|
|
277
|
+
/** One retained OPC part — structurally matches `../SourcePackage.SourcePackagePart`. */
|
|
278
|
+
export interface ISourcePackagePart {
|
|
279
|
+
readonly data: Uint8Array;
|
|
280
|
+
readonly uncompressedSize: number;
|
|
281
|
+
readonly raw?: ISourcePackageRawPart;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Structural interface for a retained source package, seeded into {@link PackageBuilder} so an
|
|
285
|
+
* xlsx→xlsx round trip can copy through the parts nothing modeled instead of dropping them. Kept
|
|
286
|
+
* structural (not importing `../SourcePackage` directly) so `builder/` stays format-agnostic — see
|
|
287
|
+
* `DESIGN-PACKAGE-PASSTHROUGH.md` §6.
|
|
288
|
+
*/
|
|
289
|
+
export interface ISourcePackage {
|
|
290
|
+
getNames(): string[];
|
|
291
|
+
has(name: string): boolean;
|
|
292
|
+
getPart(name: string): ISourcePackagePart | null;
|
|
293
|
+
/** See `../SourcePackage.SourcePackage.hasStructuralChange` — gates §4's drop-if-changed bucket. */
|
|
294
|
+
hasStructuralChange(): boolean;
|
|
295
|
+
}
|
|
296
|
+
export interface PackagePart {
|
|
297
|
+
/**
|
|
298
|
+
* The absolute path of the part.
|
|
299
|
+
*/
|
|
300
|
+
path: string;
|
|
301
|
+
/**
|
|
302
|
+
* The content type of the part.
|
|
303
|
+
*/
|
|
304
|
+
contentTypeUri: string;
|
|
305
|
+
/**
|
|
306
|
+
* If the part has a relationship, this is the rId or `null` if
|
|
307
|
+
* there is no relationship.
|
|
308
|
+
*/
|
|
309
|
+
relId: string | null;
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/Types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,MAAM,GACN,cAAc,CAAC,UAAU,CAAC,GAC1B,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9B,MAAM,WAAW,gBAAgB;IAE/B,KAAK,CAAC,EAAE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IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ZipEntrySource } from './Types';
|
|
2
|
+
import { PartBody } from './_Types';
|
|
3
|
+
export declare const OPC_RELS_CT = "application/vnd.openxmlformats-package.relationships+xml";
|
|
4
|
+
export declare const OPC_CONTENT_TYPES_CT = "application/vnd.openxmlformats-package.content-types+xml";
|
|
5
|
+
export declare function materialize(body: PartBody): ZipEntrySource;
|
|
6
|
+
export declare function relsPathFor(sourcePart: string): string;
|
|
7
|
+
export declare function normalizePartPath(path: string): string;
|
|
8
|
+
export declare function normalizePartName(partName: string): string;
|
|
9
|
+
export declare function normalizeExt(ext: string): string;
|
|
10
|
+
export declare function ridNum(rid: string): number;
|
|
11
|
+
export declare function xmlAttr(s: string): string;
|
|
12
|
+
export declare function concat(chunks: Uint8Array[]): Uint8Array;
|
|
13
|
+
export declare function fileExt(path: string): string | null;
|
|
14
|
+
export declare function isBinaryLikely(contentType: string): boolean;
|
|
15
|
+
export declare function normalizeSourcePart(p: string): string;
|
|
16
|
+
export declare function concatChunks(chunks: Uint8Array[]): Uint8Array;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves a path template with optional {n} placeholders for auto-increment collision avoidance.
|
|
19
|
+
*
|
|
20
|
+
* @param parentPath The parent path (empty string for root)
|
|
21
|
+
* @param childPathSpec The child path spec (absolute with "/" or relative)
|
|
22
|
+
* @param existingPaths Set of already-used paths for collision detection
|
|
23
|
+
*
|
|
24
|
+
* @returns The resolved path without leading slash
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - Absolute paths start with "/" and ignore parent
|
|
28
|
+
* - Relative paths are resolved against parent directory
|
|
29
|
+
* - {n} is replaced with incrementing numbers (1, 2, 3...) until no collision
|
|
30
|
+
* - Multiple {n} in same path all use the same value
|
|
31
|
+
* - Works per-segment: "charts/chart{n}/chart.xml" → "charts/chart1/chart.xml"
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* resolvePath("xl/workbook.xml", "worksheets/sheet{n}.xml", paths)
|
|
35
|
+
* // → "xl/worksheets/sheet1.xml" (if not exists)
|
|
36
|
+
* // → "xl/worksheets/sheet2.xml" (if sheet1 exists)
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolvePath(parentPath: string, childPathSpec: string, existingPaths: Set<string>, override?: boolean): string;
|
|
39
|
+
export declare function normalizePath(path: string): string;
|
|
40
|
+
export declare function makeRelTarget(sourcePartPath: string, targetPartPath: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Converts a string to a UTF-8 encoded Uint8Array.
|
|
43
|
+
* @param str The input string.
|
|
44
|
+
*/
|
|
45
|
+
export declare function stringToUtf8(str: string): Uint8Array;
|
|
46
|
+
/**
|
|
47
|
+
* Converts a Uint8Array to a UTF-8 string.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Useful for debugging XML output.
|
|
51
|
+
*/
|
|
52
|
+
export declare function utf8ToString(bytes: Uint8Array): string;
|
|
53
|
+
/**
|
|
54
|
+
* Converts Uint8Array to formatted XML string.
|
|
55
|
+
* Convenience function for debugging XML output.
|
|
56
|
+
*/
|
|
57
|
+
export declare function bytesToFormattedXml(bytes: Uint8Array, indent?: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Formats XML string with indentation for readability.
|
|
60
|
+
* Simple implementation for debugging purposes - doesn't handle all edge cases.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatXml(xml: string, indent?: string): string;
|
|
63
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/Utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMzC,eAAO,MAAM,WAAW,6D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MAAM,GAAG,UAAU,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,MAAa,GAAG,MAAM,CAkCpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XmlWriter.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/XmlWriter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE9D,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,aAAa,GACtB,UAAU,CA0HZ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ZipWriterConstructorOptions } from '@zip.js/zip.js';
|
|
2
|
+
import { IZipBackend, ZipAddOptions, ZipBackendCloseOptions, ZipEntrySource } from './Types';
|
|
3
|
+
/**
|
|
4
|
+
* zip.js backend.
|
|
5
|
+
*
|
|
6
|
+
* - If you need in-memory output: use createUint8Array()
|
|
7
|
+
* - If you need browser download output: use createBlob()
|
|
8
|
+
* - If you need true streaming output: use createWritableStream(writable)
|
|
9
|
+
*/
|
|
10
|
+
export declare class ZipJsBackend implements IZipBackend<Uint8Array | Blob | WritableStream> {
|
|
11
|
+
private zipWriter;
|
|
12
|
+
private outputKind;
|
|
13
|
+
private outWritable?;
|
|
14
|
+
private constructor();
|
|
15
|
+
static createUint8Array(opts?: ZipWriterConstructorOptions): ZipJsBackend;
|
|
16
|
+
static createBlob(opts?: ZipWriterConstructorOptions): ZipJsBackend;
|
|
17
|
+
static createWritableStream(writable: WritableStream, opts?: ZipWriterConstructorOptions): ZipJsBackend;
|
|
18
|
+
add(path: string, source: ZipEntrySource, options?: ZipAddOptions): Promise<void>;
|
|
19
|
+
close(options?: ZipBackendCloseOptions): Promise<Uint8Array | Blob | WritableStream>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ZipBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZipBackend.d.ts","sourceRoot":"","sources":["../../../../../src/writer/builder/ZipBackend.ts"],"names":[],"mappings":"AACA,OAAO,EAEyB,KAAK,2BAA2B,EAC/D,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAE,KAAK,cAAc,EACvF,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,qBAAa,YAAa,YAAW,WAAW,CAAC,UAAU,GAAG,IAAI,GAAG,cAAc,CAAC;IAClF,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,WAAW,CAAC,CAAiB;IAErC,OAAO;IAUP,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,2BAA2B,GAAG,YAAY;IAMzE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,2BAA2B,GAAG,YAAY;IAMnE,MAAM,CAAC,oBAAoB,CACzB,QAAQ,EAAE,cAAc,EACxB,IAAI,CAAC,EAAE,2BAA2B,GACjC,YAAY;IAKT,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAsDjF,KAAK,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG,cAAc,CAAC;CAgB3F"}
|