/** * Scene JSON serialize / deserialize. * Module widgets stay as `{ type, props }` leaves — never expand into visual primitives. */ import type { App } from '../App'; import type { Node } from '../Node'; import type { SceneJSON } from '../types'; import { Group } from '../shapes/Group'; type NodeFactory = (props: Record, app: App) => Node; /** Options for module-aware scene serialization. */ export interface ToJSONOptions { /** * Drop identity transforms, empty arrays, null/undefined, and non-JSON metadata. * Opt-in so existing full dumps keep working. */ compact?: boolean; } export declare function registerJSONType(type: string, factory: NodeFactory): void; export declare function fromJSON(json: SceneJSON, app: App): Node; /** Strip defaults / non-JSON noise from a SceneJSON tree (does not mutate input). */ export declare function compactSceneJSON(json: SceneJSON): SceneJSON; /** * Serialize a node for authoring / `loadJSON` round-trip. * UI, dashboard, automotive, and diagram roots stay opaque `{ type, props }` leaves. * Plain groups recurse with the same rules (fixes stage `exportJSON` expansion). */ export declare function toJSON(node: Node, options?: ToJSONOptions): SceneJSON; /** * True when a root `group` is only a bag of children (identity transform, no module type). * Used by `loadJSON` to place children on the stage instead of nesting an extra group. */ export declare function isHoistableRootGroup(node: Node): node is Group; /** Authoring-shaped export of stage contents (not the stage node itself). */ export declare function exportStageJSON(stage: Group, options?: ToJSONOptions): SceneJSON; export {};