@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,130 @@
|
|
|
1
|
+
import { DATATYPE_ANY as e, DATATYPE_BIN as t, DATATYPE_BOOL as n, DATATYPE_BYTE as r, DATATYPE_DATETIME as i, DATATYPE_DOUBLE as a, DATATYPE_FLOAT as o, DATATYPE_INT as s, DATATYPE_LAMBDA as c, DATATYPE_LONG as l, DATATYPE_METHODPTR as u, DATATYPE_SHORT as d, DATATYPE_STRING as f, MASK_NUM as p, TYPE_CLASS as m, TYPE_CLASS_MEMBER as h, TYPE_CONSTANT as g, TYPE_DLL as _, TYPE_DLL_PARAMETER as v, TYPE_FORM as y, TYPE_FORM_CLASS as b, TYPE_FORM_CONTROL as x, TYPE_FORM_MENU as S, TYPE_GLOBAL as C, TYPE_IMAGE_RESOURCE as w, TYPE_LOCAL as T, TYPE_METHOD as E, TYPE_SOUND_RESOURCE as D, TYPE_STATIC_CLASS as O, TYPE_STRUCT as k, TYPE_STRUCT_MEMBER as A, decomposeLibDataTypeId as j, getType as M, isLibDataType as N } from "../model/eplSystemId.js";
|
|
2
|
+
//#region src/lib/epl/names/idToNameMap.ts
|
|
3
|
+
var P = new Map([
|
|
4
|
+
[t, "字节集"],
|
|
5
|
+
[n, "逻辑型"],
|
|
6
|
+
[r, "字节型"],
|
|
7
|
+
[i, "日期时间型"],
|
|
8
|
+
[a, "双精度小数型"],
|
|
9
|
+
[o, "小数型"],
|
|
10
|
+
[s, "整数型"],
|
|
11
|
+
[l, "长整数型"],
|
|
12
|
+
[u, "子程序指针"],
|
|
13
|
+
[d, "短整数型"],
|
|
14
|
+
[f, "文本型"],
|
|
15
|
+
[e, "通用型"],
|
|
16
|
+
[c, "条件语句型"],
|
|
17
|
+
[0, ""]
|
|
18
|
+
]), F = new Map([
|
|
19
|
+
[E, "Sub"],
|
|
20
|
+
[C, "Global"],
|
|
21
|
+
[O, "Mod"],
|
|
22
|
+
[_, "Dll"],
|
|
23
|
+
[h, "Mem"],
|
|
24
|
+
[x, "Control"],
|
|
25
|
+
[S, "Menu"],
|
|
26
|
+
[g, "Const"],
|
|
27
|
+
[b, "FormCls"],
|
|
28
|
+
[T, "Local"],
|
|
29
|
+
[w, "Img"],
|
|
30
|
+
[D, "Sound"],
|
|
31
|
+
[A, "StructMem"],
|
|
32
|
+
[k, "Struct"],
|
|
33
|
+
[v, "DllParam"],
|
|
34
|
+
[m, "Cls"],
|
|
35
|
+
[y, "Form"]
|
|
36
|
+
]), I = /^_-@[MS]<([_A-Za-z-][_0-9A-Za-z-]*)>$/;
|
|
37
|
+
function L(e) {
|
|
38
|
+
if (!e) return null;
|
|
39
|
+
let t = I.exec(e);
|
|
40
|
+
return t ? t[1] : null;
|
|
41
|
+
}
|
|
42
|
+
function R(e, t) {
|
|
43
|
+
return (e >>> 0).toString(16).toUpperCase().padStart(t, "0");
|
|
44
|
+
}
|
|
45
|
+
var z = class {
|
|
46
|
+
userDefinedName = /* @__PURE__ */ new Map();
|
|
47
|
+
methodIdToClassId = /* @__PURE__ */ new Map();
|
|
48
|
+
libProvider;
|
|
49
|
+
constructor(e, t = null) {
|
|
50
|
+
this.libProvider = t;
|
|
51
|
+
let n = e.code;
|
|
52
|
+
if (n) {
|
|
53
|
+
for (let e of n.methods) {
|
|
54
|
+
if (e.name) this.userDefinedName.set(e.id, e.name);
|
|
55
|
+
else {
|
|
56
|
+
let t = L(e.comment);
|
|
57
|
+
t != null && this.userDefinedName.set(e.id, t);
|
|
58
|
+
}
|
|
59
|
+
for (let t of e.parameters) this.userDefinedName.set(t.id, t.name);
|
|
60
|
+
for (let t of e.variables) this.userDefinedName.set(t.id, t.name);
|
|
61
|
+
}
|
|
62
|
+
for (let e of n.dllDeclares) {
|
|
63
|
+
this.userDefinedName.set(e.id, e.name);
|
|
64
|
+
for (let t of e.parameters) this.userDefinedName.set(t.id, t.name);
|
|
65
|
+
}
|
|
66
|
+
for (let e of n.classes) {
|
|
67
|
+
for (let t of e.methods) this.methodIdToClassId.set(t, e.id);
|
|
68
|
+
if (e.name) this.userDefinedName.set(e.id, e.name);
|
|
69
|
+
else {
|
|
70
|
+
let t = L(e.comment);
|
|
71
|
+
t != null && this.userDefinedName.set(e.id, t);
|
|
72
|
+
}
|
|
73
|
+
for (let t of e.variables) this.userDefinedName.set(t.id, t.name);
|
|
74
|
+
}
|
|
75
|
+
for (let e of n.structs) {
|
|
76
|
+
this.userDefinedName.set(e.id, e.name);
|
|
77
|
+
for (let t of e.members) this.userDefinedName.set(t.id, t.name);
|
|
78
|
+
}
|
|
79
|
+
for (let e of n.globalVariables) this.userDefinedName.set(e.id, e.name);
|
|
80
|
+
}
|
|
81
|
+
let r = e.resource;
|
|
82
|
+
if (r) {
|
|
83
|
+
for (let e of r.constants) this.userDefinedName.set(e.id, e.name);
|
|
84
|
+
for (let e of r.forms) {
|
|
85
|
+
this.userDefinedName.set(e.id, e.name);
|
|
86
|
+
for (let t of e.elements) this.userDefinedName.set(t.id, t.name);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
let i = e.losable;
|
|
90
|
+
if (i) for (let e of i.removedItems) this.userDefinedName.has(e.id) || this.userDefinedName.set(e.id, e.name);
|
|
91
|
+
if (n && n.mainMethod !== 0) {
|
|
92
|
+
this.userDefinedName.set(n.mainMethod, "_启动子程序");
|
|
93
|
+
let e = [];
|
|
94
|
+
for (let [t, n] of this.userDefinedName) n || e.push(t);
|
|
95
|
+
for (let t of e) this.userDefinedName.delete(t);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
getUserDefinedName(e) {
|
|
99
|
+
let t = this.userDefinedName.get(e);
|
|
100
|
+
if (t !== void 0) return t;
|
|
101
|
+
let n = M(e), r = F.get(n);
|
|
102
|
+
return r === void 0 ? n === 100663296 ? "" : `_User_0x${R(e, 8)}` : `_${r}_0x${R(e & p, 6)}`;
|
|
103
|
+
}
|
|
104
|
+
getDataTypeName(e) {
|
|
105
|
+
let t = P.get(e);
|
|
106
|
+
if (t !== void 0) return t;
|
|
107
|
+
if (N(e)) {
|
|
108
|
+
let { lib: t, type: n } = j(e);
|
|
109
|
+
return this.getLibTypeName(t, n);
|
|
110
|
+
}
|
|
111
|
+
return this.getUserDefinedName(e);
|
|
112
|
+
}
|
|
113
|
+
getLibCmdName(e, t) {
|
|
114
|
+
return this.libProvider?.cmdName(e, t) ?? `_Lib${e}Cmd${t}`;
|
|
115
|
+
}
|
|
116
|
+
getLibTypeName(e, t) {
|
|
117
|
+
return this.libProvider?.typeName(e, t) ?? `_Lib${e}Type${t}`;
|
|
118
|
+
}
|
|
119
|
+
getLibConstantName(e, t) {
|
|
120
|
+
return this.libProvider?.constantName(e, t) ?? `_Lib${e}Const${t}`;
|
|
121
|
+
}
|
|
122
|
+
getLibTypeEventName(e, t, n) {
|
|
123
|
+
return this.libProvider?.typeEventName(e, t, n) ?? `_Lib${e}Type${t}Event${n}`;
|
|
124
|
+
}
|
|
125
|
+
getLibTypeMemberName(e, t, n) {
|
|
126
|
+
return this.libProvider?.typeMemberName(e, t, n) ?? `_Lib${e}Type${t}Mem${n}`;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
//#endregion
|
|
130
|
+
export { z as IdToNameMap, L as parseDebugComment };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Support-library name provider — turns `_Lib0Cmd13` placeholders into real names (返回 / 到文本 / 信息框 …).
|
|
3
|
+
*
|
|
4
|
+
* Backed by {@link eplLibData.json}, predumped from the actual e-language `.fne` support libraries via the C#
|
|
5
|
+
* `OpenEpl.ELibInfo` loader (keyed by library fileName, e.g. `krnln` / `iconv` / `spec`). A project's library
|
|
6
|
+
* list gives the per-index identity, so {@link buildLibNameProvider} resolves the decompiler's (libIndex, id)
|
|
7
|
+
* pairs to names. A library not in the DB (or an out-of-range id) falls back to the placeholder in IdToNameMap.
|
|
8
|
+
*
|
|
9
|
+
* To extend coverage, regenerate the JSON with the oracle's `libdump` mode over more projects (their `.fne`
|
|
10
|
+
* libraries are read from the local e-language install).
|
|
11
|
+
*/
|
|
12
|
+
import type { LibraryRefInfo } from '../code/structures';
|
|
13
|
+
import type { LibNameProvider } from './idToNameMap';
|
|
14
|
+
/** Build a {@link LibNameProvider} for a project, mapping each library index to its predumped name table. */
|
|
15
|
+
export declare function buildLibNameProvider(libraries: LibraryRefInfo[]): LibNameProvider;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "./eplLibData.js";
|
|
2
|
+
//#region src/lib/epl/names/libNameProvider.ts
|
|
3
|
+
var t = e;
|
|
4
|
+
function n(e, t) {
|
|
5
|
+
return e && t >= 0 && t < e.length ? e[t] : void 0;
|
|
6
|
+
}
|
|
7
|
+
function r(e) {
|
|
8
|
+
let r = e.map((e) => t[e.fileName.toLowerCase()]);
|
|
9
|
+
return {
|
|
10
|
+
cmdName: (e, t) => n(r[e]?.cmds, t) ?? null,
|
|
11
|
+
typeName: (e, t) => n(r[e]?.dataTypes, t)?.name ?? null,
|
|
12
|
+
constantName: (e, t) => n(r[e]?.constants, t) ?? null,
|
|
13
|
+
typeMemberName: (e, t, i) => n(n(r[e]?.dataTypes, t)?.members, i) ?? null,
|
|
14
|
+
typeEventName: (e, t, i) => n(n(r[e]?.dataTypes, t)?.events, i) ?? null
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as buildLibNameProvider };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured program model for the IDE-style viewer — turns the parsed {@link EplDocument} + {@link IdToNameMap}
|
|
3
|
+
* into the shape the Vue components render directly: classes (each as 程序集 / 窗口程序集 / 类) with their
|
|
4
|
+
* member-variable rows + methods (header fields, parameter rows, local rows, decompiled code lines), plus the
|
|
5
|
+
* project-level tables (全局变量 / 自定义数据类型 / Dll命令 / 常量表 / 资源表 / 模块引用表).
|
|
6
|
+
*
|
|
7
|
+
* Names/types resolve through {@link IdToNameMap}; code bodies through {@link methodCodeLines}. This sits on top
|
|
8
|
+
* of the already-validated parse + decompile layers — it only reshapes, it does not re-parse.
|
|
9
|
+
*/
|
|
10
|
+
import { type CodeLine } from './code/codeLines';
|
|
11
|
+
import type { EplVarKind } from './code/variable';
|
|
12
|
+
import type { EplDocument } from './eplDocument';
|
|
13
|
+
/** 程序集 (static) / 窗口程序集 (form) / 类 (class) — decided by the high byte of the class id. */
|
|
14
|
+
export type EplClassKind = 'static' | 'form' | 'class';
|
|
15
|
+
/** A single variable row (parameter / local / member / global / struct member / DLL parameter). */
|
|
16
|
+
export interface EplVarRow {
|
|
17
|
+
kind: EplVarKind;
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
/** 公开 (global flag 0x100). */
|
|
21
|
+
isPublic: boolean;
|
|
22
|
+
/** 静态 (local flag 0x1). */
|
|
23
|
+
isStatic: boolean;
|
|
24
|
+
/** 传址 (struct member / DLL parameter flag 0x2). */
|
|
25
|
+
byAddress: boolean;
|
|
26
|
+
/** 参考 (method parameter flag 0x2). */
|
|
27
|
+
byReference: boolean;
|
|
28
|
+
/** 可空 (method parameter flag 0x4). */
|
|
29
|
+
nullable: boolean;
|
|
30
|
+
/** Array bounds spec for variables/members (`""` scalar, `"0"` dynamic, `"3,4"` fixed). */
|
|
31
|
+
arrayBound: string;
|
|
32
|
+
/** 数组 checkbox for parameters/DLL parameters (flag 0x8). */
|
|
33
|
+
isArray: boolean;
|
|
34
|
+
comment: string;
|
|
35
|
+
}
|
|
36
|
+
export interface EplMethodView {
|
|
37
|
+
id: number;
|
|
38
|
+
name: string;
|
|
39
|
+
returnType: string;
|
|
40
|
+
isPublic: boolean;
|
|
41
|
+
comment: string;
|
|
42
|
+
parameters: EplVarRow[];
|
|
43
|
+
locals: EplVarRow[];
|
|
44
|
+
lines: CodeLine[];
|
|
45
|
+
}
|
|
46
|
+
export interface EplClassView {
|
|
47
|
+
id: number;
|
|
48
|
+
kind: EplClassKind;
|
|
49
|
+
name: string;
|
|
50
|
+
/** Base-class name (类 only); `""` when none. */
|
|
51
|
+
baseName: string;
|
|
52
|
+
comment: string;
|
|
53
|
+
members: EplVarRow[];
|
|
54
|
+
methods: EplMethodView[];
|
|
55
|
+
}
|
|
56
|
+
export interface EplStructView {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
isPublic: boolean;
|
|
60
|
+
comment: string;
|
|
61
|
+
members: EplVarRow[];
|
|
62
|
+
}
|
|
63
|
+
export interface EplDllView {
|
|
64
|
+
id: number;
|
|
65
|
+
name: string;
|
|
66
|
+
returnType: string;
|
|
67
|
+
isPublic: boolean;
|
|
68
|
+
comment: string;
|
|
69
|
+
libraryName: string;
|
|
70
|
+
entryPoint: string;
|
|
71
|
+
parameters: EplVarRow[];
|
|
72
|
+
}
|
|
73
|
+
export interface EplConstantRow {
|
|
74
|
+
id: number;
|
|
75
|
+
name: string;
|
|
76
|
+
/** Scalar value pre-formatted to the code view's literal style (number / 真·假 / [日期时间] / “文本”). */
|
|
77
|
+
value: string;
|
|
78
|
+
comment: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* An 图片 / 声音 resource (a constant whose id high-nibble is 2 / 3). Shown on its own 图片/声音 page, not in the
|
|
82
|
+
* constant table. `bytes` is the raw resource payload; the component sniffs / decodes it (a 图片组 is a Windows
|
|
83
|
+
* ImageList — see {@link parseEplImageList}; a plain image is rendered inline; a sound gets an audio player).
|
|
84
|
+
*/
|
|
85
|
+
export interface EplResourceRow {
|
|
86
|
+
id: number;
|
|
87
|
+
name: string;
|
|
88
|
+
comment: string;
|
|
89
|
+
kind: 'image' | 'sound';
|
|
90
|
+
bytes: Uint8Array;
|
|
91
|
+
}
|
|
92
|
+
export interface EplFormElementView {
|
|
93
|
+
id: number;
|
|
94
|
+
name: string;
|
|
95
|
+
type: string;
|
|
96
|
+
}
|
|
97
|
+
export interface EplFormView {
|
|
98
|
+
id: number;
|
|
99
|
+
name: string;
|
|
100
|
+
className: string;
|
|
101
|
+
comment: string;
|
|
102
|
+
elements: EplFormElementView[];
|
|
103
|
+
}
|
|
104
|
+
export interface EplLibraryView {
|
|
105
|
+
name: string;
|
|
106
|
+
fileName: string;
|
|
107
|
+
version: string;
|
|
108
|
+
}
|
|
109
|
+
export interface EplProgram {
|
|
110
|
+
classes: EplClassView[];
|
|
111
|
+
globals: EplVarRow[];
|
|
112
|
+
structs: EplStructView[];
|
|
113
|
+
dllDeclares: EplDllView[];
|
|
114
|
+
constants: EplConstantRow[];
|
|
115
|
+
resources: EplResourceRow[];
|
|
116
|
+
forms: EplFormView[];
|
|
117
|
+
libraries: EplLibraryView[];
|
|
118
|
+
}
|
|
119
|
+
/** Build the structured model for the viewer. Returns empty tables when a `.e`/`.ec` has no code section. */
|
|
120
|
+
export declare function buildProgram(doc: EplDocument): EplProgram;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { decoderForLanguage as e } from "./io/encoding.js";
|
|
2
|
+
import { getType as t } from "./model/eplSystemId.js";
|
|
3
|
+
import { formatNumber as n, formatOADate as r } from "./code/textCode.js";
|
|
4
|
+
import { methodCodeLines as i } from "./code/codeLines.js";
|
|
5
|
+
import { IdToNameMap as a, parseDebugComment as o } from "./names/idToNameMap.js";
|
|
6
|
+
import { buildLibNameProvider as s } from "./names/libNameProvider.js";
|
|
7
|
+
//#region src/lib/epl/program.ts
|
|
8
|
+
function c(e) {
|
|
9
|
+
return e.length === 0 ? "" : e.length === 1 && e[0] === 0 ? "0" : e.map((e) => e === 0 ? "" : String(e)).join(",");
|
|
10
|
+
}
|
|
11
|
+
function l(e) {
|
|
12
|
+
return o(e) == null ? e : "";
|
|
13
|
+
}
|
|
14
|
+
function u(e) {
|
|
15
|
+
switch (e.kind) {
|
|
16
|
+
case "double": return n(e.value);
|
|
17
|
+
case "bool": return e.value ? "真" : "假";
|
|
18
|
+
case "datetime": return "[" + r(e.oa) + "]";
|
|
19
|
+
case "string": return "“" + e.value + "”";
|
|
20
|
+
default: return "";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function d(e, t) {
|
|
24
|
+
return {
|
|
25
|
+
kind: e.kind,
|
|
26
|
+
name: t.getUserDefinedName(e.id),
|
|
27
|
+
type: t.getDataTypeName(e.dataType),
|
|
28
|
+
isPublic: (e.flags & 256) != 0,
|
|
29
|
+
isStatic: (e.flags & 1) != 0,
|
|
30
|
+
byAddress: (e.flags & 2) != 0,
|
|
31
|
+
byReference: (e.flags & 2) != 0,
|
|
32
|
+
nullable: (e.flags & 4) != 0,
|
|
33
|
+
arrayBound: c(e.uBound),
|
|
34
|
+
isArray: (e.flags & 8) != 0,
|
|
35
|
+
comment: l(e.comment)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function f(e) {
|
|
39
|
+
let n = t(e);
|
|
40
|
+
return n === 1224736768 ? "class" : n === 419430400 ? "form" : "static";
|
|
41
|
+
}
|
|
42
|
+
function p(e, t, n) {
|
|
43
|
+
return {
|
|
44
|
+
id: e.id,
|
|
45
|
+
name: t.getUserDefinedName(e.id),
|
|
46
|
+
returnType: t.getDataTypeName(e.returnDataType),
|
|
47
|
+
isPublic: (e.flags & 8) != 0,
|
|
48
|
+
comment: l(e.comment),
|
|
49
|
+
parameters: e.parameters.map((e) => d(e, t)),
|
|
50
|
+
locals: e.variables.map((e) => d(e, t)),
|
|
51
|
+
lines: i(e.codeData.expressionData, t, n)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function m(e, t) {
|
|
55
|
+
return {
|
|
56
|
+
id: e.id,
|
|
57
|
+
name: t.getUserDefinedName(e.id),
|
|
58
|
+
isPublic: (e.flags & 1) != 0,
|
|
59
|
+
comment: l(e.comment),
|
|
60
|
+
members: e.members.map((e) => d(e, t))
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function h(e, t) {
|
|
64
|
+
return {
|
|
65
|
+
id: e.id,
|
|
66
|
+
name: t.getUserDefinedName(e.id),
|
|
67
|
+
returnType: t.getDataTypeName(e.returnDataType),
|
|
68
|
+
isPublic: (e.flags & 2) != 0,
|
|
69
|
+
comment: l(e.comment),
|
|
70
|
+
libraryName: e.libraryName,
|
|
71
|
+
entryPoint: e.entryPoint,
|
|
72
|
+
parameters: e.parameters.map((e) => d(e, t))
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function g(n) {
|
|
76
|
+
let r = e(n.systemInfo?.language ?? 1), i = new a(n, n.code ? s(n.code.libraries) : null), o = n.code, c = /* @__PURE__ */ new Map();
|
|
77
|
+
if (o) for (let e of o.methods) c.set(e.id, e);
|
|
78
|
+
let g = (o?.classes ?? []).map((e) => {
|
|
79
|
+
let t = e.baseClass === 0 || e.baseClass === -1 ? "" : i.getUserDefinedName(e.baseClass), n = [];
|
|
80
|
+
for (let t of e.methods) {
|
|
81
|
+
let e = c.get(t);
|
|
82
|
+
e && n.push(p(e, i, r));
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
id: e.id,
|
|
86
|
+
kind: f(e.id),
|
|
87
|
+
name: i.getUserDefinedName(e.id),
|
|
88
|
+
baseName: t,
|
|
89
|
+
comment: e.comment,
|
|
90
|
+
members: e.variables.map((e) => d(e, i)),
|
|
91
|
+
methods: n
|
|
92
|
+
};
|
|
93
|
+
}), _ = n.resource, v = _?.constants ?? [], y = v.filter((e) => t(e.id) === 402653184 && e.name).map((e) => ({
|
|
94
|
+
id: e.id,
|
|
95
|
+
name: i.getUserDefinedName(e.id),
|
|
96
|
+
value: u(e.value),
|
|
97
|
+
comment: l(e.comment)
|
|
98
|
+
})), b = v.filter((e) => {
|
|
99
|
+
let n = t(e.id);
|
|
100
|
+
return (n === 671088640 || n === 939524096) && e.name;
|
|
101
|
+
}).map((e) => ({
|
|
102
|
+
id: e.id,
|
|
103
|
+
name: i.getUserDefinedName(e.id),
|
|
104
|
+
comment: l(e.comment),
|
|
105
|
+
kind: t(e.id) === 671088640 ? "image" : "sound",
|
|
106
|
+
bytes: e.value.kind === "image" || e.value.kind === "sound" ? e.value.bytes : new Uint8Array()
|
|
107
|
+
})), x = (_?.forms ?? []).map((e) => ({
|
|
108
|
+
id: e.id,
|
|
109
|
+
name: i.getUserDefinedName(e.id),
|
|
110
|
+
className: e.classId ? i.getUserDefinedName(e.classId) : "",
|
|
111
|
+
comment: l(e.comment),
|
|
112
|
+
elements: e.elements.map((e) => ({
|
|
113
|
+
id: e.id,
|
|
114
|
+
name: i.getUserDefinedName(e.id),
|
|
115
|
+
type: i.getDataTypeName(e.dataType)
|
|
116
|
+
}))
|
|
117
|
+
}));
|
|
118
|
+
return {
|
|
119
|
+
classes: g,
|
|
120
|
+
globals: (o?.globalVariables ?? []).map((e) => d(e, i)),
|
|
121
|
+
structs: (o?.structs ?? []).map((e) => m(e, i)),
|
|
122
|
+
dllDeclares: (o?.dllDeclares ?? []).map((e) => h(e, i)),
|
|
123
|
+
constants: y,
|
|
124
|
+
resources: b,
|
|
125
|
+
forms: x,
|
|
126
|
+
libraries: (o?.libraries ?? []).map((e) => ({
|
|
127
|
+
name: e.name,
|
|
128
|
+
fileName: e.fileName,
|
|
129
|
+
version: e.version.join(".")
|
|
130
|
+
}))
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { g as buildProgram };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RawSection } from './model/section';
|
|
2
|
+
export type EplCryptoType = 'estd' | 'ec' | 'unknown';
|
|
3
|
+
/**
|
|
4
|
+
* The file carries an encryption header. Decryption (RC4 / EStd / EC) is a later milestone; the loader
|
|
5
|
+
* surfaces this so the UI can explain it. The EC branch still reads the password-hint string into {@link tip}.
|
|
6
|
+
*/
|
|
7
|
+
export declare class EplEncryptedError extends Error {
|
|
8
|
+
readonly cryptoType: EplCryptoType;
|
|
9
|
+
readonly tip?: string | undefined;
|
|
10
|
+
constructor(cryptoType: EplCryptoType, tip?: string | undefined);
|
|
11
|
+
}
|
|
12
|
+
/** The bytes aren't an e-language project file (main magic mismatch). */
|
|
13
|
+
export declare class NotEplFileError extends Error {
|
|
14
|
+
constructor(message?: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class ProjectFileReader {
|
|
17
|
+
private readonly r;
|
|
18
|
+
isFinish: boolean;
|
|
19
|
+
/** Set once EC decryption is wired up (later milestone); flips a few section layouts + dataLength. */
|
|
20
|
+
cryptEC: boolean;
|
|
21
|
+
constructor(bytes: Uint8Array);
|
|
22
|
+
readSection(): RawSection;
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { gbk as e } from "./io/encoding.js";
|
|
2
|
+
import { BinaryReader as t } from "./io/binaryReader.js";
|
|
3
|
+
//#region src/lib/epl/projectFileReader.ts
|
|
4
|
+
var n = 353465113, r = 117469977, i = 1162630231, a = 1415007811, o = 1196576837, s = class extends Error {
|
|
5
|
+
cryptoType;
|
|
6
|
+
tip;
|
|
7
|
+
constructor(e, t) {
|
|
8
|
+
super("加密的易语言工程文件(暂未支持解密)"), this.cryptoType = e, this.tip = t, this.name = "EplEncryptedError";
|
|
9
|
+
}
|
|
10
|
+
}, c = class extends Error {
|
|
11
|
+
constructor(e = "不是易语言工程文件") {
|
|
12
|
+
super(e), this.name = "NotEplFileError";
|
|
13
|
+
}
|
|
14
|
+
}, l = class {
|
|
15
|
+
r;
|
|
16
|
+
isFinish = !1;
|
|
17
|
+
cryptEC = !1;
|
|
18
|
+
constructor(n) {
|
|
19
|
+
this.r = new t(n, e());
|
|
20
|
+
let r = this.r.readInt32(), l = this.r.readInt32();
|
|
21
|
+
if (r === i) {
|
|
22
|
+
if (l === 1) throw new s("estd");
|
|
23
|
+
if (l === 131073) {
|
|
24
|
+
let t = this.r.readInt32();
|
|
25
|
+
throw new s("ec", this.r.readStringWithFixedLength(t, e()));
|
|
26
|
+
}
|
|
27
|
+
throw new s("unknown");
|
|
28
|
+
}
|
|
29
|
+
if (r !== a || l !== o) throw new c();
|
|
30
|
+
}
|
|
31
|
+
readSection() {
|
|
32
|
+
if (this.isFinish) throw Error("已到文件末尾");
|
|
33
|
+
if (this.r.readInt32() !== n) throw Error("段 Magic 错误");
|
|
34
|
+
this.r.readInt32();
|
|
35
|
+
let e = this.r.readInt32(), t = u(e, this.r.readBytes(30));
|
|
36
|
+
this.r.readInt16(), this.r.readInt32();
|
|
37
|
+
let i = this.r.readInt32() !== 0;
|
|
38
|
+
this.r.readInt32();
|
|
39
|
+
let a = this.r.readInt32();
|
|
40
|
+
this.cryptEC && (a ^= 1), this.r.skip(40);
|
|
41
|
+
let o = this.r.readBytes(a);
|
|
42
|
+
return e === r && (this.isFinish = !0), {
|
|
43
|
+
key: e,
|
|
44
|
+
name: t,
|
|
45
|
+
isOptional: i,
|
|
46
|
+
data: o
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function u(t, n) {
|
|
51
|
+
let i = n.slice();
|
|
52
|
+
if (t !== r) {
|
|
53
|
+
let e = [
|
|
54
|
+
t & 255,
|
|
55
|
+
t >> 8 & 255,
|
|
56
|
+
t >> 16 & 255,
|
|
57
|
+
t >> 24 & 255
|
|
58
|
+
];
|
|
59
|
+
for (let t = 0; t < i.length; t++) i[t] ^= e[(t + 1) % 4];
|
|
60
|
+
}
|
|
61
|
+
let a = i.indexOf(0);
|
|
62
|
+
return a === -1 && (a = i.length), e().decode(i.subarray(0, a));
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { s as EplEncryptedError, c as NotEplFileError, l as ProjectFileReader };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SectionBase, SectionType } from '../model/section';
|
|
2
|
+
import { type EplVariable } from '../code/variable';
|
|
3
|
+
import { type ClassInfo, type DllDeclareInfo, type LibraryRefInfo, type MethodInfo, type StructInfo } from '../code/structures';
|
|
4
|
+
export interface CodeSection extends SectionBase {
|
|
5
|
+
kind: 'code';
|
|
6
|
+
/** Max allocated Id number (new Ids are this + 1); defaults to 0xFFFF. */
|
|
7
|
+
allocatedIdNum: number;
|
|
8
|
+
libraries: LibraryRefInfo[];
|
|
9
|
+
flag: number;
|
|
10
|
+
/** "_启动子程序" Id (EC files without editor info). */
|
|
11
|
+
mainMethod: number;
|
|
12
|
+
iconData: Uint8Array;
|
|
13
|
+
debugCommandParameters: string;
|
|
14
|
+
classes: ClassInfo[];
|
|
15
|
+
methods: MethodInfo[];
|
|
16
|
+
globalVariables: EplVariable[];
|
|
17
|
+
structs: StructInfo[];
|
|
18
|
+
dllDeclares: DllDeclareInfo[];
|
|
19
|
+
}
|
|
20
|
+
export declare const CodeSectionKey: SectionType<CodeSection>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SectionBase, SectionType } from '../model/section';
|
|
2
|
+
export interface ESystemInfoSection extends SectionBase {
|
|
3
|
+
kind: 'systemInfo';
|
|
4
|
+
/** [major, minor] of the e-language system that wrote the file. */
|
|
5
|
+
esystemVersion: [number, number];
|
|
6
|
+
/** 1=中文(GBK), 2=英语(ASCII), 3=中文(BIG5), 4=日文(SJIS). Drives {@link decoderForLanguage}. */
|
|
7
|
+
language: number;
|
|
8
|
+
/** [major, minor] of the .e project format. */
|
|
9
|
+
eprojectFormatVersion: [number, number];
|
|
10
|
+
/** 1=源码(.e), 3=模块(.ec). */
|
|
11
|
+
fileType: number;
|
|
12
|
+
projectType: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const ESystemInfoKey: SectionType<ESystemInfoSection>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SectionBase, SectionType } from '../model/section';
|
|
2
|
+
export interface RemovedItem {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LosableSection extends SectionBase {
|
|
7
|
+
kind: 'losable';
|
|
8
|
+
outFile: string;
|
|
9
|
+
removedItems: RemovedItem[];
|
|
10
|
+
}
|
|
11
|
+
export declare const LosableSectionKey: SectionType<LosableSection>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SectionBase, SectionType } from '../model/section';
|
|
2
|
+
export interface ProjectConfigSection extends SectionBase {
|
|
3
|
+
kind: 'projectConfig';
|
|
4
|
+
/** Project name (NOT the section name). */
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
author: string;
|
|
8
|
+
zipCode: string;
|
|
9
|
+
address: string;
|
|
10
|
+
telephoneNumber: string;
|
|
11
|
+
faxNumber: string;
|
|
12
|
+
email: string;
|
|
13
|
+
homepage: string;
|
|
14
|
+
copyright: string;
|
|
15
|
+
/** [major, minor, build, revision]. */
|
|
16
|
+
version: [number, number, number, number];
|
|
17
|
+
/** Whether the compiled output writes the version resource (C#: stored as `ReadInt32() == 0`). */
|
|
18
|
+
writeVersion: boolean;
|
|
19
|
+
/** Compile-plugins field (fixed 20-byte string). */
|
|
20
|
+
compilePlugins: string;
|
|
21
|
+
exportPublicClassMethod: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const ProjectConfigKey: SectionType<ProjectConfigSection>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { SectionBase, SectionType } from '../model/section';
|
|
2
|
+
/**
|
|
3
|
+
* A constant's typed value. The high nibble of the constant `id` picks the family: 1 ⇒ 普通常量 (a type-tagged
|
|
4
|
+
* scalar — null / double / bool / DateTime / text), 2 ⇒ 图片资源, 3 ⇒ 声音资源 (both raw resource bytes).
|
|
5
|
+
*/
|
|
6
|
+
export type EplConstantValue = {
|
|
7
|
+
kind: 'null';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'double';
|
|
10
|
+
value: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'bool';
|
|
13
|
+
value: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** OLE Automation date (days since 1899-12-30), rendered to `yyyy年MM月dd日…` for display. */
|
|
16
|
+
| {
|
|
17
|
+
kind: 'datetime';
|
|
18
|
+
oa: number;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'string';
|
|
21
|
+
value: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'image';
|
|
24
|
+
bytes: Uint8Array;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'sound';
|
|
27
|
+
bytes: Uint8Array;
|
|
28
|
+
};
|
|
29
|
+
/** A project constant / image / sound resource (the high nibble of `id` distinguishes them). */
|
|
30
|
+
export interface EplConstant {
|
|
31
|
+
id: number;
|
|
32
|
+
flags: number;
|
|
33
|
+
name: string;
|
|
34
|
+
comment: string;
|
|
35
|
+
value: EplConstantValue;
|
|
36
|
+
}
|
|
37
|
+
/** A control or menu on a form (only id/dataType/name kept — enough for name resolution). */
|
|
38
|
+
export interface EplFormElement {
|
|
39
|
+
id: number;
|
|
40
|
+
dataType: number;
|
|
41
|
+
name: string;
|
|
42
|
+
}
|
|
43
|
+
export interface EplForm {
|
|
44
|
+
id: number;
|
|
45
|
+
memoryAddress: number;
|
|
46
|
+
/** The associated window class id. */
|
|
47
|
+
classId: number;
|
|
48
|
+
name: string;
|
|
49
|
+
comment: string;
|
|
50
|
+
elements: EplFormElement[];
|
|
51
|
+
}
|
|
52
|
+
export interface ResourceSection extends SectionBase {
|
|
53
|
+
kind: 'resource';
|
|
54
|
+
forms: EplForm[];
|
|
55
|
+
constants: EplConstant[];
|
|
56
|
+
}
|
|
57
|
+
export declare const ResourceSectionKey: SectionType<ResourceSection>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-rolled, zero-dependency FictionBook 2 (.fb2) parser for the side viewer.
|
|
3
|
+
*
|
|
4
|
+
* FB2 is an XML e-book format. This walks the `<body>` tree, mapping the FB2 elements to a small whitelist of
|
|
5
|
+
* HTML tags (everything else falls through to its inner content), resolves `<image>` references to the inline
|
|
6
|
+
* `<binary>` base64 blobs as data URLs, and returns a COMPLETE, self-contained HTML document string ready to
|
|
7
|
+
* drop into a sandboxed iframe — it carries a `script-src 'none'` CSP and only ever emits known tags with
|
|
8
|
+
* escaped text, so the book's markup can't inject anything executable.
|
|
9
|
+
*/
|
|
10
|
+
export interface ParsedFb2 {
|
|
11
|
+
title: string;
|
|
12
|
+
html: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseFb2(text: string): ParsedFb2;
|