fix(*): Web 构建 - 修复短剧项目空间合并后的 TypeScript 类型错误

This commit is contained in:
ddCat committed 2026-07-27 11:14:16 +08:00
1 parent d305a837b8
commit 38ae16cbb5
15 files changed
+63 -55

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ export async function exportCanvasProjects(projects: CanvasProject[], fileName =
zipFiles.push({ name: path, data: blob });
}),
);
const drawingDocuments = (await Promise.all(project.nodes.filter((node) => node.type === "drawing" && node.metadata?.drawingId).map(async (node) => {
const drawingDocuments = (await Promise.all(project.nodes.filter((node) => node.type === "drawing" && node.metadata?.drawingId).map(async (node): Promise<CanvasDrawingExport | null> => {
const drawingId = node.metadata?.drawingId;
if (!drawingId) return null;
const [saved, preview, render] = await Promise.all([
@@ -43,7 +43,7 @@ export async function exportCanvasProjects(projects: CanvasProject[], fileName =
? { path: generationRenderPath, pageId: render.pageId, width: render.width, height: render.height, mimeType: render.mimeType, background: render.background }
: undefined,
} satisfies CanvasDrawingExport;
}))).filter((item): item is CanvasDrawingExport => Boolean(item));
}))).filter((item): item is CanvasDrawingExport => item !== null);
drawingDocuments.forEach((document) => zipFiles.push({ name: `projects/${project.id}/drawings/${safeFileName(document.drawingId)}.json`, data: JSON.stringify(document) }));
return { project, files, drawingDocuments };
}),