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;