Add TNEF handling and email loading improvements
- Implement TNEF extraction and recursive parsing in new `tnef_reader.go` and associated tests. - Create tests for TNEF extraction scenarios in `tnef_diag_test.go`, `tnef_diag7_test.go`, and `tnef_diag8_test.go`.
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
"": {
|
||||
"name": "frontend",
|
||||
"dependencies": {
|
||||
"@rollup/rollup-win32-arm64-msvc": "^4.57.1",
|
||||
"@types/html2canvas": "^1.0.0",
|
||||
"dompurify": "^3.3.1",
|
||||
"html2canvas": "^1.4.1",
|
||||
"pdfjs-dist": "^5.4.624",
|
||||
"svelte-flags": "^3.0.1",
|
||||
"svelte-sonner": "^1.0.7",
|
||||
@@ -187,7 +190,7 @@
|
||||
|
||||
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.55.1", "", { "os": "none", "cpu": "arm64" }, "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw=="],
|
||||
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.55.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g=="],
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.57.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ=="],
|
||||
|
||||
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.55.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA=="],
|
||||
|
||||
@@ -249,6 +252,8 @@
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||
|
||||
"@types/html2canvas": ["@types/html2canvas@1.0.0", "", { "dependencies": { "html2canvas": "*" } }, "sha512-BJpVf+FIN9UERmzhbtUgpXj6XBZpG67FMgBLLoj9HZKd9XifcCpSV+UnFcwTZfEyun4U/KmCrrVOG7829L589w=="],
|
||||
|
||||
"@types/node": ["@types/node@24.10.6", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-B8h60xgJMR/xmgyX9fncRzEW9gCxoJjdenUhke2v1JGOd/V66KopmWrLPXi5oUI4VuiGK+d+HlXJjDRZMj21EQ=="],
|
||||
|
||||
"@types/trusted-types": ["@types/trusted-types@2.0.7", "", {}, "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="],
|
||||
@@ -261,6 +266,8 @@
|
||||
|
||||
"axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="],
|
||||
|
||||
"base64-arraybuffer": ["base64-arraybuffer@1.0.2", "", {}, "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="],
|
||||
|
||||
"bits-ui": ["bits-ui@2.15.4", "", { "dependencies": { "@floating-ui/core": "^1.7.1", "@floating-ui/dom": "^1.7.1", "esm-env": "^1.1.2", "runed": "^0.35.1", "svelte-toolbelt": "^0.10.6", "tabbable": "^6.2.0" }, "peerDependencies": { "@internationalized/date": "^3.8.1", "svelte": "^5.33.0" } }, "sha512-7H9YUfp03KOk1LVDh8wPYSRPxlZgG/GRWLNSA8QC73/8Z8ytun+DWJhIuibyFyz7A0cP/RANVcB4iDrbY8q+Og=="],
|
||||
|
||||
"chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="],
|
||||
@@ -277,6 +284,8 @@
|
||||
|
||||
"core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="],
|
||||
|
||||
"css-line-break": ["css-line-break@2.1.0", "", { "dependencies": { "utrie": "^1.0.2" } }, "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w=="],
|
||||
|
||||
"cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="],
|
||||
|
||||
"dedent": ["dedent@1.5.1", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg=="],
|
||||
@@ -307,6 +316,8 @@
|
||||
|
||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||
|
||||
"html2canvas": ["html2canvas@1.4.1", "", { "dependencies": { "css-line-break": "^2.1.0", "text-segmentation": "^1.0.3" } }, "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA=="],
|
||||
|
||||
"human-id": ["human-id@4.1.3", "", { "bin": { "human-id": "dist/cli.js" } }, "sha512-tsYlhAYpjCKa//8rXZ9DqKEawhPoSytweBC2eNvcaDK+57RZLHGqNs3PZTQO6yekLFSuvA6AlnAfrw1uBvtb+Q=="],
|
||||
|
||||
"inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="],
|
||||
@@ -415,6 +426,8 @@
|
||||
|
||||
"tapable": ["tapable@2.3.0", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="],
|
||||
|
||||
"text-segmentation": ["text-segmentation@1.0.3", "", { "dependencies": { "utrie": "^1.0.2" } }, "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw=="],
|
||||
|
||||
"tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
|
||||
|
||||
"totalist": ["totalist@3.0.1", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="],
|
||||
@@ -433,6 +446,8 @@
|
||||
|
||||
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||
|
||||
"utrie": ["utrie@1.0.2", "", { "dependencies": { "base64-arraybuffer": "^1.0.2" } }, "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw=="],
|
||||
|
||||
"uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],
|
||||
|
||||
"vite": ["vite@7.3.1", "", { "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA=="],
|
||||
@@ -469,6 +484,8 @@
|
||||
|
||||
"paneforge/svelte-toolbelt": ["svelte-toolbelt@0.9.3", "", { "dependencies": { "clsx": "^2.1.1", "runed": "^0.29.0", "style-to-object": "^1.0.8" }, "peerDependencies": { "svelte": "^5.30.2" } }, "sha512-HCSWxCtVmv+c6g1ACb8LTwHVbDqLKJvHpo6J8TaqwUme2hj9ATJCpjCPNISR1OCq2Q4U1KT41if9ON0isINQZw=="],
|
||||
|
||||
"rollup/@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.55.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g=="],
|
||||
|
||||
"svelte-sonner/runed": ["runed@0.28.0", "", { "dependencies": { "esm-env": "^1.0.0" }, "peerDependencies": { "svelte": "^5.7.0" } }, "sha512-k2xx7RuO9hWcdd9f+8JoBeqWtYrm5CALfgpkg2YDB80ds/QE4w0qqu34A7fqiAwiBBSBQOid7TLxwxVC27ymWQ=="],
|
||||
|
||||
"mode-watcher/svelte-toolbelt/runed": ["runed@0.23.4", "", { "dependencies": { "esm-env": "^1.0.0" }, "peerDependencies": { "svelte": "^5.7.0" } }, "sha512-9q8oUiBYeXIDLWNK5DfCWlkL0EW3oGbk845VdKlPeia28l751VpfesaB/+7pI6rnbx1I6rqoZ2fZxptOJLxILA=="],
|
||||
|
||||
@@ -1 +1 @@
|
||||
3c4a64d0cfb34e86fac16fceae842e43
|
||||
1697d40a08e09716b8c29ddebeabd1ad
|
||||
@@ -6,6 +6,8 @@ import {
|
||||
ReadEML,
|
||||
ReadMSG,
|
||||
ReadPEC,
|
||||
ReadAuto,
|
||||
DetectEmailFormat,
|
||||
ShowOpenFileDialog,
|
||||
SetCurrentMailFilePath,
|
||||
ConvertToUTF8,
|
||||
@@ -23,7 +25,8 @@ export interface LoadEmailResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the email file type from the path
|
||||
* Determines the email file type from the path extension (best-effort hint).
|
||||
* Use DetectEmailFormat (backend) for reliable format detection.
|
||||
*/
|
||||
export function getEmailFileType(filePath: string): 'eml' | 'msg' | null {
|
||||
const lowerPath = filePath.toLowerCase();
|
||||
@@ -33,18 +36,57 @@ export function getEmailFileType(filePath: string): 'eml' | 'msg' | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a file path is a valid email file
|
||||
* Checks if a file path looks like an email file by extension.
|
||||
* Returns true also for unknown extensions so the backend can attempt parsing.
|
||||
*/
|
||||
export function isEmailFile(filePath: string): boolean {
|
||||
return getEmailFileType(filePath) !== null;
|
||||
return filePath.trim().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an email from a file path
|
||||
* Loads an email from a file path.
|
||||
* Uses ReadAuto so the backend detects the format from the file's binary
|
||||
* content, regardless of extension. Falls back to the legacy per-format
|
||||
* readers only when the caller explicitly requests them.
|
||||
*
|
||||
* @param filePath - Path to the email file
|
||||
* @returns LoadEmailResult with the email data or error
|
||||
*/
|
||||
export async function loadEmailFromPath(filePath: string): Promise<LoadEmailResult> {
|
||||
if (!filePath?.trim()) {
|
||||
return { success: false, error: 'No file path provided.' };
|
||||
}
|
||||
|
||||
try {
|
||||
// ReadAuto detects the format (EML/PEC/MSG) by magic bytes and dispatches
|
||||
// to the appropriate reader. This works for any extension, including
|
||||
// unconventional ones like winmail.dat or no extension at all.
|
||||
const email = await ReadAuto(filePath);
|
||||
|
||||
// Process body if needed (decode base64)
|
||||
if (email?.body) {
|
||||
const trimmed = email.body.trim();
|
||||
if (looksLikeBase64(trimmed)) {
|
||||
const decoded = tryDecodeBase64(trimmed);
|
||||
if (decoded) {
|
||||
email.body = decoded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { success: true, email, filePath };
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
console.error('Failed to load email:', error);
|
||||
return { success: false, error: errorMessage };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an email using the explicit per-format readers (legacy path).
|
||||
* Prefer loadEmailFromPath for new code.
|
||||
*/
|
||||
export async function loadEmailFromPathLegacy(filePath: string): Promise<LoadEmailResult> {
|
||||
const fileType = getEmailFileType(filePath);
|
||||
|
||||
if (!fileType) {
|
||||
@@ -60,7 +102,6 @@ export async function loadEmailFromPath(filePath: string): Promise<LoadEmailResu
|
||||
if (fileType === 'msg') {
|
||||
email = await ReadMSG(filePath, true);
|
||||
} else {
|
||||
// Try PEC first, fall back to regular EML
|
||||
try {
|
||||
email = await ReadPEC(filePath);
|
||||
} catch {
|
||||
@@ -68,7 +109,6 @@ export async function loadEmailFromPath(filePath: string): Promise<LoadEmailResu
|
||||
}
|
||||
}
|
||||
|
||||
// Process body if needed (decode base64)
|
||||
if (email?.body) {
|
||||
const trimmed = email.body.trim();
|
||||
if (looksLikeBase64(trimmed)) {
|
||||
@@ -79,18 +119,11 @@ export async function loadEmailFromPath(filePath: string): Promise<LoadEmailResu
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
email,
|
||||
filePath,
|
||||
};
|
||||
return { success: true, email, filePath };
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
console.error('Failed to load email:', error);
|
||||
return {
|
||||
success: false,
|
||||
error: errorMessage,
|
||||
};
|
||||
return { success: false, error: errorMessage };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ export {
|
||||
getEmailFileType,
|
||||
isEmailFile,
|
||||
loadEmailFromPath,
|
||||
loadEmailFromPathLegacy,
|
||||
openAndLoadEmail,
|
||||
processEmailBody,
|
||||
type LoadEmailResult,
|
||||
|
||||
44
frontend/src/lib/wailsjs/go/main/App.d.ts
vendored
44
frontend/src/lib/wailsjs/go/main/App.d.ts
vendored
@@ -1,15 +1,29 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
import {utils} from '../models';
|
||||
import {main} from '../models';
|
||||
import {utils} from '../models';
|
||||
import {internal} from '../models';
|
||||
|
||||
export function CheckForUpdates():Promise<main.UpdateStatus>;
|
||||
|
||||
export function CheckIsDefaultEMLHandler():Promise<boolean>;
|
||||
|
||||
export function ConvertToUTF8(arg1:string):Promise<string>;
|
||||
|
||||
export function CreateBugReportFolder():Promise<main.BugReportResult>;
|
||||
|
||||
export function DetectEmailFormat(arg1:string):Promise<string>;
|
||||
|
||||
export function DownloadUpdate():Promise<string>;
|
||||
|
||||
export function ExportSettings(arg1:string):Promise<string>;
|
||||
|
||||
export function FrontendLog(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function GetConfig():Promise<utils.Config>;
|
||||
|
||||
export function GetCurrentMailFilePath():Promise<string>;
|
||||
|
||||
export function GetImageViewerData():Promise<main.ImageViewerData>;
|
||||
|
||||
export function GetMachineData():Promise<utils.MachineInfo>;
|
||||
@@ -18,14 +32,26 @@ export function GetPDFViewerData():Promise<main.PDFViewerData>;
|
||||
|
||||
export function GetStartupFile():Promise<string>;
|
||||
|
||||
export function GetUpdateStatus():Promise<main.UpdateStatus>;
|
||||
|
||||
export function GetViewerData():Promise<main.ViewerData>;
|
||||
|
||||
export function ImportSettings():Promise<string>;
|
||||
|
||||
export function InstallUpdate(arg1:boolean):Promise<void>;
|
||||
|
||||
export function InstallUpdateSilent():Promise<void>;
|
||||
|
||||
export function InstallUpdateSilentFromPath(arg1:string):Promise<void>;
|
||||
|
||||
export function IsDebuggerRunning():Promise<boolean>;
|
||||
|
||||
export function OpenDefaultAppsSettings():Promise<void>;
|
||||
|
||||
export function OpenEMLWindow(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function OpenFolderInExplorer(arg1:string):Promise<void>;
|
||||
|
||||
export function OpenImage(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function OpenImageWindow(arg1:string,arg2:string):Promise<void>;
|
||||
@@ -34,8 +60,12 @@ export function OpenPDF(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function OpenPDFWindow(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function OpenURLInBrowser(arg1:string):Promise<void>;
|
||||
|
||||
export function QuitApp():Promise<void>;
|
||||
|
||||
export function ReadAuto(arg1:string):Promise<internal.EmailData>;
|
||||
|
||||
export function ReadEML(arg1:string):Promise<internal.EmailData>;
|
||||
|
||||
export function ReadMSG(arg1:string,arg2:boolean):Promise<internal.EmailData>;
|
||||
@@ -46,4 +76,16 @@ export function ReadPEC(arg1:string):Promise<internal.EmailData>;
|
||||
|
||||
export function SaveConfig(arg1:utils.Config):Promise<void>;
|
||||
|
||||
export function SaveScreenshot():Promise<string>;
|
||||
|
||||
export function SaveScreenshotAs():Promise<string>;
|
||||
|
||||
export function SetCurrentMailFilePath(arg1:string):Promise<void>;
|
||||
|
||||
export function SetUpdateCheckerEnabled(arg1:boolean):Promise<void>;
|
||||
|
||||
export function ShowOpenFileDialog():Promise<string>;
|
||||
|
||||
export function SubmitBugReport(arg1:main.BugReportInput):Promise<main.SubmitBugReportResult>;
|
||||
|
||||
export function TakeScreenshot():Promise<main.ScreenshotResult>;
|
||||
|
||||
@@ -2,10 +2,34 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export function CheckForUpdates() {
|
||||
return window['go']['main']['App']['CheckForUpdates']();
|
||||
}
|
||||
|
||||
export function CheckIsDefaultEMLHandler() {
|
||||
return window['go']['main']['App']['CheckIsDefaultEMLHandler']();
|
||||
}
|
||||
|
||||
export function ConvertToUTF8(arg1) {
|
||||
return window['go']['main']['App']['ConvertToUTF8'](arg1);
|
||||
}
|
||||
|
||||
export function CreateBugReportFolder() {
|
||||
return window['go']['main']['App']['CreateBugReportFolder']();
|
||||
}
|
||||
|
||||
export function DetectEmailFormat(arg1) {
|
||||
return window['go']['main']['App']['DetectEmailFormat'](arg1);
|
||||
}
|
||||
|
||||
export function DownloadUpdate() {
|
||||
return window['go']['main']['App']['DownloadUpdate']();
|
||||
}
|
||||
|
||||
export function ExportSettings(arg1) {
|
||||
return window['go']['main']['App']['ExportSettings'](arg1);
|
||||
}
|
||||
|
||||
export function FrontendLog(arg1, arg2) {
|
||||
return window['go']['main']['App']['FrontendLog'](arg1, arg2);
|
||||
}
|
||||
@@ -14,6 +38,10 @@ export function GetConfig() {
|
||||
return window['go']['main']['App']['GetConfig']();
|
||||
}
|
||||
|
||||
export function GetCurrentMailFilePath() {
|
||||
return window['go']['main']['App']['GetCurrentMailFilePath']();
|
||||
}
|
||||
|
||||
export function GetImageViewerData() {
|
||||
return window['go']['main']['App']['GetImageViewerData']();
|
||||
}
|
||||
@@ -30,10 +58,30 @@ export function GetStartupFile() {
|
||||
return window['go']['main']['App']['GetStartupFile']();
|
||||
}
|
||||
|
||||
export function GetUpdateStatus() {
|
||||
return window['go']['main']['App']['GetUpdateStatus']();
|
||||
}
|
||||
|
||||
export function GetViewerData() {
|
||||
return window['go']['main']['App']['GetViewerData']();
|
||||
}
|
||||
|
||||
export function ImportSettings() {
|
||||
return window['go']['main']['App']['ImportSettings']();
|
||||
}
|
||||
|
||||
export function InstallUpdate(arg1) {
|
||||
return window['go']['main']['App']['InstallUpdate'](arg1);
|
||||
}
|
||||
|
||||
export function InstallUpdateSilent() {
|
||||
return window['go']['main']['App']['InstallUpdateSilent']();
|
||||
}
|
||||
|
||||
export function InstallUpdateSilentFromPath(arg1) {
|
||||
return window['go']['main']['App']['InstallUpdateSilentFromPath'](arg1);
|
||||
}
|
||||
|
||||
export function IsDebuggerRunning() {
|
||||
return window['go']['main']['App']['IsDebuggerRunning']();
|
||||
}
|
||||
@@ -46,6 +94,10 @@ export function OpenEMLWindow(arg1, arg2) {
|
||||
return window['go']['main']['App']['OpenEMLWindow'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function OpenFolderInExplorer(arg1) {
|
||||
return window['go']['main']['App']['OpenFolderInExplorer'](arg1);
|
||||
}
|
||||
|
||||
export function OpenImage(arg1, arg2) {
|
||||
return window['go']['main']['App']['OpenImage'](arg1, arg2);
|
||||
}
|
||||
@@ -62,10 +114,18 @@ export function OpenPDFWindow(arg1, arg2) {
|
||||
return window['go']['main']['App']['OpenPDFWindow'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function OpenURLInBrowser(arg1) {
|
||||
return window['go']['main']['App']['OpenURLInBrowser'](arg1);
|
||||
}
|
||||
|
||||
export function QuitApp() {
|
||||
return window['go']['main']['App']['QuitApp']();
|
||||
}
|
||||
|
||||
export function ReadAuto(arg1) {
|
||||
return window['go']['main']['App']['ReadAuto'](arg1);
|
||||
}
|
||||
|
||||
export function ReadEML(arg1) {
|
||||
return window['go']['main']['App']['ReadEML'](arg1);
|
||||
}
|
||||
@@ -86,6 +146,30 @@ export function SaveConfig(arg1) {
|
||||
return window['go']['main']['App']['SaveConfig'](arg1);
|
||||
}
|
||||
|
||||
export function SaveScreenshot() {
|
||||
return window['go']['main']['App']['SaveScreenshot']();
|
||||
}
|
||||
|
||||
export function SaveScreenshotAs() {
|
||||
return window['go']['main']['App']['SaveScreenshotAs']();
|
||||
}
|
||||
|
||||
export function SetCurrentMailFilePath(arg1) {
|
||||
return window['go']['main']['App']['SetCurrentMailFilePath'](arg1);
|
||||
}
|
||||
|
||||
export function SetUpdateCheckerEnabled(arg1) {
|
||||
return window['go']['main']['App']['SetUpdateCheckerEnabled'](arg1);
|
||||
}
|
||||
|
||||
export function ShowOpenFileDialog() {
|
||||
return window['go']['main']['App']['ShowOpenFileDialog']();
|
||||
}
|
||||
|
||||
export function SubmitBugReport(arg1) {
|
||||
return window['go']['main']['App']['SubmitBugReport'](arg1);
|
||||
}
|
||||
|
||||
export function TakeScreenshot() {
|
||||
return window['go']['main']['App']['TakeScreenshot']();
|
||||
}
|
||||
|
||||
@@ -242,6 +242,44 @@ export namespace internal {
|
||||
|
||||
export namespace main {
|
||||
|
||||
export class BugReportInput {
|
||||
name: string;
|
||||
email: string;
|
||||
description: string;
|
||||
screenshotData: string;
|
||||
localStorageData: string;
|
||||
configData: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new BugReportInput(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.name = source["name"];
|
||||
this.email = source["email"];
|
||||
this.description = source["description"];
|
||||
this.screenshotData = source["screenshotData"];
|
||||
this.localStorageData = source["localStorageData"];
|
||||
this.configData = source["configData"];
|
||||
}
|
||||
}
|
||||
export class BugReportResult {
|
||||
folderPath: string;
|
||||
screenshotPath: string;
|
||||
mailFilePath: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new BugReportResult(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.folderPath = source["folderPath"];
|
||||
this.screenshotPath = source["screenshotPath"];
|
||||
this.mailFilePath = source["mailFilePath"];
|
||||
}
|
||||
}
|
||||
export class ImageViewerData {
|
||||
data: string;
|
||||
filename: string;
|
||||
@@ -270,6 +308,70 @@ export namespace main {
|
||||
this.filename = source["filename"];
|
||||
}
|
||||
}
|
||||
export class ScreenshotResult {
|
||||
data: string;
|
||||
width: number;
|
||||
height: number;
|
||||
filename: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ScreenshotResult(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.data = source["data"];
|
||||
this.width = source["width"];
|
||||
this.height = source["height"];
|
||||
this.filename = source["filename"];
|
||||
}
|
||||
}
|
||||
export class SubmitBugReportResult {
|
||||
zipPath: string;
|
||||
folderPath: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new SubmitBugReportResult(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.zipPath = source["zipPath"];
|
||||
this.folderPath = source["folderPath"];
|
||||
}
|
||||
}
|
||||
export class UpdateStatus {
|
||||
currentVersion: string;
|
||||
availableVersion: string;
|
||||
updateAvailable: boolean;
|
||||
checking: boolean;
|
||||
downloading: boolean;
|
||||
downloadProgress: number;
|
||||
ready: boolean;
|
||||
installerPath: string;
|
||||
errorMessage: string;
|
||||
releaseNotes?: string;
|
||||
lastCheckTime: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new UpdateStatus(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.currentVersion = source["currentVersion"];
|
||||
this.availableVersion = source["availableVersion"];
|
||||
this.updateAvailable = source["updateAvailable"];
|
||||
this.checking = source["checking"];
|
||||
this.downloading = source["downloading"];
|
||||
this.downloadProgress = source["downloadProgress"];
|
||||
this.ready = source["ready"];
|
||||
this.installerPath = source["installerPath"];
|
||||
this.errorMessage = source["errorMessage"];
|
||||
this.releaseNotes = source["releaseNotes"];
|
||||
this.lastCheckTime = source["lastCheckTime"];
|
||||
}
|
||||
}
|
||||
export class ViewerData {
|
||||
imageData?: ImageViewerData;
|
||||
pdfData?: PDFViewerData;
|
||||
@@ -717,6 +819,10 @@ export namespace utils {
|
||||
SDKDecoderReleaseChannel: string;
|
||||
GUISemver: string;
|
||||
GUIReleaseChannel: string;
|
||||
Language: string;
|
||||
UpdateCheckEnabled: string;
|
||||
UpdatePath: string;
|
||||
UpdateAutoCheck: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new EMLyConfig(source);
|
||||
@@ -728,6 +834,10 @@ export namespace utils {
|
||||
this.SDKDecoderReleaseChannel = source["SDKDecoderReleaseChannel"];
|
||||
this.GUISemver = source["GUISemver"];
|
||||
this.GUIReleaseChannel = source["GUIReleaseChannel"];
|
||||
this.Language = source["Language"];
|
||||
this.UpdateCheckEnabled = source["UpdateCheckEnabled"];
|
||||
this.UpdatePath = source["UpdatePath"];
|
||||
this.UpdateAutoCheck = source["UpdateAutoCheck"];
|
||||
}
|
||||
}
|
||||
export class Config {
|
||||
|
||||
Reference in New Issue
Block a user