From 0f9e2f1737d731adc6369e38648de0f7c37a3db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 24 Sep 2026 16:10:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E8=AE=BE=E8=AE=A1=E5=9B=BE=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E5=BB=BA=E6=A8=A1=E6=88=90=20assetId=20=E4=B8=8E=20pa?= =?UTF-8?q?th=20=E4=BA=8C=E9=80=89=E4=B8=80=E7=9A=84=E8=81=94=E5=90=88?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/features/ui-editor/uiDesignResourceBridge.ts 的 UiDesignDocImageReference 改为判别联合:原先两个字段都可选,`{}` 或两个都给要等到 Rust 运行时才被判错 --- .../src/features/ui-editor/uiDesignResourceBridge.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/uiDesignResourceBridge.ts b/apps/ai-game-creator-shell/src/features/ui-editor/uiDesignResourceBridge.ts index d53c19ab2..459155ee0 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/uiDesignResourceBridge.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/uiDesignResourceBridge.ts @@ -3,11 +3,13 @@ import type { GameCreationAppManifest, } from '../../../../../packages/shared/src/contracts/gameCreationApp'; -/** 一张设计图的输入引用:给已登记资源的 assetId,或给项目内相对路径。 */ -export type UiDesignDocImageReference = { - assetId?: string; - path?: string; -}; +/** + * 一张设计图的输入引用:给已登记资源的 assetId,或给项目内相对路径。 + * 两者只能二选一,与 Rust 侧 `每张设计图必须且只能给 assetId 或 path` 的判据一致。 + */ +export type UiDesignDocImageReference = + | { assetId: string; path?: never } + | { assetId?: never; path: string }; export type UiDesignDocCreated = { asset: GameCreationAppAssetManifestEntry;