/** One showIf condition: compare a (state) field's value against `value`. */ export interface ConfigFieldCondition { field?: string; operator?: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'empty' | 'notEmpty' | 'in' | 'notIn' | null; value?: unknown; } /** All conditions inside `and` must match; top-level conditions are OR-ed. */ export interface ConfigFieldConditionAnd { and: ConfigFieldCondition[]; } export type ShowIfCondition = ConfigFieldCondition | ConfigFieldConditionAnd; /** * One choice of a 'select' field: a plain string (the value doubles as the label), * or an explicit pair when the stored value and the text shown differ. */ export type SelectFieldOption = string | { value: string; label: string; }; /** A scene state field, as found in a scene JSON's `fields` array. */ export interface StateField { name: string; label?: string; type?: string; value?: unknown; options?: SelectFieldOption[]; placeholder?: string; required?: boolean; secret?: boolean; persist?: 'memory' | 'disk'; access?: 'private' | 'public'; showIf?: ShowIfCondition[]; } export interface SceneNode { id?: string; type?: string; data?: Record & { keyword?: string; config?: Record; }; } /** A FrameOS scene as exported in scenes.json / template zips. */ export interface FrameOSScene { id: string; name?: string; nodes?: SceneNode[]; edges?: unknown[]; fields?: StateField[]; settings?: Record; default?: boolean; [key: string]: unknown; } /** frameos_wasm_scene_info() payload, sent with the worker's `ready` message. */ export interface SceneInfo { loaded: number; currentSceneId: string; currentSceneName: string; defaultSceneId: string; renderRequested: boolean; scenes: { id: string; name: string; refreshInterval: number; }[]; } export interface PreviewFrame { width: number; height: number; renderMs: number; } /** One entry of the browser asset folder (the runtime's /srv/assets). */ export interface PreviewAssetEntry { /** Path relative to the folder root, e.g. `photos/beach.jpg`. */ path: string; /** Bytes; 0 for folders. */ size: number; /** Last modification, ms since the epoch. */ mtime: number; isDir: boolean; } /** How the runtime's /srv/assets is backed, sent with the worker's `ready` message. */ export interface PreviewAssetsInfo { /** False when the wasm bundle has no filesystem export at all. */ mounted: boolean; /** True when the folder is kept in this browser's IndexedDB between * previews; false when it lives in memory for this worker only. */ persistent: boolean; /** The folder's absolute path inside the runtime (`/srv/assets`). */ root: string; /** Size ceiling for the folder in bytes. */ maxBytes: number; } /** An interactive scene event (custom `event` node) usable as a button. */ export interface SceneEventButton { keyword: string; label: string | null; } /** Events every scene handles on its own; not useful as interactive buttons. */ export declare const LIFECYCLE_EVENTS: Set; /** The custom event nodes of a scene, deduplicated — render these as buttons. */ export declare function sceneEventButtons(scene: FrameOSScene | undefined | null): SceneEventButton[];