@flyfish-group/file-viewer3 1.0.26 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -388
- package/README.md +3 -364
- package/dist/file-viewer3.css +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +22 -126
- package/dist/components/3MFLoader.js +0 -527
- package/dist/components/AMFLoader.js +0 -188
- package/dist/components/ArchiveViewer.js +0 -526
- package/dist/components/AudioViewer.js +0 -66
- package/dist/components/CadViewer.js +0 -9040
- package/dist/components/CodeViewer.js +0 -151
- package/dist/components/ColladaLoader.js +0 -2282
- package/dist/components/DrawingViewer.js +0 -295
- package/dist/components/EdaViewer.js +0 -630
- package/dist/components/EmailViewer.js +0 -276
- package/dist/components/EpubViewer.js +0 -172
- package/dist/components/FBXLoader.js +0 -1574
- package/dist/components/GLTFLoader.js +0 -1383
- package/dist/components/ImageViewer.js +0 -1519
- package/dist/components/KMZLoader.js +0 -45
- package/dist/components/MarkdownViewer.js +0 -1476
- package/dist/components/ModelViewer.js +0 -797
- package/dist/components/OBJLoader.js +0 -287
- package/dist/components/OfdViewer.js +0 -133
- package/dist/components/PCDLoader.js +0 -141
- package/dist/components/PLYLoader.js +0 -305
- package/dist/components/PdfView.js +0 -27667
- package/dist/components/PptxRender.js +0 -11217
- package/dist/components/STLLoader.js +0 -83
- package/dist/components/TDSLoader.js +0 -228
- package/dist/components/TypstViewer.js +0 -1697
- package/dist/components/USDLoader.js +0 -2526
- package/dist/components/UmdViewer.js +0 -1873
- package/dist/components/VRMLLoader.js +0 -6422
- package/dist/components/VTKLoader.js +0 -337
- package/dist/components/XYZLoader.js +0 -30
- package/dist/components/XlsxTable.js +0 -7879
- package/dist/components/__vite-browser-external.js +0 -7
- package/dist/components/_plugin-vue_export-helper.js +0 -8
- package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
- package/dist/components/arc.js +0 -79
- package/dist/components/architecture-7EHR7CIX.js +0 -3
- package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
- package/dist/components/archive.js +0 -24
- package/dist/components/asyncToGenerator.js +0 -29
- package/dist/components/audio.js +0 -19
- package/dist/components/az-AZ-76LH7QW2.js +0 -523
- package/dist/components/bash.js +0 -169
- package/dist/components/bg-BG-XCXSNQG7.js +0 -523
- package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
- package/dist/components/bn-BD-2XOGV67Q.js +0 -523
- package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
- package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
- package/dist/components/cad.js +0 -23
- package/dist/components/cfb.js +0 -1174
- package/dist/components/channel.js +0 -5
- package/dist/components/chunk-2J33WTMH.js +0 -26
- package/dist/components/chunk-3OPIFGDE.js +0 -4167
- package/dist/components/chunk-4BX2VUAB.js +0 -19
- package/dist/components/chunk-55IACEB6.js +0 -9
- package/dist/components/chunk-5ZQYHXKU.js +0 -669
- package/dist/components/chunk-6U3AYISY.js +0 -624
- package/dist/components/chunk-727SXJPM.js +0 -3356
- package/dist/components/chunk-AGHRB4JF.js +0 -324
- package/dist/components/chunk-AQP2D5EJ.js +0 -2055
- package/dist/components/chunk-BSJP7CBP.js +0 -83
- package/dist/components/chunk-CSCIHK7Q.js +0 -3500
- package/dist/components/chunk-EIO257PC.js +0 -1836
- package/dist/components/chunk-FMBD7UC4.js +0 -5
- package/dist/components/chunk-K2UTITRG.js +0 -17627
- package/dist/components/chunk-KSCS5N6A.js +0 -572
- package/dist/components/chunk-L5ZTLDWV.js +0 -40
- package/dist/components/chunk-LZXEDZCA.js +0 -60
- package/dist/components/chunk-ND2GUHAM.js +0 -61
- package/dist/components/chunk-NNHCCRGN.js +0 -20425
- package/dist/components/chunk-NZK2D7GU.js +0 -68
- package/dist/components/chunk-O5CBEL6O.js +0 -1894
- package/dist/components/chunk-QZHKN3VN.js +0 -12
- package/dist/components/chunk-SRAX5OIU.js +0 -22
- package/dist/components/chunk-WU5MYG2G.js +0 -14
- package/dist/components/chunk-XPW4576I.js +0 -1146
- package/dist/components/chunk-Z3N5DIM6.js +0 -59
- package/dist/components/chunk-ZUYEQ4TG.js +0 -22
- package/dist/components/chunk.js +0 -23
- package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
- package/dist/components/compiler.js +0 -2
- package/dist/components/core.js +0 -845
- package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
- package/dist/components/cpp.js +0 -225
- package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
- package/dist/components/csharp.js +0 -260
- package/dist/components/css.js +0 -140
- package/dist/components/cytoscape.esm.js +0 -18114
- package/dist/components/da-DK-5WZEPLOC.js +0 -523
- package/dist/components/dagre-BM42HDAG.js +0 -325
- package/dist/components/dagre.js +0 -1936
- package/dist/components/de-DE-XR44H4JA.js +0 -523
- package/dist/components/defaultLocale.js +0 -201
- package/dist/components/defineProperty.js +0 -50
- package/dist/components/diagram-2AECGRRQ.js +0 -229
- package/dist/components/diagram-5GNKFQAL.js +0 -108
- package/dist/components/diagram-KO2AKTUF.js +0 -443
- package/dist/components/diagram-LMA3HP47.js +0 -139
- package/dist/components/diagram-OG6HWLK6.js +0 -541
- package/dist/components/diff.js +0 -39
- package/dist/components/directory-open-01563666.js +0 -26
- package/dist/components/directory-open-4ed118d0.js +0 -83
- package/dist/components/dist.js +0 -50
- package/dist/components/dist2.js +0 -3291
- package/dist/components/dist3.js +0 -1593
- package/dist/components/documentSearch.js +0 -378
- package/dist/components/docx-preview.js +0 -3113
- package/dist/components/drawing.js +0 -19
- package/dist/components/ebook.js +0 -16
- package/dist/components/eda.js +0 -20
- package/dist/components/el-GR-BZB4AONW.js +0 -523
- package/dist/components/email.js +0 -21
- package/dist/components/en-B4ZKOASM.js +0 -3
- package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
- package/dist/components/es-ES-U4NZUMDT.js +0 -523
- package/dist/components/eu-ES-A7QVB2H4.js +0 -523
- package/dist/components/eventmodeling-FCH6USID.js +0 -3
- package/dist/components/fa-IR-HGAKTJCU.js +0 -523
- package/dist/components/fflate.module.js +0 -323
- package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
- package/dist/components/file-open-002ab408.js +0 -38
- package/dist/components/file-open-7c801643.js +0 -24
- package/dist/components/file-save-3189631c.js +0 -40
- package/dist/components/file-save-745eba88.js +0 -36
- package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
- package/dist/components/fr-FR-RHASNOE6.js +0 -523
- package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
- package/dist/components/gitGraph-WXDBUCRP.js +0 -3
- package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
- package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
- package/dist/components/global-compiler.js +0 -23
- package/dist/components/global-renderer.js +0 -23
- package/dist/components/go.js +0 -140
- package/dist/components/graphlib.js +0 -1267
- package/dist/components/he-IL-6SHJWFNN.js +0 -523
- package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
- package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
- package/dist/components/id-ID-SAP4L64H.js +0 -523
- package/dist/components/image-GAAHSSAO.js +0 -3
- package/dist/components/image-blob-reduce.esm.js +0 -1429
- package/dist/components/image.js +0 -17
- package/dist/components/info-J43DQDTF.js +0 -3
- package/dist/components/infoDiagram-5YYISTIA.js +0 -26
- package/dist/components/ini.js +0 -88
- package/dist/components/init.js +0 -15
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
- package/dist/components/it-IT-JPQ66NNP.js +0 -523
- package/dist/components/ja-JP-DBVTYXUO.js +0 -523
- package/dist/components/java.js +0 -169
- package/dist/components/javascript.js +0 -436
- package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
- package/dist/components/json.js +0 -36
- package/dist/components/jszip.min.js +0 -3033
- package/dist/components/kaa-6HZHGXH3.js +0 -523
- package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
- package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
- package/dist/components/katex.js +0 -21979
- package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
- package/dist/components/km-KH-HSX4SM5Z.js +0 -523
- package/dist/components/ko-KR-MTYHY66A.js +0 -523
- package/dist/components/ku-TR-6OUDTVRD.js +0 -523
- package/dist/components/lib.js +0 -4877
- package/dist/components/libarchive.js +0 -360
- package/dist/components/linear.js +0 -289
- package/dist/components/lt-LT-XHIRWOB4.js +0 -523
- package/dist/components/lv-LV-5QDEKY6T.js +0 -523
- package/dist/components/markdown.js +0 -181
- package/dist/components/md.js +0 -17
- package/dist/components/mermaid-parser.core.js +0 -328
- package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
- package/dist/components/model.js +0 -21
- package/dist/components/mp4.js +0 -12
- package/dist/components/mr-IN-CRQNXWMA.js +0 -523
- package/dist/components/my-MM-5M5IBNSE.js +0 -523
- package/dist/components/nb-NO-T6EIAALU.js +0 -523
- package/dist/components/nestedRender.js +0 -158
- package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
- package/dist/components/nn-NO-6E72VCQL.js +0 -523
- package/dist/components/objectSpread2.js +0 -29
- package/dist/components/objectWithoutProperties.js +0 -28
- package/dist/components/oc-FR-POXYY2M6.js +0 -523
- package/dist/components/ofd.js +0 -5261
- package/dist/components/ofd2.js +0 -16
- package/dist/components/ordinal.js +0 -65
- package/dist/components/pa-IN-N4M65BXN.js +0 -523
- package/dist/components/packet-YPE3B663.js +0 -3
- package/dist/components/pdf.js +0 -24
- package/dist/components/percentages-BXMCSKIN.js +0 -3
- package/dist/components/php.js +0 -294
- package/dist/components/pica.js +0 -1009
- package/dist/components/pie-LRSECV5Y.js +0 -3
- package/dist/components/pie.js +0 -47
- package/dist/components/pieDiagram-4H26LBE5.js +0 -130
- package/dist/components/pl-PL-T2D74RX3.js +0 -523
- package/dist/components/postal-mime.js +0 -3146
- package/dist/components/pptx.js +0 -15
- package/dist/components/printLayout.js +0 -42
- package/dist/components/prod.js +0 -21770
- package/dist/components/pt-BR-5N22H2LF.js +0 -523
- package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
- package/dist/components/python.js +0 -238
- package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
- package/dist/components/radar-GUYGQ44K.js +0 -3
- package/dist/components/renderer.js +0 -2
- package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
- package/dist/components/ro-RO-JPDTUUEW.js +0 -523
- package/dist/components/rough.esm.js +0 -1355
- package/dist/components/roundRect.js +0 -90
- package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
- package/dist/components/rust.js +0 -169
- package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
- package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
- package/dist/components/shared.js +0 -175
- package/dist/components/shared2.js +0 -4
- package/dist/components/si-LK-N5RQ5JYF.js +0 -523
- package/dist/components/sk-SK-C5VTKIMK.js +0 -523
- package/dist/components/sl-SI-NN7IZMDC.js +0 -523
- package/dist/components/sourceLoading.js +0 -134
- package/dist/components/sql.js +0 -118
- package/dist/components/src.js +0 -2664
- package/dist/components/src2.js +0 -10722
- package/dist/components/stateDiagram-AJRCARHV.js +0 -217
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
- package/dist/components/subset-shared.chunk.js +0 -3
- package/dist/components/subset-worker.chunk.js +0 -21
- package/dist/components/sv-SE-XGPEYMSR.js +0 -523
- package/dist/components/ta-IN-2NMHFXQM.js +0 -523
- package/dist/components/text.js +0 -20
- package/dist/components/th-TH-HPSO5L25.js +0 -523
- package/dist/components/three.module.js +0 -13134
- package/dist/components/time.js +0 -910
- package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
- package/dist/components/tr-TR-DEFEU3FU.js +0 -523
- package/dist/components/treeView-BLDUP644.js +0 -3
- package/dist/components/treemap-LRROVOQU.js +0 -3
- package/dist/components/typescript.js +0 -521
- package/dist/components/typst.js +0 -25
- package/dist/components/uk-UA-QMV73CPH.js +0 -523
- package/dist/components/umd.js +0 -16
- package/dist/components/use.js +0 -422
- package/dist/components/util.js +0 -49
- package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
- package/dist/components/vi-VN-M7AON7JQ.js +0 -523
- package/dist/components/viewerZoom.js +0 -92
- package/dist/components/wardley-L42UT6IY.js +0 -3
- package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
- package/dist/components/wasm-pack-shim.js +0 -1711
- package/dist/components/wasm-pack-shim2.js +0 -934
- package/dist/components/wasm.js +0 -97
- package/dist/components/word.js +0 -3055
- package/dist/components/worker-ref.js +0 -16
- package/dist/components/xlsx.js +0 -21
- package/dist/components/xml.js +0 -166
- package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
- package/dist/components/yaml.js +0 -144
- package/dist/components/zh-CN-LNUGB5OW.js +0 -523
- package/dist/components/zh-HK-E62DVLB3.js +0 -523
- package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
- package/dist/index.mjs +0 -3293
- package/dist/src/App.vue.d.ts +0 -3
- package/dist/src/compare/CompareApp.vue.d.ts +0 -3
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
- package/dist/src/components/HelloWorld.vue.d.ts +0 -3
- package/dist/src/components/utils.d.ts +0 -4
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +0 -27
- package/dist/src/package/common/printLayout.d.ts +0 -16
- package/dist/src/package/common/sourceLoading.d.ts +0 -10
- package/dist/src/package/common/type.d.ts +0 -544
- package/dist/src/package/common/util.d.ts +0 -5
- package/dist/src/package/common/worker-ref.d.ts +0 -12
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
- package/dist/src/package/components/FileViewer/index.d.ts +0 -2
- package/dist/src/package/components/FileViewer/util.d.ts +0 -3
- package/dist/src/package/index.d.ts +0 -22
- package/dist/src/package/use/documentLocation.d.ts +0 -15
- package/dist/src/package/use/documentSearch.d.ts +0 -234
- package/dist/src/package/use/index.d.ts +0 -5
- package/dist/src/package/use/loading.d.ts +0 -33
- package/dist/src/package/use/viewerZoom.d.ts +0 -42
- package/dist/src/package/use/worker.d.ts +0 -24
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/archive/cache.d.ts +0 -10
- package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
- package/dist/src/package/vendors/archive/index.d.ts +0 -3
- package/dist/src/package/vendors/archive/shared.d.ts +0 -24
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/audio/index.d.ts +0 -7
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/cad/index.d.ts +0 -8
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/drawing/index.d.ts +0 -7
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ebook/index.d.ts +0 -7
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/eda/index.d.ts +0 -2
- package/dist/src/package/vendors/eda/parser.d.ts +0 -77
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
- package/dist/src/package/vendors/email/index.d.ts +0 -2
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/image/index.d.ts +0 -4
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/md/index.d.ts +0 -4
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/model/index.d.ts +0 -3
- package/dist/src/package/vendors/model/shared.d.ts +0 -1
- package/dist/src/package/vendors/mp4/index.d.ts +0 -4
- package/dist/src/package/vendors/nestedRender.d.ts +0 -10
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ofd/index.d.ts +0 -7
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
- package/dist/src/package/vendors/pdf/index.d.ts +0 -2
- package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
- package/dist/src/package/vendors/pptx/index.d.ts +0 -6
- package/dist/src/package/vendors/pptx/options.d.ts +0 -39
- package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
- package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/renders.d.ts +0 -3
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/text/index.d.ts +0 -10
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/typst/index.d.ts +0 -8
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/umd/index.d.ts +0 -7
- package/dist/src/package/vendors/umd/parser.d.ts +0 -30
- package/dist/src/package/vendors/word/doc.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
- package/dist/src/package/vendors/word/index.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
- package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
- package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +0 -24
- package/dist/wasm/cad/libredwg-web.js +0 -15
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
package/dist/src/App.vue.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
type ScrollerGetter = () => HTMLElement | null;
|
|
3
|
-
export declare const useSynchronizedScroll: (enabled: Ref<boolean>, getLeftScroller: ScrollerGetter, getRightScroller: ScrollerGetter) => {
|
|
4
|
-
bind: () => Promise<void>;
|
|
5
|
-
destroy: () => void;
|
|
6
|
-
};
|
|
7
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
package/dist/src/main.d.ts
DELETED
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { FileRenderExportAdapter } from './type';
|
|
2
|
-
/**
|
|
3
|
-
* 这些格式只有专属适配器准备好后才展示打印。
|
|
4
|
-
*
|
|
5
|
-
* 它们的在线预览常依赖分页引擎、虚拟渲染或 Worker 生命周期,直接克隆
|
|
6
|
-
* DOM 很容易只得到当前页或当前视口。
|
|
7
|
-
*/
|
|
8
|
-
export declare const ADAPTER_PRINT_REQUIRED_EXTENSIONS: string[];
|
|
9
|
-
/**
|
|
10
|
-
* 这些格式的预览结果是完整 DOM / SVG / Canvas 截图,解除滚动容器裁切后
|
|
11
|
-
* 可以稳定进入浏览器打印流程。
|
|
12
|
-
*/
|
|
13
|
-
export declare const DOM_PRINTABLE_EXTENSIONS: string[];
|
|
14
|
-
/**
|
|
15
|
-
* 这些格式默认不展示打印按钮,避免导出半截内容。
|
|
16
|
-
*
|
|
17
|
-
* - 表格链路使用虚拟滚动,只渲染局部窗口;
|
|
18
|
-
* - 压缩包/邮件包含嵌套预览,顶层不是单一可打印文档;
|
|
19
|
-
* - EPUB 使用 iframe/连续分页;
|
|
20
|
-
* - 3D、音视频是交互媒体。
|
|
21
|
-
*/
|
|
22
|
-
export declare const NON_PRINTABLE_EXTENSIONS: string[];
|
|
23
|
-
export declare const normalizeFileExtension: (extension: string) => string;
|
|
24
|
-
export declare const needsDedicatedPrintAdapter: (extension: string) => boolean;
|
|
25
|
-
export declare const isDomPrintableExtension: (extension: string) => boolean;
|
|
26
|
-
export declare const isKnownNonPrintableExtension: (extension: string) => boolean;
|
|
27
|
-
export declare const resolvePrintAvailability: (extension: string, adapter: FileRenderExportAdapter | null, renderedReady: boolean) => boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface PrintPageSize {
|
|
2
|
-
width: number;
|
|
3
|
-
height: number;
|
|
4
|
-
}
|
|
5
|
-
interface ApplyPrintPageSizeOptions {
|
|
6
|
-
heightMode?: 'fixed' | 'min';
|
|
7
|
-
}
|
|
8
|
-
interface BuildPrintPageStyleOptions extends PrintPageSize {
|
|
9
|
-
selector: string;
|
|
10
|
-
heightMode?: 'fixed' | 'min';
|
|
11
|
-
}
|
|
12
|
-
export declare const formatCssPixels: (value: number) => string;
|
|
13
|
-
export declare const getElementPrintPageSize: (element: HTMLElement, fallback?: Partial<PrintPageSize>) => PrintPageSize;
|
|
14
|
-
export declare const applyPrintPageSize: (element: HTMLElement, size: PrintPageSize, options?: ApplyPrintPageSizeOptions) => void;
|
|
15
|
-
export declare const buildPrintPageStyle: ({ selector, width, height, heightMode }: BuildPrintPageStyleOptions) => string;
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FileViewerPdfOptions } from './type';
|
|
2
|
-
export declare const DEFAULT_PDF_RANGE_CHUNK_SIZE: number;
|
|
3
|
-
export declare const normalizePdfStreamingMode: (mode: FileViewerPdfOptions["streaming"]) => true | false | "same-origin";
|
|
4
|
-
export declare const isSameOriginUrl: (url: string, pageHref: string) => boolean;
|
|
5
|
-
export declare const shouldStreamPdfUrl: ({ extension, pageHref, streaming, url }: {
|
|
6
|
-
extension: string;
|
|
7
|
-
pageHref: string;
|
|
8
|
-
streaming?: FileViewerPdfOptions["streaming"];
|
|
9
|
-
url: string;
|
|
10
|
-
}) => boolean;
|
|
@@ -1,544 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* 渲染器返回的 Vue 包装实例。
|
|
4
|
-
*
|
|
5
|
-
* Vue3 渲染器直接返回 `App`,少量兼容渲染器会返回只暴露 `$el`
|
|
6
|
-
* 与 `unmount()` 的轻量包装对象。
|
|
7
|
-
*/
|
|
8
|
-
export interface AppWrapper {
|
|
9
|
-
$el: Node;
|
|
10
|
-
unmount(): void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 任意渲染器挂载完成后返回的可卸载实例。
|
|
14
|
-
*/
|
|
15
|
-
export type Rendered = App | AppWrapper;
|
|
16
|
-
/**
|
|
17
|
-
* 组件可接受的本地二进制来源。
|
|
18
|
-
*
|
|
19
|
-
* 对外接入时最推荐传入带正确文件名的 `File`。如果业务侧拿到的是
|
|
20
|
-
* `Blob` 或 `ArrayBuffer`,请先包装成 `new File([...], 'demo.pdf')`,
|
|
21
|
-
* 这样渲染器才能通过扩展名选择正确的预览链路。
|
|
22
|
-
*/
|
|
23
|
-
export type FileRef = File | Blob | ArrayBuffer;
|
|
24
|
-
/**
|
|
25
|
-
* 水印配置。
|
|
26
|
-
*
|
|
27
|
-
* `text` 与 `image` 至少设置一个;同时传入时优先使用图片水印。
|
|
28
|
-
* 图片水印可以是 http(s) URL、相对路径或 data URL。
|
|
29
|
-
*/
|
|
30
|
-
export interface FileViewerWatermarkOptions {
|
|
31
|
-
enabled?: boolean;
|
|
32
|
-
text?: string;
|
|
33
|
-
image?: string;
|
|
34
|
-
opacity?: number;
|
|
35
|
-
rotate?: number;
|
|
36
|
-
gapX?: number;
|
|
37
|
-
gapY?: number;
|
|
38
|
-
width?: number;
|
|
39
|
-
height?: number;
|
|
40
|
-
fontSize?: number;
|
|
41
|
-
color?: string;
|
|
42
|
-
fontFamily?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 预览器内置操作栏位置。
|
|
46
|
-
*
|
|
47
|
-
* `auto` 是默认策略: PDF 这类有独立阅读工具栏的格式会自动悬浮到右下角,
|
|
48
|
-
* 其他格式继续使用顶部操作栏;也可以显式传 `top` 或 `bottom-right`。
|
|
49
|
-
*/
|
|
50
|
-
export type FileViewerToolbarPosition = 'auto' | 'top' | 'bottom-right';
|
|
51
|
-
/**
|
|
52
|
-
* 预览器内置操作栏配置。
|
|
53
|
-
*/
|
|
54
|
-
export interface FileViewerToolbarOptions {
|
|
55
|
-
download?: boolean;
|
|
56
|
-
print?: boolean;
|
|
57
|
-
exportHtml?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* 是否显示统一缩放控制。渲染器会按文件类型注册自己的缩放实现;
|
|
60
|
-
* 虚拟表格等不适合外层缩放的格式不会强行显示该按钮组。
|
|
61
|
-
*/
|
|
62
|
-
zoom?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* 操作栏位置。`bottom-right` 会以胶囊按钮组悬浮在预览区右下角,
|
|
65
|
-
* 适合 PDF 等自身已经有顶部导航栏的格式。
|
|
66
|
-
*/
|
|
67
|
-
position?: FileViewerToolbarPosition;
|
|
68
|
-
/**
|
|
69
|
-
* 内置操作按钮执行前的统一前置钩子。返回 `false` 时会取消本次操作。
|
|
70
|
-
*/
|
|
71
|
-
beforeOperation?: FileViewerBeforeOperation;
|
|
72
|
-
beforeDownload?: FileViewerBeforeOperation;
|
|
73
|
-
beforePrint?: FileViewerBeforeOperation;
|
|
74
|
-
beforeExportHtml?: FileViewerBeforeOperation;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 压缩包预览配置。
|
|
78
|
-
*/
|
|
79
|
-
export interface FileViewerArchiveOptions {
|
|
80
|
-
/**
|
|
81
|
-
* libarchive.js Worker 地址。私有化部署时建议把
|
|
82
|
-
* `worker-bundle.js` 与 `libarchive.wasm` 放在同一目录后传入。
|
|
83
|
-
*
|
|
84
|
-
* 没有传入时,预览器会先尝试当前部署 base 下的
|
|
85
|
-
* `vendor/libarchive/worker-bundle.js`,失败后自动回退到内置 Worker。
|
|
86
|
-
*/
|
|
87
|
-
workerUrl?: string;
|
|
88
|
-
/**
|
|
89
|
-
* 内置 Worker 回退时使用的 libarchive WASM 地址。只有在不希望使用打包产物中
|
|
90
|
-
* 的 wasm 资源、或需要指向私有 CDN 时才需要配置。
|
|
91
|
-
*/
|
|
92
|
-
wasmUrl?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Worker 初始化、加密检测和目录读取的超时时间,单位毫秒。默认 30000。
|
|
95
|
-
* 手机 WebView 或本地临时服务器不稳定时,超时后会自动尝试兼容模式。
|
|
96
|
-
*/
|
|
97
|
-
workerTimeoutMs?: number;
|
|
98
|
-
/**
|
|
99
|
-
* 是否启用 IndexedDB 缓存压缩包内已解压的文件。
|
|
100
|
-
*/
|
|
101
|
-
cache?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* 单个压缩包允许解析的最大体积,单位字节。
|
|
104
|
-
*/
|
|
105
|
-
maxArchiveSize?: number;
|
|
106
|
-
/**
|
|
107
|
-
* 压缩包内单文件允许在线预览的最大体积,单位字节。
|
|
108
|
-
*/
|
|
109
|
-
maxEntryPreviewSize?: number;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* PDF 预览配置。
|
|
113
|
-
*/
|
|
114
|
-
export interface FileViewerPdfOptions {
|
|
115
|
-
/**
|
|
116
|
-
* 是否显示 PDF 渲染器自己的阅读工具栏。
|
|
117
|
-
*
|
|
118
|
-
* 独立预览建议保持默认显示;在文档比对这类左右排版场景中可以设为
|
|
119
|
-
* `false`,让 PDF 与 Word / Markdown 等格式从同一内容起点对齐。
|
|
120
|
-
*/
|
|
121
|
-
toolbar?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* 是否启用左侧页面/目录导航窗格。设为 `false` 时会同时隐藏侧栏和切换按钮。
|
|
124
|
-
*/
|
|
125
|
-
navigation?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* 导航窗格初始是否展开。未设置时默认展开,`navigation: false` 时会被忽略。
|
|
128
|
-
*/
|
|
129
|
-
defaultNavigationVisible?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* 初始页面旋转角度。会按 90 度归一化到 0 / 90 / 180 / 270。
|
|
132
|
-
*/
|
|
133
|
-
rotation?: number;
|
|
134
|
-
/**
|
|
135
|
-
* 远端 PDF 是否优先交给 PDF.js 直接按 URL 渐进读取。
|
|
136
|
-
*
|
|
137
|
-
* 默认 `same-origin`,即同源 PDF 交给 PDF.js 通过 URL 渐进读取;
|
|
138
|
-
* 当文件服务支持 Range 时会进一步使用分片加载。跨域 URL 仍保持
|
|
139
|
-
* 旧的 Blob 下载后预览链路,最大化兼容鉴权下载和 CORS 场景。
|
|
140
|
-
* 设为 `true` 会对所有 URL 启用,设为 `false` 会完全禁用。
|
|
141
|
-
*/
|
|
142
|
-
streaming?: boolean | 'same-origin';
|
|
143
|
-
/**
|
|
144
|
-
* PDF.js Range 请求的分片大小,默认 64KB;仅在文件服务支持 Range 时生效。
|
|
145
|
-
*/
|
|
146
|
-
rangeChunkSize?: number;
|
|
147
|
-
/**
|
|
148
|
-
* PDF.js URL 读取 PDF 时是否携带浏览器凭据。
|
|
149
|
-
*/
|
|
150
|
-
withCredentials?: boolean;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Typst 预览配置。
|
|
154
|
-
*/
|
|
155
|
-
export interface FileViewerTypstOptions {
|
|
156
|
-
/**
|
|
157
|
-
* Typst compiler WASM 地址。需要浏览器端编译时才会加载。
|
|
158
|
-
*/
|
|
159
|
-
compilerWasmUrl?: string;
|
|
160
|
-
}
|
|
161
|
-
export type FileViewerCadRenderer = 'auto' | 'webgl' | 'canvas2d';
|
|
162
|
-
export type FileViewerCadDwfLineWeightMode = 'adaptive' | 'physical' | 'hairline';
|
|
163
|
-
/**
|
|
164
|
-
* CAD 预览配置。
|
|
165
|
-
*
|
|
166
|
-
* 默认使用 @flyfish-dev/cad-viewer,并从 viewer 静态目录下的
|
|
167
|
-
* `wasm/cad/` 按需加载 LibreDWG WASM、DWF raster WASM 与 DWG Worker。
|
|
168
|
-
* 私有化部署或 CDN 路径不同的场景,可以显式覆盖对应 URL。
|
|
169
|
-
*/
|
|
170
|
-
export interface FileViewerCadOptions {
|
|
171
|
-
wasmPath?: string;
|
|
172
|
-
workerUrl?: string | URL;
|
|
173
|
-
dwfWasmUrl?: string;
|
|
174
|
-
/**
|
|
175
|
-
* DXF 文本编码覆盖。一般会自动读取 `$DWGCODEPAGE`,仅在历史文件声明缺失
|
|
176
|
-
* 或错误时指定,例如 `gb18030`、`big5`、`shift_jis`、`windows-1252`。
|
|
177
|
-
*/
|
|
178
|
-
dxfEncoding?: string;
|
|
179
|
-
useWorker?: boolean;
|
|
180
|
-
workerTimeoutMs?: number;
|
|
181
|
-
renderer?: FileViewerCadRenderer;
|
|
182
|
-
preferDwgWasm?: boolean;
|
|
183
|
-
includePaperSpace?: boolean;
|
|
184
|
-
maxInsertDepth?: number;
|
|
185
|
-
keepRaw?: boolean;
|
|
186
|
-
preloadDwg?: boolean;
|
|
187
|
-
dwfPreferWebgl?: boolean;
|
|
188
|
-
dwfPreferWasm?: boolean;
|
|
189
|
-
dwfBackground?: string;
|
|
190
|
-
dwfMaxDevicePixelRatio?: number;
|
|
191
|
-
dwfMaxCanvasPixels?: number;
|
|
192
|
-
dwfMaxGpuCacheBytes?: number;
|
|
193
|
-
dwfMaxCachedScenes?: number;
|
|
194
|
-
dwfLineWeightMode?: FileViewerCadDwfLineWeightMode;
|
|
195
|
-
dwfMinStrokeCssPx?: number;
|
|
196
|
-
dwfMaxOverviewStrokeCssPx?: number;
|
|
197
|
-
dwfMinTextCssPx?: number;
|
|
198
|
-
dwfMinFilledAreaCssPx?: number;
|
|
199
|
-
canvasOptions?: Record<string, unknown>;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* 文档定位锚点。
|
|
203
|
-
*
|
|
204
|
-
* 预览器会尽量把当前渲染结果中的页面、段落、表格行、代码块等内容
|
|
205
|
-
* 抽象成稳定锚点。不同格式的“行”粒度不完全相同:文本类文档通常可到
|
|
206
|
-
* 段落/行块,PDF 这类画布型文档会优先回退到页与可用文本层。
|
|
207
|
-
*/
|
|
208
|
-
export interface FileViewerDocumentAnchor {
|
|
209
|
-
id: string;
|
|
210
|
-
index: number;
|
|
211
|
-
line: number;
|
|
212
|
-
type: 'page' | 'line' | 'block';
|
|
213
|
-
label: string;
|
|
214
|
-
text: string;
|
|
215
|
-
page?: number;
|
|
216
|
-
top: number;
|
|
217
|
-
left: number;
|
|
218
|
-
width: number;
|
|
219
|
-
height: number;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* AI / 搜索可复用的文档文本切片。
|
|
223
|
-
*
|
|
224
|
-
* 这里不直接绑定任何云端能力,只提供溯源、向量化和高亮所需的稳定结构。
|
|
225
|
-
*/
|
|
226
|
-
export interface FileViewerDocumentChunk {
|
|
227
|
-
id: string;
|
|
228
|
-
text: string;
|
|
229
|
-
anchor: FileViewerDocumentAnchor;
|
|
230
|
-
startLine: number;
|
|
231
|
-
endLine: number;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* 文档搜索配置。
|
|
235
|
-
*/
|
|
236
|
-
export interface FileViewerSearchOptions {
|
|
237
|
-
/**
|
|
238
|
-
* 是否启用搜索能力。设为 `false` 时公开方法仍存在,但不会执行高亮。
|
|
239
|
-
*/
|
|
240
|
-
enabled?: boolean;
|
|
241
|
-
/**
|
|
242
|
-
* 是否区分大小写。
|
|
243
|
-
*/
|
|
244
|
-
caseSensitive?: boolean;
|
|
245
|
-
/**
|
|
246
|
-
* 是否整词匹配。
|
|
247
|
-
*/
|
|
248
|
-
wholeWord?: boolean;
|
|
249
|
-
/**
|
|
250
|
-
* 单次搜索最多保留的命中数量,避免极端大文档一次性插入过多高亮节点。
|
|
251
|
-
*/
|
|
252
|
-
maxMatches?: number;
|
|
253
|
-
/**
|
|
254
|
-
* 搜索 MutationObserver 重新扫描的防抖时间。
|
|
255
|
-
*/
|
|
256
|
-
debounce?: number;
|
|
257
|
-
/**
|
|
258
|
-
* 自定义高亮类名。
|
|
259
|
-
*/
|
|
260
|
-
className?: string;
|
|
261
|
-
/**
|
|
262
|
-
* 当前命中高亮类名。
|
|
263
|
-
*/
|
|
264
|
-
activeClassName?: string;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* 单条搜索命中。
|
|
268
|
-
*/
|
|
269
|
-
export interface FileViewerSearchMatch {
|
|
270
|
-
id: string;
|
|
271
|
-
index: number;
|
|
272
|
-
text: string;
|
|
273
|
-
anchor: FileViewerDocumentAnchor | null;
|
|
274
|
-
line?: number;
|
|
275
|
-
page?: number;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* 当前搜索状态。
|
|
279
|
-
*/
|
|
280
|
-
export interface FileViewerSearchState {
|
|
281
|
-
query: string;
|
|
282
|
-
total: number;
|
|
283
|
-
currentIndex: number;
|
|
284
|
-
current: FileViewerSearchMatch | null;
|
|
285
|
-
matches: FileViewerSearchMatch[];
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* 渲染器自定义搜索提供器。
|
|
289
|
-
*
|
|
290
|
-
* PDF.js、EPUB iframe、虚拟表格等格式拥有自己的文本层或虚拟滚动结构,
|
|
291
|
-
* 不能总是由通用 DOM 高亮直接改写内部节点。渲染器可以在根节点上注册
|
|
292
|
-
* 该提供器,让 FileViewer 的搜索 API 继续保持统一入口。
|
|
293
|
-
*/
|
|
294
|
-
export interface FileViewerSearchProvider {
|
|
295
|
-
search: (query: string, options?: FileViewerSearchOptions) => FileViewerSearchState | Promise<FileViewerSearchState>;
|
|
296
|
-
next?: () => FileViewerSearchState | Promise<FileViewerSearchState>;
|
|
297
|
-
previous?: () => FileViewerSearchState | Promise<FileViewerSearchState>;
|
|
298
|
-
clear?: () => FileViewerSearchState | Promise<FileViewerSearchState>;
|
|
299
|
-
getState?: () => FileViewerSearchState;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* 当前预览内容的缩放状态。
|
|
303
|
-
*
|
|
304
|
-
* `scale` 使用 1 = 100% 的语义。部分格式会先按容器宽度自动适配,再在此
|
|
305
|
-
* 基础上放大缩小;对外仍返回最终有效比例,便于业务工具栏同步显示。
|
|
306
|
-
*/
|
|
307
|
-
export interface FileViewerZoomState {
|
|
308
|
-
scale: number;
|
|
309
|
-
label: string;
|
|
310
|
-
canZoomIn: boolean;
|
|
311
|
-
canZoomOut: boolean;
|
|
312
|
-
canReset: boolean;
|
|
313
|
-
minScale?: number;
|
|
314
|
-
maxScale?: number;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* 渲染器自定义缩放提供器。
|
|
318
|
-
*
|
|
319
|
-
* PDF、CAD、图片、Office 文档等格式拥有不同的内部缩放/重排逻辑;
|
|
320
|
-
* 统一工具栏只调用该协议,不对外层 DOM 做粗暴 CSS transform,避免表格、
|
|
321
|
-
* canvas、CAD 交互出现坐标偏移。
|
|
322
|
-
*/
|
|
323
|
-
export interface FileViewerZoomProvider {
|
|
324
|
-
zoomIn: () => FileViewerZoomState | Promise<FileViewerZoomState>;
|
|
325
|
-
zoomOut: () => FileViewerZoomState | Promise<FileViewerZoomState>;
|
|
326
|
-
resetZoom: () => FileViewerZoomState | Promise<FileViewerZoomState>;
|
|
327
|
-
setZoom?: (scale: number) => FileViewerZoomState | Promise<FileViewerZoomState>;
|
|
328
|
-
getState: () => FileViewerZoomState;
|
|
329
|
-
subscribe?: (listener: () => void) => () => void;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* AI 友好能力配置。
|
|
333
|
-
*
|
|
334
|
-
* 预览器本身不内置云端模型调用;这里提供可选文本切片结构,业务侧可以
|
|
335
|
-
* 基于 `getDocumentTextChunks()` 做向量化、溯源、AI 摘要和命中高亮。
|
|
336
|
-
*/
|
|
337
|
-
export interface FileViewerAiOptions {
|
|
338
|
-
enabled?: boolean;
|
|
339
|
-
collectText?: boolean;
|
|
340
|
-
maxTextLength?: number;
|
|
341
|
-
chunkSize?: number;
|
|
342
|
-
chunkOverlap?: number;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* 预览器主题模式。
|
|
346
|
-
*
|
|
347
|
-
* `system` 是默认值,会继续跟随浏览器 `prefers-color-scheme`;
|
|
348
|
-
* 浅色业务系统即使运行在深色操作系统中,也可以显式传 `light`
|
|
349
|
-
* 锁定预览区、工具栏和支持主题切换的渲染器为浅色。
|
|
350
|
-
*/
|
|
351
|
-
export type FileViewerThemeMode = 'light' | 'dark' | 'system';
|
|
352
|
-
export type FileViewerSourceType = 'file' | 'url' | 'empty';
|
|
353
|
-
export type FileViewerLifecyclePhase = 'load-start' | 'load-complete' | 'unload-start' | 'unload-complete';
|
|
354
|
-
export interface FileViewerLifecycleContext {
|
|
355
|
-
phase: FileViewerLifecyclePhase;
|
|
356
|
-
type: string;
|
|
357
|
-
filename: string;
|
|
358
|
-
source: FileViewerSourceType;
|
|
359
|
-
url?: string;
|
|
360
|
-
file?: File;
|
|
361
|
-
size?: number;
|
|
362
|
-
version: number;
|
|
363
|
-
timestamp: number;
|
|
364
|
-
duration?: number;
|
|
365
|
-
reason?: 'replace' | 'reset' | 'component-unmount';
|
|
366
|
-
}
|
|
367
|
-
export interface FileViewerLifecycleHooks {
|
|
368
|
-
onLoadStart?: (context: FileViewerLifecycleContext) => void | Promise<void>;
|
|
369
|
-
onLoadComplete?: (context: FileViewerLifecycleContext) => void | Promise<void>;
|
|
370
|
-
onUnloadStart?: (context: FileViewerLifecycleContext) => void | Promise<void>;
|
|
371
|
-
onUnloadComplete?: (context: FileViewerLifecycleContext) => void | Promise<void>;
|
|
372
|
-
}
|
|
373
|
-
export type FileViewerOperationType = 'download' | 'print' | 'export-html' | 'zoom-in' | 'zoom-out' | 'zoom-reset';
|
|
374
|
-
/**
|
|
375
|
-
* 当前文档对内置操作的真实可用性。
|
|
376
|
-
*
|
|
377
|
-
* `toolbar` 只表达宿主想不想展示某个按钮;这里表达当前文件类型和渲染器
|
|
378
|
-
* 是否真的能稳定完成该操作。尤其是打印,虚拟表格、播放器、3D 画布、
|
|
379
|
-
* EPUB iframe 等链路无法保证完整分页输出时会主动关闭。
|
|
380
|
-
*/
|
|
381
|
-
export interface FileViewerOperationAvailability {
|
|
382
|
-
download: boolean;
|
|
383
|
-
print: boolean;
|
|
384
|
-
exportHtml: boolean;
|
|
385
|
-
/**
|
|
386
|
-
* 当前渲染链路是否提供内部缩放能力。
|
|
387
|
-
*/
|
|
388
|
-
zoom: boolean;
|
|
389
|
-
zoomIn: boolean;
|
|
390
|
-
zoomOut: boolean;
|
|
391
|
-
zoomReset: boolean;
|
|
392
|
-
}
|
|
393
|
-
export interface FileViewerOperationContext extends Omit<FileViewerLifecycleContext, 'phase'> {
|
|
394
|
-
operation: FileViewerOperationType;
|
|
395
|
-
label: string;
|
|
396
|
-
}
|
|
397
|
-
export type FileViewerBeforeOperation = (context: FileViewerOperationContext) => boolean | void | Promise<boolean | void>;
|
|
398
|
-
/**
|
|
399
|
-
* 预览器通用配置。
|
|
400
|
-
*/
|
|
401
|
-
export interface FileViewerOptions {
|
|
402
|
-
/**
|
|
403
|
-
* 预览器主题。默认 `system`,即跟随浏览器 `prefers-color-scheme`。
|
|
404
|
-
* 业务系统已有固定浅色/深色 UI 时,建议显式传 `light` 或 `dark`,
|
|
405
|
-
* 避免部分渲染器在系统深色模式下自动切换后和宿主视觉不一致。
|
|
406
|
-
*/
|
|
407
|
-
theme?: FileViewerThemeMode;
|
|
408
|
-
watermark?: boolean | FileViewerWatermarkOptions;
|
|
409
|
-
toolbar?: boolean | FileViewerToolbarOptions;
|
|
410
|
-
/**
|
|
411
|
-
* 文档搜索能力配置。设为 `false` 可关闭内置搜索/高亮扫描;
|
|
412
|
-
* 默认启用公开 API,业务 UI 可通过组件 ref 调用 `searchDocument()`。
|
|
413
|
-
*/
|
|
414
|
-
search?: boolean | FileViewerSearchOptions;
|
|
415
|
-
/**
|
|
416
|
-
* AI 友好能力配置。预览器只提供文本切片、锚点和溯源上下文,不绑定模型服务。
|
|
417
|
-
*/
|
|
418
|
-
ai?: boolean | FileViewerAiOptions;
|
|
419
|
-
archive?: FileViewerArchiveOptions;
|
|
420
|
-
pdf?: FileViewerPdfOptions;
|
|
421
|
-
docx?: FileViewerDocxOptions;
|
|
422
|
-
typst?: FileViewerTypstOptions;
|
|
423
|
-
cad?: FileViewerCadOptions;
|
|
424
|
-
/**
|
|
425
|
-
* 文档加载/卸载生命周期钩子。直接使用 Vue 组件时可以传函数;
|
|
426
|
-
* iframe 集成时同名事件会通过 `postMessage` 向宿主发送。
|
|
427
|
-
*/
|
|
428
|
-
hooks?: FileViewerLifecycleHooks;
|
|
429
|
-
/**
|
|
430
|
-
* 内置操作按钮执行前的全局前置钩子。返回 `false` 时会取消本次操作。
|
|
431
|
-
*/
|
|
432
|
-
beforeOperation?: FileViewerBeforeOperation;
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* DOCX 渲染配置。
|
|
436
|
-
*
|
|
437
|
-
* 默认使用 Web Worker 承载 `docx-preview` 的 ZIP/XML 解析和 HTML 构建,
|
|
438
|
-
* 主线程只负责把最终 HTML 挂载到预览区并执行缩放、打印等交互适配。
|
|
439
|
-
* 这样可以保持 docxjs 的真实渲染结果,同时减少复杂 DOCX 首屏卡顿。
|
|
440
|
-
*/
|
|
441
|
-
export interface FileViewerDocxOptions {
|
|
442
|
-
/**
|
|
443
|
-
* 是否启用 DOCX Worker 渲染链路。默认开启。
|
|
444
|
-
* 极少数 CSP 或低版本浏览器不允许内联 Worker 时,可设为 `false`
|
|
445
|
-
* 回退到 docx-preview 原生主线程渲染。
|
|
446
|
-
*/
|
|
447
|
-
worker?: boolean;
|
|
448
|
-
/**
|
|
449
|
-
* 是否把 Worker 返回的 docx-preview HTML 按页面分批挂载。默认开启。
|
|
450
|
-
* 它不改变渲染器,只是避免一次性插入长文档 DOM 时阻塞首屏。
|
|
451
|
-
*/
|
|
452
|
-
progressive?: boolean;
|
|
453
|
-
/**
|
|
454
|
-
* DOCX Worker 最大等待时间,单位毫秒,默认 15000。
|
|
455
|
-
*
|
|
456
|
-
* 少量复杂 Word 文件会触发浏览器 Worker DOM 兼容边界,设置超时可以避免
|
|
457
|
-
* 永久停留在 loading;超时后仍会回到 docx-preview 原生主线程渲染。
|
|
458
|
-
* 传入 0 或负数可关闭超时保护。
|
|
459
|
-
*/
|
|
460
|
-
workerTimeout?: number;
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* 导出/打印模式。
|
|
464
|
-
*/
|
|
465
|
-
export type FileRenderExportMode = 'export' | 'print';
|
|
466
|
-
/**
|
|
467
|
-
* 渲染器自定义导出上下文。
|
|
468
|
-
*
|
|
469
|
-
* 大多数格式可以直接克隆当前 DOM;PDF 这类虚拟滚动或按需渲染格式
|
|
470
|
-
* 需要在打印前重新生成完整页面,因此允许渲染器注册专属适配器。
|
|
471
|
-
*/
|
|
472
|
-
export interface FileRenderExportOptions {
|
|
473
|
-
mode: FileRenderExportMode;
|
|
474
|
-
title: string;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* 渲染器专属导出适配器。
|
|
478
|
-
*/
|
|
479
|
-
export interface FileRenderExportAdapter {
|
|
480
|
-
/**
|
|
481
|
-
* 当前渲染器是否允许打印。未设置时由文件类型能力矩阵兜底判断。
|
|
482
|
-
*/
|
|
483
|
-
print?: boolean;
|
|
484
|
-
/**
|
|
485
|
-
* 当前渲染器是否允许导出渲染后的 HTML。
|
|
486
|
-
*/
|
|
487
|
-
exportHtml?: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* 是否把当前页面的全局 style/link 一并带进导出窗口。
|
|
490
|
-
*
|
|
491
|
-
* 专属分页适配器通常会自行输出必要样式,应关闭该项,避免宿主应用的
|
|
492
|
-
* `height: 100vh`、`overflow: hidden` 等布局样式干扰浏览器分页打印。
|
|
493
|
-
*/
|
|
494
|
-
includeDocumentStyles?: boolean;
|
|
495
|
-
beforeSnapshot?: () => Promise<void> | void;
|
|
496
|
-
/**
|
|
497
|
-
* 打印专用样式。适合 PDF / Word 等有真实页面尺寸的格式输出 `@page size`,
|
|
498
|
-
* 避免浏览器默认纸张或外层容器把页面缩放、裁切。
|
|
499
|
-
*/
|
|
500
|
-
printStyle?: string | ((options: FileRenderExportOptions) => Promise<string> | string);
|
|
501
|
-
toHtml?: (options: FileRenderExportOptions) => Promise<string> | string;
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* 渲染器可选上下文。
|
|
505
|
-
*
|
|
506
|
-
* 部分格式需要知道原始 URL 的目录,例如 glTF / DAE / FBX 会继续加载
|
|
507
|
-
* 同目录的贴图、bin 或材质文件。没有这些上下文时,渲染器仍应尽力预览
|
|
508
|
-
* 单文件内容,并在资源缺失时给出明确错误。
|
|
509
|
-
*/
|
|
510
|
-
export interface FileRenderContext {
|
|
511
|
-
filename?: string;
|
|
512
|
-
url?: string;
|
|
513
|
-
/**
|
|
514
|
-
* 渲染器可以直接读取的远端 URL。当前主要给 PDF.js 使用,
|
|
515
|
-
* 让同源 PDF 不必先整包下载为 Blob,就可以边拉取边建页。
|
|
516
|
-
*/
|
|
517
|
-
streamUrl?: string;
|
|
518
|
-
options?: FileViewerOptions;
|
|
519
|
-
registerExportAdapter?: (adapter: FileRenderExportAdapter | null) => void;
|
|
520
|
-
/**
|
|
521
|
-
* 渲染器已经写入可读的渐进式内容,但完整高保真渲染仍在继续。
|
|
522
|
-
* 主入口收到后可以先露出内容,避免用户长时间只看到 Loading。
|
|
523
|
-
*/
|
|
524
|
-
onProgressiveRender?: () => void;
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* 文件处理逻辑,用于声明具体格式的异步渲染器。
|
|
528
|
-
*
|
|
529
|
-
* 渲染器只在命中文件扩展名时被按需加载,避免 PDF、OFD、Typst、压缩包、
|
|
530
|
-
* 邮件、CAD、3D、Office 等重型依赖进入无关格式的首屏路径。
|
|
531
|
-
*
|
|
532
|
-
* @param buffer 二进制缓存
|
|
533
|
-
* @param target 目标dom
|
|
534
|
-
* @param type 目标扩展名。部分渲染器会用它选择语言、容错策略或格式提示。
|
|
535
|
-
* @param context 原始文件名、远端 URL 等补充上下文。
|
|
536
|
-
*/
|
|
537
|
-
export type FileHandler = (buffer: ArrayBuffer, target: HTMLDivElement, type?: string, context?: FileRenderContext) => Promise<Rendered>;
|
|
538
|
-
/**
|
|
539
|
-
* 文件处理器组合。
|
|
540
|
-
*/
|
|
541
|
-
export interface FileHandlerComposite {
|
|
542
|
-
accepts: Array<string>;
|
|
543
|
-
handler: FileHandler;
|
|
544
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
type ReadResult = string | ArrayBuffer | undefined | null;
|
|
2
|
-
export declare function readBuffer(file: File): Promise<ReadResult>;
|
|
3
|
-
export declare function readDataURL(buffer: ArrayBuffer): Promise<string>;
|
|
4
|
-
export declare function readText(buffer: ArrayBuffer): Promise<string>;
|
|
5
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type WorkerProvider = () => Worker;
|
|
2
|
-
export interface WorkerRef {
|
|
3
|
-
worker: Worker | null;
|
|
4
|
-
defaults(provider: WorkerProvider): Worker;
|
|
5
|
-
}
|
|
6
|
-
export default class WorkerRefImpl implements WorkerRef {
|
|
7
|
-
worker: Worker | null;
|
|
8
|
-
constructor(worker: Worker | null);
|
|
9
|
-
defaults(provider: WorkerProvider): Worker;
|
|
10
|
-
}
|
|
11
|
-
export declare function refWorker(_name: string, _module?: boolean): WorkerRef;
|
|
12
|
-
export {};
|