feat: 实现 Web 与 Desktop DOCX 导出交互
This commit is contained in:
Vendored
+24
@@ -1,6 +1,11 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
import type {
|
||||
DocxCapability,
|
||||
DocxExportDiagnostics,
|
||||
DocxExportErrorCode,
|
||||
DocxExportRequestInput,
|
||||
DocxGenerationTimings,
|
||||
DocxMediaCapturePlan,
|
||||
PagedDocumentPayload,
|
||||
PagedDocumentRenderResult,
|
||||
@@ -19,6 +24,21 @@ declare global {
|
||||
mermaidErrors: string[];
|
||||
}
|
||||
|
||||
type DesktopDocxExportOutcome =
|
||||
| {
|
||||
ok: true;
|
||||
saved: boolean;
|
||||
fileName: string;
|
||||
diagnostics: DocxExportDiagnostics;
|
||||
timings: DocxGenerationTimings;
|
||||
}
|
||||
| {
|
||||
ok: false;
|
||||
error: DocxExportErrorCode;
|
||||
message: string;
|
||||
retryable: boolean;
|
||||
};
|
||||
|
||||
interface DesktopApplicationBridge {
|
||||
openMarkdown(): Promise<
|
||||
| {
|
||||
@@ -77,6 +97,10 @@ declare global {
|
||||
getThemeCss(themeId: string): Promise<string>;
|
||||
generatePdf(payload: PagedDocumentPayload): Promise<DesktopPdfResult>;
|
||||
savePdf(fileName: string, pdf: Uint8Array): Promise<boolean>;
|
||||
getDocxCapability(): Promise<DocxCapability>;
|
||||
exportDocx(
|
||||
request: DocxExportRequestInput
|
||||
): Promise<DesktopDocxExportOutcome>;
|
||||
}
|
||||
|
||||
interface DesktopPdfRuntimeBridge {
|
||||
|
||||
Reference in New Issue
Block a user