omni-viewer-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/assets/audio-engine/audio_engine.mjs +2 -0
- package/dist/assets/audio-engine/audio_engine.wasm +0 -0
- package/dist/assets/pdfjs/pdf.worker.min.mjs +21 -0
- package/dist/host/index.d.ts +133 -0
- package/dist/host/index.js +10 -0
- package/dist/i18n/catalog.en.d.ts +1 -0
- package/dist/i18n/catalog.en.js +411 -0
- package/dist/i18n/catalog.ko.d.ts +1 -0
- package/dist/i18n/catalog.ko.js +68 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.js +41 -0
- package/dist/licenses/emscripten.txt +101 -0
- package/dist/licenses/kissfft.txt +28 -0
- package/dist/licenses/pdfjs-dist.txt +177 -0
- package/dist/parsers/a2l/index.d.ts +1 -0
- package/dist/parsers/a2l/index.js +1 -0
- package/dist/parsers/archive/index.d.ts +22 -0
- package/dist/parsers/archive/index.js +46 -0
- package/dist/parsers/archive/model.d.ts +29 -0
- package/dist/parsers/archive/model.js +1 -0
- package/dist/parsers/archive/worker.d.ts +21 -0
- package/dist/parsers/archive/worker.js +1 -0
- package/dist/parsers/arxml/index.d.ts +1 -0
- package/dist/parsers/arxml/index.js +1 -0
- package/dist/parsers/asc/index.d.ts +1 -0
- package/dist/parsers/asc/index.js +1 -0
- package/dist/parsers/audio/index.d.ts +9 -0
- package/dist/parsers/audio/index.js +46 -0
- package/dist/parsers/automotive/index.d.ts +33 -0
- package/dist/parsers/automotive/index.js +973 -0
- package/dist/parsers/blf/index.d.ts +1 -0
- package/dist/parsers/blf/index.js +1 -0
- package/dist/parsers/csv/delimiter.d.ts +31 -0
- package/dist/parsers/csv/delimiter.js +151 -0
- package/dist/parsers/csv/index.d.ts +30 -0
- package/dist/parsers/csv/index.js +108 -0
- package/dist/parsers/csv/parseText.d.ts +20 -0
- package/dist/parsers/csv/parseText.js +108 -0
- package/dist/parsers/csv/sort.d.ts +26 -0
- package/dist/parsers/csv/sort.js +224 -0
- package/dist/parsers/csv/statistics.d.ts +49 -0
- package/dist/parsers/csv/statistics.js +150 -0
- package/dist/parsers/dbc/index.d.ts +56 -0
- package/dist/parsers/dbc/index.js +94 -0
- package/dist/parsers/doc-binary/index.d.ts +35 -0
- package/dist/parsers/doc-binary/index.js +267 -0
- package/dist/parsers/doc-binary/vscode-parser.d.ts +142 -0
- package/dist/parsers/doc-binary/vscode-parser.js +3747 -0
- package/dist/parsers/excel/index.d.ts +17 -0
- package/dist/parsers/excel/index.js +406 -0
- package/dist/parsers/excel/model.d.ts +80 -0
- package/dist/parsers/excel/model.js +48 -0
- package/dist/parsers/excel/serialize.d.ts +3 -0
- package/dist/parsers/excel/serialize.js +78 -0
- package/dist/parsers/hdf5/index.d.ts +75 -0
- package/dist/parsers/hdf5/index.js +658 -0
- package/dist/parsers/hdf5/node.d.ts +21 -0
- package/dist/parsers/hdf5/node.js +95 -0
- package/dist/parsers/json/index.d.ts +15 -0
- package/dist/parsers/json/index.js +102 -0
- package/dist/parsers/json/model.d.ts +42 -0
- package/dist/parsers/json/model.js +140 -0
- package/dist/parsers/json/parse.d.ts +22 -0
- package/dist/parsers/json/parse.js +279 -0
- package/dist/parsers/json/tokenizer.d.ts +17 -0
- package/dist/parsers/json/tokenizer.js +175 -0
- package/dist/parsers/jsonl/index.d.ts +14 -0
- package/dist/parsers/jsonl/index.js +18 -0
- package/dist/parsers/jsonl/model.d.ts +23 -0
- package/dist/parsers/jsonl/model.js +1 -0
- package/dist/parsers/jsonl/parse.d.ts +7 -0
- package/dist/parsers/jsonl/parse.js +34 -0
- package/dist/parsers/markdown/index.d.ts +37 -0
- package/dist/parsers/markdown/index.js +59 -0
- package/dist/parsers/mat/index.d.ts +31 -0
- package/dist/parsers/mat/index.js +426 -0
- package/dist/parsers/mermaid/index.d.ts +5 -0
- package/dist/parsers/mermaid/index.js +3 -0
- package/dist/parsers/mf4/index.d.ts +1 -0
- package/dist/parsers/mf4/index.js +1 -0
- package/dist/parsers/parquet/index.d.ts +21 -0
- package/dist/parsers/parquet/index.js +68 -0
- package/dist/parsers/pcap/index.d.ts +1 -0
- package/dist/parsers/pcap/index.js +1 -0
- package/dist/parsers/pcapng/index.d.ts +1 -0
- package/dist/parsers/pcapng/index.js +1 -0
- package/dist/parsers/plantuml/index.d.ts +5 -0
- package/dist/parsers/plantuml/index.js +4 -0
- package/dist/parsers/ppt-binary/index.d.ts +5 -0
- package/dist/parsers/ppt-binary/index.js +62 -0
- package/dist/parsers/ppt-binary/pptBinaryBuildContext.d.ts +12 -0
- package/dist/parsers/ppt-binary/pptBinaryBuildContext.js +40 -0
- package/dist/parsers/ppt-binary/pptBinaryContainer.d.ts +4 -0
- package/dist/parsers/ppt-binary/pptBinaryContainer.js +174 -0
- package/dist/parsers/ppt-binary/pptBinaryTypes.d.ts +125 -0
- package/dist/parsers/ppt-binary/pptBinaryTypes.js +1 -0
- package/dist/parsers/ppt-binary/pptSlideLayouts.d.ts +9 -0
- package/dist/parsers/ppt-binary/pptSlideLayouts.js +510 -0
- package/dist/parsers/ppt-binary/vscode-parser.d.ts +116 -0
- package/dist/parsers/ppt-binary/vscode-parser.js +2853 -0
- package/dist/parsers/ppt-binary/vscode.d.ts +4 -0
- package/dist/parsers/ppt-binary/vscode.js +12 -0
- package/dist/parsers/pptx/index.d.ts +15 -0
- package/dist/parsers/pptx/index.js +88 -0
- package/dist/parsers/pptx/vscode-parser.d.ts +167 -0
- package/dist/parsers/pptx/vscode-parser.js +1503 -0
- package/dist/parsers/pptx/vscode.d.ts +4 -0
- package/dist/parsers/pptx/vscode.js +18 -0
- package/dist/parsers/pptx/zip-reader.d.ts +3 -0
- package/dist/parsers/pptx/zip-reader.js +20 -0
- package/dist/parsers/proto/index.d.ts +90 -0
- package/dist/parsers/proto/index.js +197 -0
- package/dist/parsers/psd/index.d.ts +16 -0
- package/dist/parsers/psd/index.js +10 -0
- package/dist/parsers/shapefile/dbf.d.ts +23 -0
- package/dist/parsers/shapefile/dbf.js +112 -0
- package/dist/parsers/shapefile/index.d.ts +44 -0
- package/dist/parsers/shapefile/index.js +119 -0
- package/dist/parsers/shapefile/reproject.d.ts +10 -0
- package/dist/parsers/shapefile/reproject.js +41 -0
- package/dist/parsers/slide-model.d.ts +106 -0
- package/dist/parsers/slide-model.js +1 -0
- package/dist/parsers/toml/index.d.ts +15 -0
- package/dist/parsers/toml/index.js +18 -0
- package/dist/parsers/toml/model.d.ts +15 -0
- package/dist/parsers/toml/model.js +1 -0
- package/dist/parsers/toml/parse.d.ts +16 -0
- package/dist/parsers/toml/parse.js +266 -0
- package/dist/parsers/types.d.ts +103 -0
- package/dist/parsers/types.js +106 -0
- package/dist/parsers/video/index.d.ts +6 -0
- package/dist/parsers/video/index.js +2 -0
- package/dist/parsers/yaml/index.d.ts +16 -0
- package/dist/parsers/yaml/index.js +58 -0
- package/dist/parsers/yaml/model.d.ts +22 -0
- package/dist/parsers/yaml/model.js +1 -0
- package/dist/parsers/yaml/self-loading.d.ts +3 -0
- package/dist/parsers/yaml/self-loading.js +19 -0
- package/dist/parsers/zip-scan.d.ts +8 -0
- package/dist/parsers/zip-scan.js +80 -0
- package/dist/registry/container.d.ts +17 -0
- package/dist/registry/container.js +49 -0
- package/dist/registry/index.d.ts +133 -0
- package/dist/registry/index.js +348 -0
- package/dist/registry/probe.d.ts +3 -0
- package/dist/registry/probe.js +177 -0
- package/dist/registry/sniff.d.ts +17 -0
- package/dist/registry/sniff.js +57 -0
- package/dist/styles/archive.css +10 -0
- package/dist/styles/audio.css +66 -0
- package/dist/styles/automotive.css +1 -0
- package/dist/styles/csv.css +262 -0
- package/dist/styles/excel.css +212 -0
- package/dist/styles/fallback.css +48 -0
- package/dist/styles/hdf5.css +3 -0
- package/dist/styles/hwp.css +12 -0
- package/dist/styles/image.css +115 -0
- package/dist/styles/json.css +342 -0
- package/dist/styles/jsonl.css +1 -0
- package/dist/styles/markdown.css +10 -0
- package/dist/styles/mat.css +2 -0
- package/dist/styles/mermaid.css +1 -0
- package/dist/styles/parquet.css +2 -0
- package/dist/styles/pdf.css +551 -0
- package/dist/styles/plantuml.css +1 -0
- package/dist/styles/ppt.css +1 -0
- package/dist/styles/proto.css +2 -0
- package/dist/styles/psd.css +1 -0
- package/dist/styles/shapefile.css +25 -0
- package/dist/styles/toml.css +1 -0
- package/dist/styles/video.css +74 -0
- package/dist/styles/word.css +685 -0
- package/dist/styles/yaml.css +1 -0
- package/dist/viewers/a2l/index.d.ts +15 -0
- package/dist/viewers/a2l/index.js +5 -0
- package/dist/viewers/archive/archive-preview-decoder.d.ts +4 -0
- package/dist/viewers/archive/archive-preview-decoder.js +223 -0
- package/dist/viewers/archive/controller.d.ts +24 -0
- package/dist/viewers/archive/controller.js +18 -0
- package/dist/viewers/archive/index.d.ts +25 -0
- package/dist/viewers/archive/index.js +230 -0
- package/dist/viewers/archive/preview.d.ts +2 -0
- package/dist/viewers/archive/preview.js +2 -0
- package/dist/viewers/archive/styles.d.ts +1 -0
- package/dist/viewers/archive/styles.js +11 -0
- package/dist/viewers/arxml/index.d.ts +15 -0
- package/dist/viewers/arxml/index.js +5 -0
- package/dist/viewers/asc/index.d.ts +15 -0
- package/dist/viewers/asc/index.js +5 -0
- package/dist/viewers/audio/controller.d.ts +33 -0
- package/dist/viewers/audio/controller.js +49 -0
- package/dist/viewers/audio/engine.d.ts +44 -0
- package/dist/viewers/audio/engine.js +108 -0
- package/dist/viewers/audio/index.d.ts +92 -0
- package/dist/viewers/audio/index.js +448 -0
- package/dist/viewers/audio/self-loading.d.ts +7 -0
- package/dist/viewers/audio/self-loading.js +42 -0
- package/dist/viewers/audio/styles.d.ts +1 -0
- package/dist/viewers/audio/styles.js +73 -0
- package/dist/viewers/automotive/index.d.ts +8 -0
- package/dist/viewers/automotive/index.js +152 -0
- package/dist/viewers/automotive/styles.d.ts +1 -0
- package/dist/viewers/automotive/styles.js +1 -0
- package/dist/viewers/avro/index.d.ts +15 -0
- package/dist/viewers/avro/index.js +5 -0
- package/dist/viewers/bag/index.d.ts +15 -0
- package/dist/viewers/bag/index.js +5 -0
- package/dist/viewers/blf/index.d.ts +15 -0
- package/dist/viewers/blf/index.js +5 -0
- package/dist/viewers/csv/controller.d.ts +126 -0
- package/dist/viewers/csv/controller.js +598 -0
- package/dist/viewers/csv/index.d.ts +48 -0
- package/dist/viewers/csv/index.js +846 -0
- package/dist/viewers/csv/styles.d.ts +1 -0
- package/dist/viewers/csv/styles.js +267 -0
- package/dist/viewers/db3/index.d.ts +15 -0
- package/dist/viewers/db3/index.js +5 -0
- package/dist/viewers/dbc/index.d.ts +15 -0
- package/dist/viewers/dbc/index.js +5 -0
- package/dist/viewers/diagram.d.ts +14 -0
- package/dist/viewers/diagram.js +95 -0
- package/dist/viewers/excel/controller.d.ts +108 -0
- package/dist/viewers/excel/controller.js +548 -0
- package/dist/viewers/excel/grid.d.ts +28 -0
- package/dist/viewers/excel/grid.js +99 -0
- package/dist/viewers/excel/index.d.ts +37 -0
- package/dist/viewers/excel/index.js +620 -0
- package/dist/viewers/excel/self-loading.d.ts +6 -0
- package/dist/viewers/excel/self-loading.js +13 -0
- package/dist/viewers/excel/styles.d.ts +1 -0
- package/dist/viewers/excel/styles.js +216 -0
- package/dist/viewers/fallback/index.d.ts +17 -0
- package/dist/viewers/fallback/index.js +130 -0
- package/dist/viewers/fallback/styles.d.ts +1 -0
- package/dist/viewers/fallback/styles.js +49 -0
- package/dist/viewers/hdf5/index.d.ts +19 -0
- package/dist/viewers/hdf5/index.js +170 -0
- package/dist/viewers/hdf5/styles.d.ts +1 -0
- package/dist/viewers/hdf5/styles.js +4 -0
- package/dist/viewers/hwp/controller.d.ts +19 -0
- package/dist/viewers/hwp/controller.js +22 -0
- package/dist/viewers/hwp/index.d.ts +39 -0
- package/dist/viewers/hwp/index.js +271 -0
- package/dist/viewers/hwp/self-loading.d.ts +2 -0
- package/dist/viewers/hwp/self-loading.js +6 -0
- package/dist/viewers/hwp/styles.d.ts +1 -0
- package/dist/viewers/hwp/styles.js +13 -0
- package/dist/viewers/image/controller.d.ts +210 -0
- package/dist/viewers/image/controller.js +336 -0
- package/dist/viewers/image/decode.d.ts +54 -0
- package/dist/viewers/image/decode.js +150 -0
- package/dist/viewers/image/index.d.ts +38 -0
- package/dist/viewers/image/index.js +749 -0
- package/dist/viewers/image/limits.d.ts +18 -0
- package/dist/viewers/image/limits.js +20 -0
- package/dist/viewers/image/styles.d.ts +1 -0
- package/dist/viewers/image/styles.js +119 -0
- package/dist/viewers/json/controller.d.ts +89 -0
- package/dist/viewers/json/controller.js +411 -0
- package/dist/viewers/json/index.d.ts +25 -0
- package/dist/viewers/json/index.js +503 -0
- package/dist/viewers/json/styles.d.ts +1 -0
- package/dist/viewers/json/styles.js +346 -0
- package/dist/viewers/json/transforms.d.ts +27 -0
- package/dist/viewers/json/transforms.js +253 -0
- package/dist/viewers/jsonl/controller.d.ts +48 -0
- package/dist/viewers/jsonl/controller.js +136 -0
- package/dist/viewers/jsonl/index.d.ts +22 -0
- package/dist/viewers/jsonl/index.js +184 -0
- package/dist/viewers/jsonl/styles.d.ts +1 -0
- package/dist/viewers/jsonl/styles.js +1 -0
- package/dist/viewers/markdown/controller.d.ts +50 -0
- package/dist/viewers/markdown/controller.js +62 -0
- package/dist/viewers/markdown/index.d.ts +64 -0
- package/dist/viewers/markdown/index.js +425 -0
- package/dist/viewers/markdown/math.d.ts +21 -0
- package/dist/viewers/markdown/math.js +100 -0
- package/dist/viewers/markdown/self-loading.d.ts +5 -0
- package/dist/viewers/markdown/self-loading.js +48 -0
- package/dist/viewers/markdown/styles.d.ts +1 -0
- package/dist/viewers/markdown/styles.js +11 -0
- package/dist/viewers/mat/index.d.ts +19 -0
- package/dist/viewers/mat/index.js +113 -0
- package/dist/viewers/mat/styles.d.ts +1 -0
- package/dist/viewers/mat/styles.js +3 -0
- package/dist/viewers/media.d.ts +9 -0
- package/dist/viewers/media.js +77 -0
- package/dist/viewers/mermaid/index.d.ts +17 -0
- package/dist/viewers/mermaid/index.js +6 -0
- package/dist/viewers/mermaid/self-loading.d.ts +2 -0
- package/dist/viewers/mermaid/self-loading.js +2 -0
- package/dist/viewers/mf4/index.d.ts +15 -0
- package/dist/viewers/mf4/index.js +5 -0
- package/dist/viewers/parquet/controller.d.ts +37 -0
- package/dist/viewers/parquet/controller.js +26 -0
- package/dist/viewers/parquet/index.d.ts +23 -0
- package/dist/viewers/parquet/index.js +134 -0
- package/dist/viewers/parquet/styles.d.ts +1 -0
- package/dist/viewers/parquet/styles.js +3 -0
- package/dist/viewers/pcap/index.d.ts +15 -0
- package/dist/viewers/pcap/index.js +5 -0
- package/dist/viewers/pcapng/index.d.ts +15 -0
- package/dist/viewers/pcapng/index.js +5 -0
- package/dist/viewers/pdf/controller.d.ts +120 -0
- package/dist/viewers/pdf/controller.js +191 -0
- package/dist/viewers/pdf/editing.d.ts +26 -0
- package/dist/viewers/pdf/editing.js +265 -0
- package/dist/viewers/pdf/index.d.ts +88 -0
- package/dist/viewers/pdf/index.js +1400 -0
- package/dist/viewers/pdf/self-loading.d.ts +6 -0
- package/dist/viewers/pdf/self-loading.js +14 -0
- package/dist/viewers/pdf/styles.d.ts +1 -0
- package/dist/viewers/pdf/styles.js +555 -0
- package/dist/viewers/plantuml/index.d.ts +17 -0
- package/dist/viewers/plantuml/index.js +6 -0
- package/dist/viewers/plantuml/self-loading.d.ts +2 -0
- package/dist/viewers/plantuml/self-loading.js +2 -0
- package/dist/viewers/ppt/chart.d.ts +8 -0
- package/dist/viewers/ppt/chart.js +83 -0
- package/dist/viewers/ppt/controller.d.ts +34 -0
- package/dist/viewers/ppt/controller.js +27 -0
- package/dist/viewers/ppt/index.d.ts +33 -0
- package/dist/viewers/ppt/index.js +101 -0
- package/dist/viewers/ppt/render.d.ts +5 -0
- package/dist/viewers/ppt/render.js +144 -0
- package/dist/viewers/ppt/self-loading.d.ts +9 -0
- package/dist/viewers/ppt/self-loading.js +4 -0
- package/dist/viewers/ppt/styles.d.ts +1 -0
- package/dist/viewers/ppt/styles.js +1 -0
- package/dist/viewers/proto/index.d.ts +17 -0
- package/dist/viewers/proto/index.js +170 -0
- package/dist/viewers/proto/styles.d.ts +1 -0
- package/dist/viewers/proto/styles.js +2 -0
- package/dist/viewers/psd/index.d.ts +27 -0
- package/dist/viewers/psd/index.js +39 -0
- package/dist/viewers/psd/self-loading.d.ts +10 -0
- package/dist/viewers/psd/self-loading.js +20 -0
- package/dist/viewers/psd/styles.d.ts +1 -0
- package/dist/viewers/psd/styles.js +1 -0
- package/dist/viewers/reqif/index.d.ts +15 -0
- package/dist/viewers/reqif/index.js +5 -0
- package/dist/viewers/shapefile/index.d.ts +35 -0
- package/dist/viewers/shapefile/index.js +336 -0
- package/dist/viewers/shapefile/self-loading.d.ts +7 -0
- package/dist/viewers/shapefile/self-loading.js +32 -0
- package/dist/viewers/shapefile/styles.d.ts +1 -0
- package/dist/viewers/shapefile/styles.js +28 -0
- package/dist/viewers/stp/index.d.ts +15 -0
- package/dist/viewers/stp/index.js +5 -0
- package/dist/viewers/structured-styles.d.ts +1 -0
- package/dist/viewers/structured-styles.js +1 -0
- package/dist/viewers/structured.d.ts +36 -0
- package/dist/viewers/structured.js +138 -0
- package/dist/viewers/toml/controller.d.ts +38 -0
- package/dist/viewers/toml/controller.js +61 -0
- package/dist/viewers/toml/index.d.ts +18 -0
- package/dist/viewers/toml/index.js +34 -0
- package/dist/viewers/types.d.ts +36 -0
- package/dist/viewers/types.js +9 -0
- package/dist/viewers/video/controller.d.ts +29 -0
- package/dist/viewers/video/controller.js +54 -0
- package/dist/viewers/video/index.d.ts +18 -0
- package/dist/viewers/video/index.js +305 -0
- package/dist/viewers/video/styles.d.ts +1 -0
- package/dist/viewers/video/styles.js +79 -0
- package/dist/viewers/word/controller.d.ts +19 -0
- package/dist/viewers/word/controller.js +22 -0
- package/dist/viewers/word/docx-preprocess.d.ts +63 -0
- package/dist/viewers/word/docx-preprocess.js +136 -0
- package/dist/viewers/word/index.d.ts +32 -0
- package/dist/viewers/word/index.js +187 -0
- package/dist/viewers/word/normalize-docx.d.ts +2 -0
- package/dist/viewers/word/normalize-docx.js +50 -0
- package/dist/viewers/word/paginate.d.ts +1 -0
- package/dist/viewers/word/paginate.js +1035 -0
- package/dist/viewers/word/self-loading.d.ts +2 -0
- package/dist/viewers/word/self-loading.js +7 -0
- package/dist/viewers/word/styles.d.ts +1 -0
- package/dist/viewers/word/styles.js +686 -0
- package/dist/viewers/yaml/controller.d.ts +42 -0
- package/dist/viewers/yaml/controller.js +41 -0
- package/dist/viewers/yaml/index.d.ts +21 -0
- package/dist/viewers/yaml/index.js +20 -0
- package/package.json +375 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PptColorScheme, PptPictureAsset, PptPresentationMetrics, PptRecord, PptTextBlock } from './pptBinaryTypes.js';
|
|
2
|
+
export declare function normalizeBuildSlidesArgs(slideRecords: PptRecord[], pictures: PptPictureAsset[], outlineTextByPersistId: Map<number, PptTextBlock[]>, defaultColorScheme: PptColorScheme | null, masterRecordOrPresentationMetrics: PptRecord | PptPresentationMetrics | null, presentationMetricsOrWidth: PptPresentationMetrics | number | null, widthPxOrHeight: number, heightPxOrPicturesById?: number | Map<number, PptPictureAsset>, picturesByIdMaybe?: Map<number, PptPictureAsset>): {
|
|
3
|
+
slideRecords: PptRecord[];
|
|
4
|
+
pictures: PptPictureAsset[];
|
|
5
|
+
outlineTextByPersistId: Map<number, PptTextBlock[]>;
|
|
6
|
+
defaultColorScheme: PptColorScheme | null;
|
|
7
|
+
masterRecord: PptRecord | null;
|
|
8
|
+
presentationMetrics: PptPresentationMetrics | null;
|
|
9
|
+
widthPx: number;
|
|
10
|
+
heightPx: number;
|
|
11
|
+
picturesById?: Map<number, PptPictureAsset>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function normalizeBuildSlidesArgs(slideRecords, pictures, outlineTextByPersistId, defaultColorScheme, masterRecordOrPresentationMetrics, presentationMetricsOrWidth, widthPxOrHeight, heightPxOrPicturesById, picturesByIdMaybe) {
|
|
2
|
+
const isPresentationMetrics = (value) => !!value
|
|
3
|
+
&& typeof value === 'object'
|
|
4
|
+
&& 'rawWidth' in value
|
|
5
|
+
&& 'rawHeight' in value;
|
|
6
|
+
const isPptRecord = (value) => !!value
|
|
7
|
+
&& typeof value === 'object'
|
|
8
|
+
&& 'recType' in value
|
|
9
|
+
&& 'payload' in value;
|
|
10
|
+
const masterRecord = isPptRecord(masterRecordOrPresentationMetrics)
|
|
11
|
+
? masterRecordOrPresentationMetrics
|
|
12
|
+
: null;
|
|
13
|
+
const presentationMetrics = isPptRecord(masterRecordOrPresentationMetrics)
|
|
14
|
+
? (isPresentationMetrics(presentationMetricsOrWidth) ? presentationMetricsOrWidth : null)
|
|
15
|
+
: (isPresentationMetrics(masterRecordOrPresentationMetrics)
|
|
16
|
+
? masterRecordOrPresentationMetrics
|
|
17
|
+
: (isPresentationMetrics(presentationMetricsOrWidth) ? presentationMetricsOrWidth : null));
|
|
18
|
+
const widthPx = typeof heightPxOrPicturesById === 'number'
|
|
19
|
+
? widthPxOrHeight
|
|
20
|
+
: typeof presentationMetricsOrWidth === 'number'
|
|
21
|
+
? presentationMetricsOrWidth
|
|
22
|
+
: widthPxOrHeight;
|
|
23
|
+
const heightPx = typeof heightPxOrPicturesById === 'number'
|
|
24
|
+
? heightPxOrPicturesById
|
|
25
|
+
: widthPxOrHeight;
|
|
26
|
+
const picturesById = heightPxOrPicturesById instanceof Map
|
|
27
|
+
? heightPxOrPicturesById
|
|
28
|
+
: picturesByIdMaybe;
|
|
29
|
+
return {
|
|
30
|
+
slideRecords,
|
|
31
|
+
pictures,
|
|
32
|
+
outlineTextByPersistId,
|
|
33
|
+
defaultColorScheme,
|
|
34
|
+
masterRecord,
|
|
35
|
+
presentationMetrics,
|
|
36
|
+
widthPx,
|
|
37
|
+
heightPx,
|
|
38
|
+
picturesById
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// @ts-nocheck -- upstream VS Code parser predates exactOptionalPropertyTypes.
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
const FREESECT = 0xffffffff;
|
|
4
|
+
const ENDOFCHAIN = 0xfffffffe;
|
|
5
|
+
export function parseCfb(file) {
|
|
6
|
+
if (file.length < 512) {
|
|
7
|
+
throw new Error('Invalid CFB file: too small.');
|
|
8
|
+
}
|
|
9
|
+
const signature = file.slice(0, 8).toString('hex');
|
|
10
|
+
if (signature !== 'd0cf11e0a1b11ae1') {
|
|
11
|
+
throw new Error('Invalid CFB signature.');
|
|
12
|
+
}
|
|
13
|
+
const sectorShift = file.readUInt16LE(30);
|
|
14
|
+
const miniSectorShift = file.readUInt16LE(32);
|
|
15
|
+
const sectorSize = 1 << sectorShift;
|
|
16
|
+
const miniSectorSize = 1 << miniSectorShift;
|
|
17
|
+
const numFatSectors = file.readUInt32LE(44);
|
|
18
|
+
const firstDirSector = file.readInt32LE(48);
|
|
19
|
+
const miniCutoff = file.readUInt32LE(56);
|
|
20
|
+
const firstMiniFatSector = file.readInt32LE(60);
|
|
21
|
+
const numMiniFatSectors = file.readUInt32LE(64);
|
|
22
|
+
const firstDifatSector = file.readInt32LE(68);
|
|
23
|
+
const numDifatSectors = file.readUInt32LE(72);
|
|
24
|
+
const readSector = (sid) => {
|
|
25
|
+
const offset = (sid + 1) * sectorSize;
|
|
26
|
+
if (offset < 0 || offset + sectorSize > file.length) {
|
|
27
|
+
return Buffer.alloc(0);
|
|
28
|
+
}
|
|
29
|
+
return file.slice(offset, offset + sectorSize);
|
|
30
|
+
};
|
|
31
|
+
const difat = [];
|
|
32
|
+
for (let i = 0; i < 109; i++) {
|
|
33
|
+
const sid = file.readInt32LE(76 + i * 4);
|
|
34
|
+
if (sid !== -1)
|
|
35
|
+
difat.push(sid);
|
|
36
|
+
}
|
|
37
|
+
let nextDifat = firstDifatSector;
|
|
38
|
+
for (let i = 0; i < numDifatSectors && nextDifat !== ENDOFCHAIN && nextDifat !== -1; i++) {
|
|
39
|
+
const sec = readSector(nextDifat);
|
|
40
|
+
if (sec.length === 0)
|
|
41
|
+
break;
|
|
42
|
+
const entriesPerSector = sectorSize / 4 - 1;
|
|
43
|
+
for (let j = 0; j < entriesPerSector; j++) {
|
|
44
|
+
const sid = sec.readInt32LE(j * 4);
|
|
45
|
+
if (sid !== -1)
|
|
46
|
+
difat.push(sid);
|
|
47
|
+
}
|
|
48
|
+
nextDifat = sec.readInt32LE(sectorSize - 4);
|
|
49
|
+
}
|
|
50
|
+
const fatSectors = difat.slice(0, numFatSectors);
|
|
51
|
+
const fat = [];
|
|
52
|
+
fatSectors.forEach((sid) => {
|
|
53
|
+
const sec = readSector(sid);
|
|
54
|
+
if (sec.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (let i = 0; i < sectorSize; i += 4) {
|
|
58
|
+
fat.push(sec.readInt32LE(i));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const readChain = (startSid) => {
|
|
62
|
+
if (startSid < 0 || startSid === ENDOFCHAIN) {
|
|
63
|
+
return Buffer.alloc(0);
|
|
64
|
+
}
|
|
65
|
+
const chunks = [];
|
|
66
|
+
const seen = new Set();
|
|
67
|
+
let sid = startSid;
|
|
68
|
+
while (sid >= 0 && sid !== ENDOFCHAIN && sid !== FREESECT) {
|
|
69
|
+
if (seen.has(sid) || sid >= fat.length) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
seen.add(sid);
|
|
73
|
+
const sec = readSector(sid);
|
|
74
|
+
if (sec.length === 0) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
chunks.push(sec);
|
|
78
|
+
sid = fat[sid];
|
|
79
|
+
}
|
|
80
|
+
return Buffer.concat(chunks);
|
|
81
|
+
};
|
|
82
|
+
const dirStream = readChain(firstDirSector);
|
|
83
|
+
const entries = [];
|
|
84
|
+
for (let off = 0; off + 128 <= dirStream.length; off += 128) {
|
|
85
|
+
const nameLength = dirStream.readUInt16LE(off + 64);
|
|
86
|
+
const rawName = dirStream.slice(off, off + Math.max(0, nameLength - 2));
|
|
87
|
+
entries.push({
|
|
88
|
+
name: rawName.toString('utf16le').split('\u0000').join(''),
|
|
89
|
+
type: dirStream.readUInt8(off + 66),
|
|
90
|
+
leftId: dirStream.readInt32LE(off + 68),
|
|
91
|
+
rightId: dirStream.readInt32LE(off + 72),
|
|
92
|
+
childId: dirStream.readInt32LE(off + 76),
|
|
93
|
+
startSector: dirStream.readInt32LE(off + 116),
|
|
94
|
+
size: dirStream.readUInt32LE(off + 124) > 0 ? Number(dirStream.readUInt32LE(off + 120)) : dirStream.readUInt32LE(off + 120)
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const root = entries.find((entry) => entry.type === 5);
|
|
98
|
+
const miniStream = root ? readChain(root.startSector).slice(0, root.size) : Buffer.alloc(0);
|
|
99
|
+
const miniFatStream = readChain(firstMiniFatSector);
|
|
100
|
+
const miniFat = [];
|
|
101
|
+
for (let off = 0; off + 4 <= numMiniFatSectors * sectorSize && off + 4 <= miniFatStream.length; off += 4) {
|
|
102
|
+
miniFat.push(miniFatStream.readInt32LE(off));
|
|
103
|
+
}
|
|
104
|
+
const readMiniChain = (startMiniSid, size) => {
|
|
105
|
+
if (startMiniSid < 0) {
|
|
106
|
+
return Buffer.alloc(0);
|
|
107
|
+
}
|
|
108
|
+
const chunks = [];
|
|
109
|
+
const seen = new Set();
|
|
110
|
+
let sid = startMiniSid;
|
|
111
|
+
while (sid >= 0 && sid !== ENDOFCHAIN && sid !== FREESECT) {
|
|
112
|
+
if (seen.has(sid) || sid >= miniFat.length) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
seen.add(sid);
|
|
116
|
+
const start = sid * miniSectorSize;
|
|
117
|
+
const end = start + miniSectorSize;
|
|
118
|
+
if (start < 0 || end > miniStream.length) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
chunks.push(miniStream.slice(start, end));
|
|
122
|
+
sid = miniFat[sid];
|
|
123
|
+
}
|
|
124
|
+
return Buffer.concat(chunks).slice(0, size);
|
|
125
|
+
};
|
|
126
|
+
const byName = new Map();
|
|
127
|
+
entries.forEach((entry) => {
|
|
128
|
+
if (entry.name) {
|
|
129
|
+
byName.set(entry.name, entry);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
getStream: (name) => {
|
|
134
|
+
const entry = byName.get(name);
|
|
135
|
+
if (!entry || entry.type !== 2) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
if (entry.size < miniCutoff && root) {
|
|
139
|
+
return readMiniChain(entry.startSector, entry.size);
|
|
140
|
+
}
|
|
141
|
+
return readChain(entry.startSector).slice(0, entry.size);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export function parseRecords(buffer, start, end) {
|
|
146
|
+
const records = [];
|
|
147
|
+
let offset = start;
|
|
148
|
+
while (offset + 8 <= end && offset + 8 <= buffer.length) {
|
|
149
|
+
const verInst = buffer.readUInt16LE(offset);
|
|
150
|
+
const recVer = verInst & 0x000f;
|
|
151
|
+
const recInstance = (verInst >> 4) & 0x0fff;
|
|
152
|
+
const recType = buffer.readUInt16LE(offset + 2);
|
|
153
|
+
const length = buffer.readUInt32LE(offset + 4);
|
|
154
|
+
const payloadOffset = offset + 8;
|
|
155
|
+
const payloadEnd = payloadOffset + length;
|
|
156
|
+
if (payloadEnd > end || payloadEnd > buffer.length) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
const record = {
|
|
160
|
+
recType,
|
|
161
|
+
recInstance,
|
|
162
|
+
recVer,
|
|
163
|
+
length,
|
|
164
|
+
payloadOffset,
|
|
165
|
+
payload: buffer.slice(payloadOffset, payloadEnd)
|
|
166
|
+
};
|
|
167
|
+
if (recVer === 0x0f) {
|
|
168
|
+
record.children = parseRecords(buffer, payloadOffset, payloadEnd);
|
|
169
|
+
}
|
|
170
|
+
records.push(record);
|
|
171
|
+
offset = payloadEnd;
|
|
172
|
+
}
|
|
173
|
+
return records;
|
|
174
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export interface CfbEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
type: number;
|
|
4
|
+
leftId: number;
|
|
5
|
+
rightId: number;
|
|
6
|
+
childId: number;
|
|
7
|
+
startSector: number;
|
|
8
|
+
size: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CfbParseResult {
|
|
11
|
+
getStream(name: string): Buffer | null;
|
|
12
|
+
}
|
|
13
|
+
export interface PptRecord {
|
|
14
|
+
recType: number;
|
|
15
|
+
recInstance: number;
|
|
16
|
+
recVer: number;
|
|
17
|
+
length: number;
|
|
18
|
+
payloadOffset: number;
|
|
19
|
+
payload: Buffer;
|
|
20
|
+
children?: PptRecord[];
|
|
21
|
+
}
|
|
22
|
+
export interface PptShapeBounds {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}
|
|
28
|
+
export interface PptTextBlock {
|
|
29
|
+
text: string;
|
|
30
|
+
textType?: number;
|
|
31
|
+
placeholderType?: number;
|
|
32
|
+
bounds?: PptShapeBounds;
|
|
33
|
+
color?: string;
|
|
34
|
+
fontSizePx?: number;
|
|
35
|
+
fillColor?: string;
|
|
36
|
+
borderColor?: string;
|
|
37
|
+
borderWidthPx?: number;
|
|
38
|
+
fillVisible?: boolean;
|
|
39
|
+
borderVisible?: boolean;
|
|
40
|
+
spContainerIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface PptTextGroup {
|
|
43
|
+
blocks: PptTextBlock[];
|
|
44
|
+
placeholderType?: number;
|
|
45
|
+
bounds?: PptShapeBounds;
|
|
46
|
+
fillColor?: string;
|
|
47
|
+
borderColor?: string;
|
|
48
|
+
borderWidthPx?: number;
|
|
49
|
+
fillVisible?: boolean;
|
|
50
|
+
borderVisible?: boolean;
|
|
51
|
+
spContainerIndex?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface PptVisualSlot {
|
|
54
|
+
placeholderType?: number;
|
|
55
|
+
bounds?: PptShapeBounds;
|
|
56
|
+
fillColor?: string;
|
|
57
|
+
borderColor?: string;
|
|
58
|
+
imageRefId?: number;
|
|
59
|
+
isTextSlot?: boolean;
|
|
60
|
+
borderWidthPx?: number;
|
|
61
|
+
fillVisible?: boolean;
|
|
62
|
+
borderVisible?: boolean;
|
|
63
|
+
spContainerIndex?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface PptColorScheme {
|
|
66
|
+
backgroundColor?: string;
|
|
67
|
+
textColor?: string;
|
|
68
|
+
titleColor?: string;
|
|
69
|
+
fillColor?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PptSlideLayoutInfo {
|
|
72
|
+
geom: number;
|
|
73
|
+
placeholders: number[];
|
|
74
|
+
}
|
|
75
|
+
export interface PptPictureAsset {
|
|
76
|
+
mime: string;
|
|
77
|
+
base64: string;
|
|
78
|
+
pictureIndex?: number;
|
|
79
|
+
}
|
|
80
|
+
export interface PptSlideElementParagraph {
|
|
81
|
+
text: string;
|
|
82
|
+
level: number;
|
|
83
|
+
bullet?: boolean;
|
|
84
|
+
align?: string;
|
|
85
|
+
fontSizePx?: number;
|
|
86
|
+
bold?: boolean;
|
|
87
|
+
italic?: boolean;
|
|
88
|
+
color?: string;
|
|
89
|
+
runs?: Array<{
|
|
90
|
+
text: string;
|
|
91
|
+
fontSizePx?: number;
|
|
92
|
+
bold?: boolean;
|
|
93
|
+
italic?: boolean;
|
|
94
|
+
color?: string;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
export interface PptSlideElement {
|
|
98
|
+
type: 'text' | 'image' | 'shape';
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
zIndex: number;
|
|
104
|
+
isTitle?: boolean;
|
|
105
|
+
paragraphs?: PptSlideElementParagraph[];
|
|
106
|
+
src?: string;
|
|
107
|
+
fillColor?: string;
|
|
108
|
+
borderColor?: string;
|
|
109
|
+
borderWidthPx?: number;
|
|
110
|
+
textStylePreset?: string;
|
|
111
|
+
rotateDeg?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface PptSlideModel {
|
|
114
|
+
slideNumber: number;
|
|
115
|
+
widthPx: number;
|
|
116
|
+
heightPx: number;
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
elements: PptSlideElement[];
|
|
119
|
+
}
|
|
120
|
+
export interface PptPresentationMetrics {
|
|
121
|
+
widthPx: number;
|
|
122
|
+
heightPx: number;
|
|
123
|
+
rawWidth: number;
|
|
124
|
+
rawHeight: number;
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PptPictureAsset, PptPresentationMetrics, PptRecord, PptSlideModel, PptTextBlock } from './pptBinaryTypes.js';
|
|
2
|
+
type ApplyMasterBackgroundImage = (elements: PptSlideModel['elements'], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number) => void;
|
|
3
|
+
export declare function applyActivityProcessLayoutImpl(elements: PptSlideModel['elements'], styledShapeBlocks: PptTextBlock[], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number, applyMasterBackgroundImage: ApplyMasterBackgroundImage): void;
|
|
4
|
+
export declare function applyMathPlayLetterLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
|
|
5
|
+
export declare function applyActivityListTableLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
|
|
6
|
+
export declare function applyClosingPracticeLayoutImpl(elements: PptSlideModel['elements'], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number, applyMasterBackgroundImage: ApplyMasterBackgroundImage): void;
|
|
7
|
+
export declare function applyDialoguePhotoLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
|
|
8
|
+
export declare function applyMathIntroLayoutImpl(elements: PptSlideModel['elements'], picturesById: Map<number, PptPictureAsset> | undefined, slideWidth: number, slideHeight: number): void;
|
|
9
|
+
export {};
|