export type BackgroundMode = 'scene' | 'wallpaper' | 'off'; export type WallpaperFit = 'cover' | 'contain' | 'tile'; export type WallpaperPosition = 'center' | 'top' | 'bottom' | 'left' | 'right'; export type SurfaceRegionKey = 'sidebar' | 'conversation' | 'composer' | 'right'; export interface SurfaceSettings { enabled: boolean; sidebar: number; conversation: number; composer: number; right: number; } export type SceneParamValue = number | string | boolean | string[]; export type SceneParamMap = Record; export interface AppearanceSettings { version: number; enabled: boolean; mode: BackgroundMode; scene: string; wallpaperId: string | null; wallpaperFit: WallpaperFit; wallpaperPosition: WallpaperPosition; surfaces: SurfaceSettings; sceneParams: Record; dim: number; blur: number; savedAt: number; } export interface WallpaperItem { id: string; name: string; mime: string; size: number; mtimeMs?: number; url: string; } export interface StateResponse { ok: boolean; settings: AppearanceSettings; defaults: AppearanceSettings; scenes: string[]; wallpapers: WallpaperItem[]; } export interface SceneField { key: string; zh: string; en: string; group?: string; hint?: string; hintZh?: string; min: number; max: number; step: number; unit?: string; precision?: number; percent?: boolean; } export interface SceneColorField { key: string; zh: string; en: string; group?: string; } export interface SceneToggle { key: string; zh: string; en: string; group?: string; } export interface SceneGroupDef { key: string; en: string; zh: string; keys: string[]; } export interface SceneSchema { storeKey: string; panelKind?: 'grouped-reset' | 'shallow-ocean'; qualityDefault?: string; groups?: SceneGroupDef[]; fields: SceneField[]; transformFields?: SceneField[]; colors?: string[]; colorFields: SceneColorField[]; toggles: SceneToggle[]; defaults: Record; presets?: Record>; } export interface OceanEventJournalState { discovered: string[]; excluded: string[]; } export interface SceneMeta { id: string; label: string; en: string; cardTitle: string; icon: string; ext: string; layerBg: string; bgColorKey?: string; storeKey: string; } export interface VendorRendererInstance { ready?: Promise; setSettings?: (settings: Record) => void; updateSettings?: (settings: Record) => void; setRenderSettings?: (settings: Record) => void; replay?: () => void; replayOpening?: () => void; reset?: () => void; dispose?: () => void; // pixel-sculpt setActive?: (active: boolean, opts?: { paused?: boolean }) => void; mountControls?: (host: HTMLElement, lang?: string) => void; // shallow-ocean addCreature?: (kind: string, u?: number, v?: number) => void | Promise; previewEvent?: (kind: string) => void; action?: (action: string) => void; diagnostics?: { parameters?: Record } | null; } export interface VendorModuleEntry { id: string; api: number; version: string; prepareDefaults?: () => Promise; exports?: Record; startup: (target: HTMLElement, onError: (msg?: string) => void) => VendorRendererInstance; }