export const EDITOR_SCENE_STYLE_PRESETS = { ANIME: { value: 'anime', label: '日系动画', description: '细腻光影、动画感构图', }, WATERCOLOR: { value: 'watercolor', label: '清透水彩', description: '通透纸感、柔和自然晕染', }, FLAT: { value: 'flat', label: '平面几何', description: '清晰色块、简化形体与轮廓', }, STOP_MOTION: { value: 'stop-motion', label: '定格模型', description: '实体模型质感、微缩布景光影', }, CUSTOM: { value: 'custom', label: '自定义', description: '填写具体画风', }, } as const; type EditorSceneStylePresetDefinition = (typeof EDITOR_SCENE_STYLE_PRESETS)[keyof typeof EDITOR_SCENE_STYLE_PRESETS]; export type EditorSceneStylePreset = EditorSceneStylePresetDefinition['value']; export const EDITOR_SCENE_STYLE_PRESET_OPTIONS = Object.values( EDITOR_SCENE_STYLE_PRESETS, ); export const DEFAULT_EDITOR_SCENE_STYLE_PRESET = EDITOR_SCENE_STYLE_PRESETS.ANIME.value; export const CUSTOM_EDITOR_SCENE_STYLE_PRESET = EDITOR_SCENE_STYLE_PRESETS.CUSTOM.value; export function isEditorSceneStylePreset( value: unknown, ): value is EditorSceneStylePreset { return EDITOR_SCENE_STYLE_PRESET_OPTIONS.some( (preset) => preset.value === value, ); } export function getEditorSceneStylePresetLabel(value: EditorSceneStylePreset) { return ( EDITOR_SCENE_STYLE_PRESET_OPTIONS.find((preset) => preset.value === value) ?.label ?? EDITOR_SCENE_STYLE_PRESETS.ANIME.label ); } export function resolveEditorSceneStylePresetByLabel( label: string | null | undefined, ): EditorSceneStylePreset { return ( EDITOR_SCENE_STYLE_PRESET_OPTIONS.find((preset) => preset.label === label) ?.value ?? DEFAULT_EDITOR_SCENE_STYLE_PRESET ); } export type EditorSceneGenerationPlaceholder = { x: number; y: number; width: number; height: number; originalWidth: number; originalHeight: number; }; export type EditorSceneGenerationCompletion = { dialogId?: string; title: string; placeholder: EditorSceneGenerationPlaceholder; }; export type EditorSceneGenerationInputField = { title: string; value: string; }; export type EditorSceneGenerationInputReference = { title: string; label: string; refType: 'project-resource' | 'asset'; refId: string; }; export type EditorSceneGenerationInputs = { fields: EditorSceneGenerationInputField[]; references: EditorSceneGenerationInputReference[]; }; export type EditorSceneGenerationRequest = { sceneContent: string; stylePreset: EditorSceneStylePreset; customStyle?: string | null; model?: string; aspectRatio?: string; imageSize?: string; referenceImageSrcs?: string[]; projectId?: string | null; generationInputs?: EditorSceneGenerationInputs | null; assetFolderId?: string | null; assetLabel?: string | null; canvasCompletion?: EditorSceneGenerationCompletion | null; };