@l1yp/file-viewer 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 +134 -0
- package/dist/FileViewer.js +7 -0
- package/dist/FileViewer.vue.d.ts +37 -0
- package/dist/FileViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/AppxViewer.js +7 -0
- package/dist/components/AppxViewer.vue.d.ts +18 -0
- package/dist/components/AppxViewer.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/ArchiveBrowser.js +7 -0
- package/dist/components/ArchiveBrowser.vue.d.ts +18 -0
- package/dist/components/ArchiveBrowser.vue_vue_type_script_setup_true_lang.js +279 -0
- package/dist/components/AudioViewer.js +7 -0
- package/dist/components/AudioViewer.vue.d.ts +21 -0
- package/dist/components/AudioViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/BinObjBrowser.js +7 -0
- package/dist/components/BinObjBrowser.vue.d.ts +19 -0
- package/dist/components/BinObjBrowser.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/CertViewer.js +7 -0
- package/dist/components/CertViewer.vue.d.ts +17 -0
- package/dist/components/CertViewer.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/ClassViewer.js +7 -0
- package/dist/components/ClassViewer.vue.d.ts +15 -0
- package/dist/components/ClassViewer.vue_vue_type_script_setup_true_lang.js +164 -0
- package/dist/components/CodeBlock.js +7 -0
- package/dist/components/CodeBlock.vue.d.ts +17 -0
- package/dist/components/CodeBlock.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/CodeView.js +7 -0
- package/dist/components/CodeView.vue.d.ts +21 -0
- package/dist/components/CodeView.vue_vue_type_script_setup_true_lang.js +180 -0
- package/dist/components/CsvViewer.js +7 -0
- package/dist/components/CsvViewer.vue.d.ts +26 -0
- package/dist/components/CsvViewer.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/DicomViewer.js +7 -0
- package/dist/components/DicomViewer.vue.d.ts +30 -0
- package/dist/components/DicomViewer.vue_vue_type_script_setup_true_lang.js +362 -0
- package/dist/components/DocxViewer.js +7 -0
- package/dist/components/DocxViewer.vue.d.ts +19 -0
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/DrawioViewer.js +7 -0
- package/dist/components/DrawioViewer.vue.d.ts +16 -0
- package/dist/components/DrawioViewer.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/DxfViewer.js +7 -0
- package/dist/components/DxfViewer.vue.d.ts +14 -0
- package/dist/components/DxfViewer.vue_vue_type_script_setup_true_lang.js +239 -0
- package/dist/components/EbookViewer.js +7 -0
- package/dist/components/EbookViewer.vue.d.ts +22 -0
- package/dist/components/EbookViewer.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/EmlViewer.js +7 -0
- package/dist/components/EmlViewer.vue.d.ts +21 -0
- package/dist/components/EmlViewer.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/components/EplViewer.js +7 -0
- package/dist/components/EplViewer.vue.d.ts +19 -0
- package/dist/components/EplViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/FileViewerBody.js +7 -0
- package/dist/components/FileViewerBody.vue.d.ts +47 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +599 -0
- package/dist/components/FileViewerPanel.js +7 -0
- package/dist/components/FileViewerPanel.vue.d.ts +3 -0
- package/dist/components/FileViewerPanel.vue_vue_type_script_setup_true_lang.js +207 -0
- package/dist/components/FontViewer.js +7 -0
- package/dist/components/FontViewer.vue.d.ts +17 -0
- package/dist/components/FontViewer.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/FrontmatterCard.js +7 -0
- package/dist/components/FrontmatterCard.vue.d.ts +11 -0
- package/dist/components/FrontmatterCard.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/GeoViewer.js +7 -0
- package/dist/components/GeoViewer.vue.d.ts +17 -0
- package/dist/components/GeoViewer.vue_vue_type_script_setup_true_lang.js +255 -0
- package/dist/components/HarViewer.js +7 -0
- package/dist/components/HarViewer.vue.d.ts +20 -0
- package/dist/components/HarViewer.vue_vue_type_script_setup_true_lang.js +322 -0
- package/dist/components/HexViewer.js +7 -0
- package/dist/components/HexViewer.vue.d.ts +22 -0
- package/dist/components/HexViewer.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/HprofViewer.js +7 -0
- package/dist/components/HprofViewer.vue.d.ts +27 -0
- package/dist/components/HprofViewer.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/ImageLightbox.js +7 -0
- package/dist/components/ImageLightbox.vue.d.ts +3 -0
- package/dist/components/ImageLightbox.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/InlineText.d.ts +29 -0
- package/dist/components/InlineText.js +21 -0
- package/dist/components/JksViewer.js +7 -0
- package/dist/components/JksViewer.vue.d.ts +22 -0
- package/dist/components/JksViewer.vue_vue_type_script_setup_true_lang.js +353 -0
- package/dist/components/JsonlViewer.js +7 -0
- package/dist/components/JsonlViewer.vue.d.ts +15 -0
- package/dist/components/JsonlViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/LogViewer.js +7 -0
- package/dist/components/LogViewer.vue.d.ts +29 -0
- package/dist/components/LogViewer.vue_vue_type_script_setup_true_lang.js +670 -0
- package/dist/components/LrcViewer.js +7 -0
- package/dist/components/LrcViewer.vue.d.ts +17 -0
- package/dist/components/LrcViewer.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/MarkdownTable.js +7 -0
- package/dist/components/MarkdownTable.vue.d.ts +19 -0
- package/dist/components/MarkdownTable.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/MarkdownText.d.ts +30 -0
- package/dist/components/MarkdownText.js +21 -0
- package/dist/components/MhtViewer.js +7 -0
- package/dist/components/MhtViewer.vue.d.ts +22 -0
- package/dist/components/MhtViewer.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/MindMapView.js +7 -0
- package/dist/components/MindMapView.vue.d.ts +23 -0
- package/dist/components/MindMapView.vue_vue_type_script_setup_true_lang.js +337 -0
- package/dist/components/MissingDependency.js +7 -0
- package/dist/components/MissingDependency.vue.d.ts +17 -0
- package/dist/components/MissingDependency.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/ModelViewer.js +7 -0
- package/dist/components/ModelViewer.vue.d.ts +18 -0
- package/dist/components/ModelViewer.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/MsiViewer.js +7 -0
- package/dist/components/MsiViewer.vue.d.ts +19 -0
- package/dist/components/MsiViewer.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/components/NotebookViewer.js +7 -0
- package/dist/components/NotebookViewer.vue.d.ts +20 -0
- package/dist/components/NotebookViewer.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/PdfViewer.js +7 -0
- package/dist/components/PdfViewer.vue.d.ts +19 -0
- package/dist/components/PdfViewer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/PptxViewer.js +7 -0
- package/dist/components/PptxViewer.vue.d.ts +20 -0
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/PsdViewer.js +7 -0
- package/dist/components/PsdViewer.vue.d.ts +15 -0
- package/dist/components/PsdViewer.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/QmcAudioViewer.js +7 -0
- package/dist/components/QmcAudioViewer.vue.d.ts +18 -0
- package/dist/components/QmcAudioViewer.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/RasterViewer.js +7 -0
- package/dist/components/RasterViewer.vue.d.ts +21 -0
- package/dist/components/RasterViewer.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/RtfViewer.js +7 -0
- package/dist/components/RtfViewer.vue.d.ts +21 -0
- package/dist/components/RtfViewer.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/SevenZipBrowser.js +7 -0
- package/dist/components/SevenZipBrowser.vue.d.ts +13 -0
- package/dist/components/SevenZipBrowser.vue_vue_type_script_setup_true_lang.js +366 -0
- package/dist/components/SqliteViewer.js +7 -0
- package/dist/components/SqliteViewer.vue.d.ts +18 -0
- package/dist/components/SqliteViewer.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/SubtitleViewer.js +7 -0
- package/dist/components/SubtitleViewer.vue.d.ts +15 -0
- package/dist/components/SubtitleViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/XlsxChart.js +7 -0
- package/dist/components/XlsxChart.vue.d.ts +14 -0
- package/dist/components/XlsxChart.vue_vue_type_script_setup_true_lang.js +240 -0
- package/dist/components/XlsxViewer.js +7 -0
- package/dist/components/XlsxViewer.vue.d.ts +22 -0
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +814 -0
- package/dist/components/XmindViewer.js +7 -0
- package/dist/components/XmindViewer.vue.d.ts +13 -0
- package/dist/components/XmindViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/ZipBrowser.js +7 -0
- package/dist/components/ZipBrowser.vue.d.ts +14 -0
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +326 -0
- package/dist/components/ZoomImage.js +7 -0
- package/dist/components/ZoomImage.vue.d.ts +29 -0
- package/dist/components/ZoomImage.vue_vue_type_script_setup_true_lang.js +147 -0
- package/dist/components/epl/EplCodeBlock.js +7 -0
- package/dist/components/epl/EplCodeBlock.vue.d.ts +15 -0
- package/dist/components/epl/EplCodeBlock.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/epl/EplDoc.js +7 -0
- package/dist/components/epl/EplDoc.vue.d.ts +19 -0
- package/dist/components/epl/EplDoc.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/components/epl/EplMethod.js +7 -0
- package/dist/components/epl/EplMethod.vue.d.ts +14 -0
- package/dist/components/epl/EplMethod.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/epl/EplResource.js +7 -0
- package/dist/components/epl/EplResource.vue.d.ts +15 -0
- package/dist/components/epl/EplResource.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/epl/EplTree.js +7 -0
- package/dist/components/epl/EplTree.vue.d.ts +27 -0
- package/dist/components/epl/EplTree.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/epl/EplVarTable.js +7 -0
- package/dist/components/epl/EplVarTable.vue.d.ts +21 -0
- package/dist/components/epl/EplVarTable.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/epl/docTypes.d.ts +12 -0
- package/dist/components/epl/numbering.d.ts +21 -0
- package/dist/components/epl/numbering.js +14 -0
- package/dist/components/icons/Icon.js +7 -0
- package/dist/components/icons/Icon.vue.d.ts +14 -0
- package/dist/components/icons/Icon.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/icons/iconPaths.d.ts +60 -0
- package/dist/components/icons/iconPaths.js +54 -0
- package/dist/components/optionalViewer.d.ts +14 -0
- package/dist/components/optionalViewer.js +37 -0
- package/dist/components/ui/ClampBlock.d.ts +82 -0
- package/dist/components/ui/ClampBlock.js +63 -0
- package/dist/composables/useFileViewer.d.ts +428 -0
- package/dist/composables/useFileViewer.js +27 -0
- package/dist/composables/useLightbox.d.ts +33 -0
- package/dist/composables/useLightbox.js +17 -0
- package/dist/composables/useLogRules.d.ts +47 -0
- package/dist/composables/useLogRules.js +74 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +30 -0
- package/dist/lib/aes.d.ts +25 -0
- package/dist/lib/aes.js +99 -0
- package/dist/lib/appx.d.ts +66 -0
- package/dist/lib/appx.js +112 -0
- package/dist/lib/archive.d.ts +29 -0
- package/dist/lib/asn1.d.ts +47 -0
- package/dist/lib/asn1.js +122 -0
- package/dist/lib/binobj.d.ts +69 -0
- package/dist/lib/binobj.js +430 -0
- package/dist/lib/brotli.d.ts +14 -0
- package/dist/lib/brotli.js +16 -0
- package/dist/lib/bzip2.d.ts +14 -0
- package/dist/lib/bzip2.js +161 -0
- package/dist/lib/classfile.d.ts +72 -0
- package/dist/lib/classfile.js +210 -0
- package/dist/lib/codePreview.d.ts +22 -0
- package/dist/lib/codePreview.js +27 -0
- package/dist/lib/codefold.d.ts +14 -0
- package/dist/lib/codefold.js +30 -0
- package/dist/lib/codeformat.d.ts +21 -0
- package/dist/lib/codeformat.js +130 -0
- package/dist/lib/csv.d.ts +19 -0
- package/dist/lib/csv.js +74 -0
- package/dist/lib/des.d.ts +17 -0
- package/dist/lib/des.js +928 -0
- package/dist/lib/diagram.d.ts +5 -0
- package/dist/lib/diagram.js +479 -0
- package/dist/lib/dicom.d.ts +69 -0
- package/dist/lib/dicom.js +442 -0
- package/dist/lib/dicomCodecs.d.ts +28 -0
- package/dist/lib/dicomCodecs.js +156 -0
- package/dist/lib/dicomRender.d.ts +46 -0
- package/dist/lib/dicomRender.js +114 -0
- package/dist/lib/dxf.d.ts +86 -0
- package/dist/lib/dxf.js +399 -0
- package/dist/lib/eml.d.ts +40 -0
- package/dist/lib/eml.js +46 -0
- package/dist/lib/encoding.d.ts +28 -0
- package/dist/lib/encoding.js +44 -0
- package/dist/lib/epl/code/ast.d.ts +150 -0
- package/dist/lib/epl/code/codeDataParser.d.ts +3 -0
- package/dist/lib/epl/code/codeDataParser.js +330 -0
- package/dist/lib/epl/code/codeLines.d.ts +20 -0
- package/dist/lib/epl/code/codeLines.js +191 -0
- package/dist/lib/epl/code/structures.d.ts +86 -0
- package/dist/lib/epl/code/textCode.d.ts +29 -0
- package/dist/lib/epl/code/textCode.js +150 -0
- package/dist/lib/epl/code/variable.d.ts +25 -0
- package/dist/lib/epl/eplDocument.d.ts +21 -0
- package/dist/lib/epl/eplDocument.js +36 -0
- package/dist/lib/epl/imageList.d.ts +28 -0
- package/dist/lib/epl/imageList.js +66 -0
- package/dist/lib/epl/index.d.ts +53 -0
- package/dist/lib/epl/index.js +45 -0
- package/dist/lib/epl/io/binaryReader.d.ts +56 -0
- package/dist/lib/epl/io/binaryReader.js +119 -0
- package/dist/lib/epl/io/encoding.d.ts +16 -0
- package/dist/lib/epl/io/encoding.js +27 -0
- package/dist/lib/epl/model/eplSystemId.d.ts +64 -0
- package/dist/lib/epl/model/eplSystemId.js +16 -0
- package/dist/lib/epl/model/section.d.ts +46 -0
- package/dist/lib/epl/names/eplLibData.js +39 -0
- package/dist/lib/epl/names/idToNameMap.d.ts +33 -0
- package/dist/lib/epl/names/idToNameMap.js +130 -0
- package/dist/lib/epl/names/libNameProvider.d.ts +15 -0
- package/dist/lib/epl/names/libNameProvider.js +18 -0
- package/dist/lib/epl/program.d.ts +120 -0
- package/dist/lib/epl/program.js +134 -0
- package/dist/lib/epl/projectFileReader.d.ts +23 -0
- package/dist/lib/epl/projectFileReader.js +65 -0
- package/dist/lib/epl/sections/code.d.ts +20 -0
- package/dist/lib/epl/sections/esystemInfo.d.ts +14 -0
- package/dist/lib/epl/sections/losable.d.ts +11 -0
- package/dist/lib/epl/sections/projectConfig.d.ts +23 -0
- package/dist/lib/epl/sections/resource.d.ts +57 -0
- package/dist/lib/fb2.d.ts +14 -0
- package/dist/lib/fb2.js +62 -0
- package/dist/lib/fileType.d.ts +315 -0
- package/dist/lib/fileType.js +800 -0
- package/dist/lib/fonts.d.ts +8 -0
- package/dist/lib/fonts.js +4 -0
- package/dist/lib/format.d.ts +16 -0
- package/dist/lib/format.js +38 -0
- package/dist/lib/frontmatter.d.ts +13 -0
- package/dist/lib/frontmatter.js +23 -0
- package/dist/lib/geo.d.ts +30 -0
- package/dist/lib/geo.js +235 -0
- package/dist/lib/har.d.ts +171 -0
- package/dist/lib/har.js +397 -0
- package/dist/lib/highlight.d.ts +18 -0
- package/dist/lib/highlight.js +34 -0
- package/dist/lib/highlightLangs.d.ts +15 -0
- package/dist/lib/highlightLangs.js +93 -0
- package/dist/lib/hprof.d.ts +211 -0
- package/dist/lib/hprof.js +709 -0
- package/dist/lib/ipynb.d.ts +48 -0
- package/dist/lib/ipynb.js +130 -0
- package/dist/lib/jks.d.ts +86 -0
- package/dist/lib/jks.js +167 -0
- package/dist/lib/jsonl.d.ts +29 -0
- package/dist/lib/jsonl.js +24 -0
- package/dist/lib/lrc.d.ts +32 -0
- package/dist/lib/lrc.js +84 -0
- package/dist/lib/lzma.d.ts +70 -0
- package/dist/lib/lzma.js +204 -0
- package/dist/lib/markdown/blocks.d.ts +9 -0
- package/dist/lib/markdown/blocks.js +221 -0
- package/dist/lib/markdown/index.d.ts +3 -0
- package/dist/lib/markdown/inline.d.ts +33 -0
- package/dist/lib/markdown/inline.js +84 -0
- package/dist/lib/markdown/math.d.ts +5 -0
- package/dist/lib/markdown/math.js +25 -0
- package/dist/lib/markdown/segmentize.d.ts +11 -0
- package/dist/lib/markdown/segmentize.js +28 -0
- package/dist/lib/markdown/styles.d.ts +26 -0
- package/dist/lib/markdown/styles.js +135 -0
- package/dist/lib/mht.d.ts +51 -0
- package/dist/lib/mht.js +122 -0
- package/dist/lib/midi.d.ts +28 -0
- package/dist/lib/midi.js +84 -0
- package/dist/lib/mime.d.ts +82 -0
- package/dist/lib/mime.js +151 -0
- package/dist/lib/mindmap.d.ts +51 -0
- package/dist/lib/mindmap.js +113 -0
- package/dist/lib/mobi.d.ts +15 -0
- package/dist/lib/mobi.js +68 -0
- package/dist/lib/msi.d.ts +50 -0
- package/dist/lib/msi.js +332 -0
- package/dist/lib/optionalDep.d.ts +26 -0
- package/dist/lib/optionalDep.js +20 -0
- package/dist/lib/pkcs12.d.ts +56 -0
- package/dist/lib/pkcs12.js +356 -0
- package/dist/lib/qmc.d.ts +50 -0
- package/dist/lib/qmc.js +213 -0
- package/dist/lib/rar.d.ts +16 -0
- package/dist/lib/rar.js +40 -0
- package/dist/lib/rawPreview.d.ts +12 -0
- package/dist/lib/rawPreview.js +54 -0
- package/dist/lib/rc2.d.ts +12 -0
- package/dist/lib/rc2.js +298 -0
- package/dist/lib/resolveInput.d.ts +22 -0
- package/dist/lib/resolveInput.js +55 -0
- package/dist/lib/rtf.d.ts +53 -0
- package/dist/lib/rtf.js +413 -0
- package/dist/lib/sevenZip.d.ts +82 -0
- package/dist/lib/sevenZip.js +395 -0
- package/dist/lib/sha1.d.ts +24 -0
- package/dist/lib/sha1.js +53 -0
- package/dist/lib/sha256.d.ts +21 -0
- package/dist/lib/sha256.js +119 -0
- package/dist/lib/speechAudio.d.ts +36 -0
- package/dist/lib/speechAudio.js +85 -0
- package/dist/lib/sqlite.d.ts +38 -0
- package/dist/lib/sqlite.js +104 -0
- package/dist/lib/subtitle.d.ts +26 -0
- package/dist/lib/subtitle.js +99 -0
- package/dist/lib/tarball.d.ts +20 -0
- package/dist/lib/tarball.js +248 -0
- package/dist/lib/viewerFormats.d.ts +35 -0
- package/dist/lib/viewerFormats.js +83 -0
- package/dist/lib/viewerKind.d.ts +36 -0
- package/dist/lib/viewerKind.js +233 -0
- package/dist/lib/x509.d.ts +68 -0
- package/dist/lib/x509.js +267 -0
- package/dist/lib/xlsx.d.ts +55 -0
- package/dist/lib/xlsx.js +321 -0
- package/dist/lib/xlsxCharts.d.ts +34 -0
- package/dist/lib/xlsxCharts.js +152 -0
- package/dist/lib/xmind.d.ts +6 -0
- package/dist/lib/xmind.js +124 -0
- package/dist/lib/zip.d.ts +56 -0
- package/dist/lib/zip.js +169 -0
- package/dist/style.css +2 -0
- package/dist/types.d.ts +42 -0
- package/package.json +128 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font-stack references for inline style objects (render functions).
|
|
3
|
+
* They point at the CSS custom properties declared in tokens.css, so there is a
|
|
4
|
+
* single source of truth and they stay theme-agnostic.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SERIF = "var(--font-serif)";
|
|
7
|
+
export declare const SANS = "var(--font-sans)";
|
|
8
|
+
export declare const MONO = "var(--font-mono)";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Minimal span shape (start/stop as parseable date strings) — kept local so the package carries no app types. */
|
|
2
|
+
export interface TimelineSpan {
|
|
3
|
+
start?: string | null;
|
|
4
|
+
stop?: string | null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Format the wall-clock span of a reasoning run (earliest start → latest stop)
|
|
8
|
+
* as "12s" / "1m 5s". Mirrors the old component's fmtDur.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatDuration(items: TimelineSpan[]): string;
|
|
11
|
+
/** Compact local date-time for listings: "2026-06-20 14:03". Empty when the timestamp is missing/zero. */
|
|
12
|
+
export declare function formatDateTime(ms: number | null | undefined): string;
|
|
13
|
+
/** Human-readable byte size: "512 B" / "1.4 KB" / "2.3 MB" (one decimal). */
|
|
14
|
+
export declare function formatBytes(n: number | null | undefined): string;
|
|
15
|
+
/** Coarser size used for attachment chips: KB rounded to whole numbers. */
|
|
16
|
+
export declare function formatSizeCoarse(n: number | null | undefined): string | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/lib/format.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
try {
|
|
4
|
+
let t = null, n = null;
|
|
5
|
+
for (let r of e ?? []) {
|
|
6
|
+
if (r.start) {
|
|
7
|
+
let e = Date.parse(r.start);
|
|
8
|
+
!Number.isNaN(e) && (t === null || e < t) && (t = e);
|
|
9
|
+
}
|
|
10
|
+
if (r.stop) {
|
|
11
|
+
let e = Date.parse(r.stop);
|
|
12
|
+
!Number.isNaN(e) && (n === null || e > n) && (n = e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (t === null || n === null || n < t) return "";
|
|
16
|
+
let r = Math.max(1, Math.round((n - t) / 1e3));
|
|
17
|
+
if (r < 60) return `${r}s`;
|
|
18
|
+
let i = Math.floor(r / 60), a = r % 60;
|
|
19
|
+
return a ? `${i}m ${a}s` : `${i}m`;
|
|
20
|
+
} catch {
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function t(e) {
|
|
25
|
+
if (!e) return "";
|
|
26
|
+
let t = new Date(e);
|
|
27
|
+
if (Number.isNaN(t.getTime())) return "";
|
|
28
|
+
let n = (e) => String(e).padStart(2, "0");
|
|
29
|
+
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`;
|
|
30
|
+
}
|
|
31
|
+
function n(e) {
|
|
32
|
+
return e == null ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
33
|
+
}
|
|
34
|
+
function r(e) {
|
|
35
|
+
return e == null ? null : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as formatBytes, t as formatDateTime, e as formatDuration, r as formatSizeCoarse };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split leading YAML frontmatter (a `---` … `---` block at the very top, as used by
|
|
3
|
+
* SKILL.md and friends) from the markdown body.
|
|
4
|
+
*
|
|
5
|
+
* `data` is the parsed mapping (empty when there's no frontmatter or it's malformed /
|
|
6
|
+
* not a mapping); `body` is the rest of the document with the block removed. On any
|
|
7
|
+
* parse failure we fall back to `{ data: {}, body: <original text> }` so nothing is lost.
|
|
8
|
+
*/
|
|
9
|
+
export interface ParsedFrontmatter {
|
|
10
|
+
data: Record<string, unknown>;
|
|
11
|
+
body: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseFrontmatter(input: string): ParsedFrontmatter;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { load as e } from "js-yaml";
|
|
2
|
+
//#region src/lib/frontmatter.ts
|
|
3
|
+
var t = /^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/;
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = n.charCodeAt(0) === 65279 ? n.slice(1) : n, i = r.match(t);
|
|
6
|
+
if (!i) return {
|
|
7
|
+
data: {},
|
|
8
|
+
body: r
|
|
9
|
+
};
|
|
10
|
+
try {
|
|
11
|
+
let t = e(i[1]);
|
|
12
|
+
if (t && typeof t == "object" && !Array.isArray(t)) return {
|
|
13
|
+
data: t,
|
|
14
|
+
body: r.slice(i[0].length)
|
|
15
|
+
};
|
|
16
|
+
} catch {}
|
|
17
|
+
return {
|
|
18
|
+
data: {},
|
|
19
|
+
body: r
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as parseFrontmatter };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-rolled, zero-dependency parser for the three common geodata formats, normalized to a flat feature
|
|
3
|
+
* list the side viewer can draw as an offline SVG map (no tile server — internal network):
|
|
4
|
+
* - GeoJSON (.geojson/.json): FeatureCollection / Feature / bare geometry; all geometry types incl. Multi* +
|
|
5
|
+
* GeometryCollection. Positions are [lon, lat(, alt)].
|
|
6
|
+
* - KML (.kml): <Placemark> with Point / LineString / Polygon (incl. inside MultiGeometry); `lon,lat,alt`
|
|
7
|
+
* whitespace-separated coordinate tuples.
|
|
8
|
+
* - GPX (.gpx): <wpt> waypoints (points), <rte>/<rtept> routes and <trk>/<trkseg>/<trkpt> tracks (lines);
|
|
9
|
+
* coordinates are `lat`/`lon` attributes.
|
|
10
|
+
*
|
|
11
|
+
* Each geometry is reduced to point / line / polygon primitives (polygon = outer ring only — holes are
|
|
12
|
+
* dropped for the preview). Positions stay as [lon, lat]; the viewer owns the map projection.
|
|
13
|
+
*/
|
|
14
|
+
export type GeoKind = 'point' | 'line' | 'polygon';
|
|
15
|
+
export interface GeoGeom {
|
|
16
|
+
kind: GeoKind;
|
|
17
|
+
/** [lon, lat] positions: point → 1, line → N, polygon → its outer ring. */
|
|
18
|
+
coords: [number, number][];
|
|
19
|
+
}
|
|
20
|
+
export interface GeoFeature {
|
|
21
|
+
name: string;
|
|
22
|
+
geoms: GeoGeom[];
|
|
23
|
+
props: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export interface ParsedGeo {
|
|
26
|
+
format: 'geojson' | 'kml' | 'gpx';
|
|
27
|
+
features: GeoFeature[];
|
|
28
|
+
}
|
|
29
|
+
/** Parse geodata source text into a normalized feature list. `ext` (when known) disambiguates the format. */
|
|
30
|
+
export declare function parseGeo(text: string, ext?: string): ParsedGeo;
|
package/dist/lib/geo.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
//#region src/lib/geo.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return Array.isArray(e) && typeof e[0] == "number" && typeof e[1] == "number" && Number.isFinite(e[0]) && Number.isFinite(e[1]);
|
|
4
|
+
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
return e(t) ? [t[0], t[1]] : null;
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
if (!Array.isArray(e)) return [];
|
|
10
|
+
let n = [];
|
|
11
|
+
for (let r of e) {
|
|
12
|
+
let e = t(r);
|
|
13
|
+
e && n.push(e);
|
|
14
|
+
}
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function r(e, i) {
|
|
18
|
+
if (typeof e != "object" || !e) return;
|
|
19
|
+
let a = e, o = a.coordinates;
|
|
20
|
+
switch (a.type) {
|
|
21
|
+
case "Point": {
|
|
22
|
+
let e = t(o);
|
|
23
|
+
e && i.push({
|
|
24
|
+
kind: "point",
|
|
25
|
+
coords: [e]
|
|
26
|
+
});
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case "MultiPoint":
|
|
30
|
+
for (let e of n(o)) i.push({
|
|
31
|
+
kind: "point",
|
|
32
|
+
coords: [e]
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
case "LineString": {
|
|
36
|
+
let e = n(o);
|
|
37
|
+
e.length && i.push({
|
|
38
|
+
kind: "line",
|
|
39
|
+
coords: e
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "MultiLineString":
|
|
44
|
+
if (Array.isArray(o)) for (let e of o) {
|
|
45
|
+
let t = n(e);
|
|
46
|
+
t.length && i.push({
|
|
47
|
+
kind: "line",
|
|
48
|
+
coords: t
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "Polygon": {
|
|
53
|
+
let e = Array.isArray(o) ? n(o[0]) : [];
|
|
54
|
+
e.length && i.push({
|
|
55
|
+
kind: "polygon",
|
|
56
|
+
coords: e
|
|
57
|
+
});
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
case "MultiPolygon":
|
|
61
|
+
if (Array.isArray(o)) for (let e of o) {
|
|
62
|
+
let t = Array.isArray(e) ? n(e[0]) : [];
|
|
63
|
+
t.length && i.push({
|
|
64
|
+
kind: "polygon",
|
|
65
|
+
coords: t
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "GeometryCollection":
|
|
70
|
+
if (Array.isArray(a.geometries)) for (let e of a.geometries) r(e, i);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function i(e) {
|
|
75
|
+
let t = {}, n = "";
|
|
76
|
+
if (typeof e == "object" && e) {
|
|
77
|
+
for (let [n, r] of Object.entries(e)) r == null || typeof r == "object" || (t[n] = String(r));
|
|
78
|
+
n = t.name || t.Name || t.NAME || t.title || t.Title || "";
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
name: n,
|
|
82
|
+
props: t
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function a(e) {
|
|
86
|
+
let t = JSON.parse(e), n = [], a = (e) => {
|
|
87
|
+
if (typeof e != "object" || !e) return;
|
|
88
|
+
let t = e;
|
|
89
|
+
if (t.type === "FeatureCollection" && Array.isArray(t.features)) for (let e of t.features) a(e);
|
|
90
|
+
else if (t.type === "Feature") {
|
|
91
|
+
let e = [];
|
|
92
|
+
r(t.geometry, e);
|
|
93
|
+
let { name: a, props: o } = i(t.properties);
|
|
94
|
+
e.length && n.push({
|
|
95
|
+
name: a,
|
|
96
|
+
geoms: e,
|
|
97
|
+
props: o
|
|
98
|
+
});
|
|
99
|
+
} else if (typeof t.type == "string") {
|
|
100
|
+
let e = [];
|
|
101
|
+
r(t, e), e.length && n.push({
|
|
102
|
+
name: "",
|
|
103
|
+
geoms: e,
|
|
104
|
+
props: {}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return a(t), n;
|
|
109
|
+
}
|
|
110
|
+
function o(e) {
|
|
111
|
+
if (typeof DOMParser > "u") return null;
|
|
112
|
+
let t = new DOMParser().parseFromString(e, "application/xml");
|
|
113
|
+
return t.getElementsByTagName("parsererror").length ? null : t;
|
|
114
|
+
}
|
|
115
|
+
function s(e, t) {
|
|
116
|
+
for (let n of Array.from(e.children)) if (n.tagName.toLowerCase() === t.toLowerCase()) return (n.textContent || "").trim();
|
|
117
|
+
return "";
|
|
118
|
+
}
|
|
119
|
+
function c(e) {
|
|
120
|
+
let t = [];
|
|
121
|
+
for (let n of e.trim().split(/\s+/)) {
|
|
122
|
+
if (!n) continue;
|
|
123
|
+
let e = n.split(","), r = parseFloat(e[0]), i = parseFloat(e[1]);
|
|
124
|
+
Number.isFinite(r) && Number.isFinite(i) && t.push([r, i]);
|
|
125
|
+
}
|
|
126
|
+
return t;
|
|
127
|
+
}
|
|
128
|
+
function l(e) {
|
|
129
|
+
let t = o(e);
|
|
130
|
+
if (!t) return [];
|
|
131
|
+
let n = [];
|
|
132
|
+
for (let e of Array.from(t.getElementsByTagName("Placemark"))) {
|
|
133
|
+
let t = [];
|
|
134
|
+
for (let n of Array.from(e.getElementsByTagName("Point"))) {
|
|
135
|
+
let e = c(s(n, "coordinates"));
|
|
136
|
+
e[0] && t.push({
|
|
137
|
+
kind: "point",
|
|
138
|
+
coords: [e[0]]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
for (let n of Array.from(e.getElementsByTagName("LineString"))) {
|
|
142
|
+
let e = c(s(n, "coordinates"));
|
|
143
|
+
e.length && t.push({
|
|
144
|
+
kind: "line",
|
|
145
|
+
coords: e
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
for (let n of Array.from(e.getElementsByTagName("Polygon"))) {
|
|
149
|
+
let e = (n.getElementsByTagName("outerBoundaryIs")[0] ?? n).getElementsByTagName("coordinates")[0], r = c(e?.textContent || "");
|
|
150
|
+
r.length && t.push({
|
|
151
|
+
kind: "polygon",
|
|
152
|
+
coords: r
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (t.length) {
|
|
156
|
+
let r = s(e, "name"), i = s(e, "description"), a = {};
|
|
157
|
+
i && (a.description = i), n.push({
|
|
158
|
+
name: r,
|
|
159
|
+
geoms: t,
|
|
160
|
+
props: a
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return n;
|
|
165
|
+
}
|
|
166
|
+
function u(e) {
|
|
167
|
+
let t = parseFloat(e.getAttribute("lat") || ""), n = parseFloat(e.getAttribute("lon") || "");
|
|
168
|
+
return Number.isFinite(t) && Number.isFinite(n) ? [n, t] : null;
|
|
169
|
+
}
|
|
170
|
+
function d(e) {
|
|
171
|
+
let t = o(e);
|
|
172
|
+
if (!t) return [];
|
|
173
|
+
let n = [];
|
|
174
|
+
for (let e of Array.from(t.getElementsByTagName("wpt"))) {
|
|
175
|
+
let t = u(e);
|
|
176
|
+
t && n.push({
|
|
177
|
+
name: s(e, "name"),
|
|
178
|
+
geoms: [{
|
|
179
|
+
kind: "point",
|
|
180
|
+
coords: [t]
|
|
181
|
+
}],
|
|
182
|
+
props: {}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
for (let e of Array.from(t.getElementsByTagName("rte"))) {
|
|
186
|
+
let t = [];
|
|
187
|
+
for (let n of Array.from(e.getElementsByTagName("rtept"))) {
|
|
188
|
+
let e = u(n);
|
|
189
|
+
e && t.push(e);
|
|
190
|
+
}
|
|
191
|
+
t.length && n.push({
|
|
192
|
+
name: s(e, "name"),
|
|
193
|
+
geoms: [{
|
|
194
|
+
kind: "line",
|
|
195
|
+
coords: t
|
|
196
|
+
}],
|
|
197
|
+
props: {}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
for (let e of Array.from(t.getElementsByTagName("trk"))) {
|
|
201
|
+
let t = [];
|
|
202
|
+
for (let n of Array.from(e.getElementsByTagName("trkseg"))) {
|
|
203
|
+
let e = [];
|
|
204
|
+
for (let t of Array.from(n.getElementsByTagName("trkpt"))) {
|
|
205
|
+
let n = u(t);
|
|
206
|
+
n && e.push(n);
|
|
207
|
+
}
|
|
208
|
+
e.length && t.push({
|
|
209
|
+
kind: "line",
|
|
210
|
+
coords: e
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
t.length && n.push({
|
|
214
|
+
name: s(e, "name"),
|
|
215
|
+
geoms: t,
|
|
216
|
+
props: {}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return n;
|
|
220
|
+
}
|
|
221
|
+
function f(e, t) {
|
|
222
|
+
let n = (t || "").toLowerCase();
|
|
223
|
+
return n === "kml" || /<kml[\s>]/i.test(e) ? {
|
|
224
|
+
format: "kml",
|
|
225
|
+
features: l(e)
|
|
226
|
+
} : n === "gpx" || /<gpx[\s>]/i.test(e) ? {
|
|
227
|
+
format: "gpx",
|
|
228
|
+
features: d(e)
|
|
229
|
+
} : {
|
|
230
|
+
format: "geojson",
|
|
231
|
+
features: a(e)
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
export { f as parseGeo };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HAR (HTTP Archive 1.2) 解析与展示层 —— 纯逻辑,不依赖 Vue / DOM。
|
|
3
|
+
*
|
|
4
|
+
* 移植自 sqlite-viewer 项目(D:\web-work\sqlite-viewer\src\har\har.ts),但做成**自包含**:原项目里
|
|
5
|
+
* 依赖的 base64 / utf8 / hex / JSON 美化工具直接内联在本文件,避免引入第三方或跨模块依赖(与本仓库
|
|
6
|
+
* lib/eml.ts、lib/mht.ts「手搓零依赖」的一致风格)。
|
|
7
|
+
*
|
|
8
|
+
* 职责:
|
|
9
|
+
* 1) 把任意 HAR JSON 文本解析为规范化的 HarDoc / HarEntry(带预计算的展示字段);
|
|
10
|
+
* 2) 解码请求/响应 body:标准 `encoding:"base64"` + 部分工具(Reqable 等)「body 被 Base64 编码但
|
|
11
|
+
* 未声明」的情况自动识别;
|
|
12
|
+
* 3) Header / Cookie / Query / 表单等格式化查看所需的工具函数;
|
|
13
|
+
* 4) 导出 cURL。
|
|
14
|
+
*/
|
|
15
|
+
export interface HarNV {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
export interface HarCookie {
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
path?: string;
|
|
23
|
+
domain?: string;
|
|
24
|
+
expires?: string | null;
|
|
25
|
+
httpOnly?: boolean;
|
|
26
|
+
secure?: boolean;
|
|
27
|
+
sameSite?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface HarPostParam {
|
|
30
|
+
name: string;
|
|
31
|
+
value?: string;
|
|
32
|
+
fileName?: string;
|
|
33
|
+
contentType?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface HarPostData {
|
|
36
|
+
mimeType?: string;
|
|
37
|
+
text?: string;
|
|
38
|
+
params?: HarPostParam[];
|
|
39
|
+
encoding?: string;
|
|
40
|
+
comment?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HarContent {
|
|
43
|
+
size?: number;
|
|
44
|
+
compression?: number;
|
|
45
|
+
mimeType?: string;
|
|
46
|
+
text?: string;
|
|
47
|
+
encoding?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface HarRequest {
|
|
50
|
+
method: string;
|
|
51
|
+
url: string;
|
|
52
|
+
httpVersion?: string;
|
|
53
|
+
headers: HarNV[];
|
|
54
|
+
queryString: HarNV[];
|
|
55
|
+
cookies: HarCookie[];
|
|
56
|
+
headersSize?: number;
|
|
57
|
+
bodySize?: number;
|
|
58
|
+
postData?: HarPostData;
|
|
59
|
+
}
|
|
60
|
+
export interface HarResponse {
|
|
61
|
+
status: number;
|
|
62
|
+
statusText?: string;
|
|
63
|
+
httpVersion?: string;
|
|
64
|
+
headers: HarNV[];
|
|
65
|
+
cookies: HarCookie[];
|
|
66
|
+
content: HarContent;
|
|
67
|
+
redirectURL?: string;
|
|
68
|
+
headersSize?: number;
|
|
69
|
+
bodySize?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface HarTimings {
|
|
72
|
+
blocked?: number;
|
|
73
|
+
dns?: number;
|
|
74
|
+
connect?: number;
|
|
75
|
+
send?: number;
|
|
76
|
+
wait?: number;
|
|
77
|
+
receive?: number;
|
|
78
|
+
ssl?: number;
|
|
79
|
+
}
|
|
80
|
+
export interface HarEntryRaw {
|
|
81
|
+
startedDateTime?: string;
|
|
82
|
+
time?: number;
|
|
83
|
+
request: HarRequest;
|
|
84
|
+
response: HarResponse;
|
|
85
|
+
timings?: HarTimings;
|
|
86
|
+
serverIPAddress?: string;
|
|
87
|
+
connection?: string;
|
|
88
|
+
resourceType?: string;
|
|
89
|
+
}
|
|
90
|
+
/** 请求资源大类(用于颜色 / 快捷筛选) */
|
|
91
|
+
export type HarCategory = 'doc' | 'xhr' | 'js' | 'css' | 'img' | 'font' | 'media' | 'ws' | 'other';
|
|
92
|
+
export interface HarEntry {
|
|
93
|
+
index: number;
|
|
94
|
+
method: string;
|
|
95
|
+
url: string;
|
|
96
|
+
scheme: string;
|
|
97
|
+
host: string;
|
|
98
|
+
path: string;
|
|
99
|
+
pathname: string;
|
|
100
|
+
status: number;
|
|
101
|
+
statusText: string;
|
|
102
|
+
category: HarCategory;
|
|
103
|
+
type: string;
|
|
104
|
+
mime: string;
|
|
105
|
+
size: number;
|
|
106
|
+
reqSize: number;
|
|
107
|
+
time: number;
|
|
108
|
+
startedISO: string;
|
|
109
|
+
startedMs: number;
|
|
110
|
+
serverIP: string;
|
|
111
|
+
raw: HarEntryRaw;
|
|
112
|
+
}
|
|
113
|
+
export interface HarDoc {
|
|
114
|
+
entries: HarEntry[];
|
|
115
|
+
creator: string;
|
|
116
|
+
version: string;
|
|
117
|
+
}
|
|
118
|
+
/** 拆分 URL(容错:非法 URL 时退化为整串当 path) */
|
|
119
|
+
export declare function splitUrl(url: string): {
|
|
120
|
+
scheme: string;
|
|
121
|
+
host: string;
|
|
122
|
+
pathname: string;
|
|
123
|
+
path: string;
|
|
124
|
+
};
|
|
125
|
+
/** 去掉 mime 的 charset/boundary 等参数,返回主类型 */
|
|
126
|
+
export declare function shortMime(mime: string): string;
|
|
127
|
+
/** 由响应 mime + url + status 推断资源大类与短标签 */
|
|
128
|
+
export declare function categorize(mime: string, scheme: string, status: number, rt: string): {
|
|
129
|
+
category: HarCategory;
|
|
130
|
+
type: string;
|
|
131
|
+
};
|
|
132
|
+
/** 解析 HAR 文本。非法 / 无 log.entries 时抛错。 */
|
|
133
|
+
export declare function parseHar(text: string): HarDoc;
|
|
134
|
+
export type BodyDecodeMode = 'auto' | 'raw' | 'base64';
|
|
135
|
+
export interface DecodedBody {
|
|
136
|
+
kind: 'empty' | 'text' | 'binary' | 'form';
|
|
137
|
+
text: string;
|
|
138
|
+
mime: string;
|
|
139
|
+
size: number;
|
|
140
|
+
wasBase64: boolean;
|
|
141
|
+
isBase64Guess: boolean;
|
|
142
|
+
isImage: boolean;
|
|
143
|
+
dataUri: string;
|
|
144
|
+
form?: HarPostParam[];
|
|
145
|
+
}
|
|
146
|
+
/** 文本型 mime(可直接当字符串展示) */
|
|
147
|
+
export declare function isTextualMime(mime: string): boolean;
|
|
148
|
+
export declare function isImageMime(mime: string): boolean;
|
|
149
|
+
/** 严格判断字符串是否「像」标准 base64(用于自动解码未声明编码的 body) */
|
|
150
|
+
export declare function looksLikeBase64(s: string): boolean;
|
|
151
|
+
/** 解码响应内容 content。mode 控制是否对未声明编码的 body 做 base64 解码。 */
|
|
152
|
+
export declare function decodeContent(content: HarContent, mode?: BodyDecodeMode): DecodedBody;
|
|
153
|
+
/** 解码请求体 postData。表单优先以字段表展示。 */
|
|
154
|
+
export declare function decodePostData(post: HarPostData | undefined, mode?: BodyDecodeMode): DecodedBody;
|
|
155
|
+
/** 若 body 是 JSON(或疑似 JSON)则美化,返回 {text, pretty} */
|
|
156
|
+
export declare function prettyBody(text: string, mime: string): {
|
|
157
|
+
text: string;
|
|
158
|
+
pretty: boolean;
|
|
159
|
+
};
|
|
160
|
+
/** body 高亮所用的语言(对齐 highlight.js / 本仓库 hljsLang)。注意 svg 含 "xml",须先于 xml 判定。 */
|
|
161
|
+
export declare function bodyLang(mime: string): string;
|
|
162
|
+
/** 解析 query string 为 K/V(容错,按 & 与 = 拆) */
|
|
163
|
+
export declare function parseQuery(search: string): HarNV[];
|
|
164
|
+
/** 取某个 header(大小写不敏感) */
|
|
165
|
+
export declare function header(list: HarNV[], name: string): string;
|
|
166
|
+
/** 导出为 cURL 命令 */
|
|
167
|
+
export declare function toCurl(entry: HarEntry): string;
|
|
168
|
+
export declare function fmtSize(n: number): string;
|
|
169
|
+
export declare function fmtMs(n: number): string;
|
|
170
|
+
/** 状态码颜色类:2xx 绿 / 3xx 蓝 / 4xx 橙 / 5xx 红 / 0 灰 */
|
|
171
|
+
export declare function statusClass(status: number): string;
|