import { Group, Layer } from './shapes/Group'; import './registry/initCore'; import { EventEmitter } from './core/EventEmitter'; import { Camera } from './camera/Camera'; import type { Renderer } from './renderers/Renderer'; import { Timeline } from './animation/Timeline'; import type { AppOptions, HitTestResult, SceneJSON, Plugin, AnimationOptions } from './types'; import type { Node } from './Node'; import { Rect, Circle, Ellipse, Line, Arc, Polygon, Polyline, Path, Star, RoundedRect, TextNode, ImageNode, Sprite } from './shapes/index'; import type { ExportFormat, ExportOptions, ExportResult } from './io/exportTypes'; import type { LightDrawStatic } from './types'; import { AnimationEngine } from './animation/Animation'; import { type UiThemeInput, type UiThemeTokens } from './components/uiTheme'; import { type ThemePack } from './theme/themePack'; export declare class App extends EventEmitter { readonly camera: Camera; readonly stage: Group; private container; private renderer; private width; private height; private pixelRatio; private background; /** Background from createApp options — restored when theme has no stage BG. */ private defaultBackground; private eventManager; private renderScheduled; private renderFrameId; private autoResize; private resizeHandler; private readonly perf; private spatialIndex; private nodeCount; private highContrast; /** Merged theme pack (preset + brand tokens + optional module packs). */ private uiTheme; /** Flat resolved brand tokens — source of truth for UI remap (Phase 1+). */ private resolvedUiTheme; /** Module packs stored alongside brand tokens. */ private themeModules; /** True when app `fontSize` changed automotive typography scale (rebuild HMI). */ private automotiveFontScaleDirty; constructor(container: string | HTMLElement, options?: AppOptions); private applyPerformanceOptions; private createRenderer; rect(options?: ConstructorParameters[0]): Rect; circle(options?: ConstructorParameters[0]): Circle; ellipse(options?: ConstructorParameters[0]): Ellipse; line(options?: ConstructorParameters[0]): Line; arc(options?: ConstructorParameters[0]): Arc; polygon(options?: ConstructorParameters[0]): Polygon; polyline(options?: ConstructorParameters[0]): Polyline; path(options?: ConstructorParameters[0]): Path; star(options?: ConstructorParameters[0]): Star; roundedRect(options?: ConstructorParameters[0]): RoundedRect; text(options?: ConstructorParameters[0]): TextNode; image(options?: ConstructorParameters[0]): ImageNode; sprite(options?: ConstructorParameters[0]): Sprite; group(options?: ConstructorParameters[0]): Group; layer(options?: ConstructorParameters[0]): Layer; private attachApp; private createNode; add(...nodes: Node[]): this; /** Called from Node.markDirty — tracks dirty regions for partial canvas clears. */ markNodeDirty(node: Node): void; /** Called from Node.destroy — purge caches and spatial index entries. */ onNodeDestroyed(node: Node): void; timeline(): Timeline; animate(node: Node, options: AnimationOptions): ReturnType; getFocusedNode(): Node | null; isHighContrast(): boolean; setHighContrast(enabled: boolean): this; focusNode(node: Node | null): this; getFocusableNodes(): Node[]; requestRender(): void; render(): void; private updateSprites; hitTest(worldX: number, worldY: number): HitTestResult | null; resize(width?: number, height?: number): void; private handleResize; getSize(): { width: number; height: number; }; getPixelRatio(): number; getBackground(): string; /** Active renderer instance (used by export pipeline). */ getRenderer(): Renderer; /** Host DOM element passed to `createApp` / constructor. */ getContainer(): HTMLElement; setBackground(color: string): this; /** * Apply theme pack stage background, or restore pack surface / createApp default * when the theme no longer provides one (clears sticky image presets). */ private syncThemeBackground; /** Merged theme config as last set (includes optional `preset` + module packs). Additive Phase 1 API. */ getUiTheme(): ThemePack; /** Full theme pack (brand + series / dashboard / diagram / automotive). */ getTheme(): ThemePack; /** Flat resolved brand tokens after presets/overrides. Additive Phase 1 API. */ getResolvedTheme(): UiThemeTokens; /** * Apply a full theme pack from JSON or JS. * Default **replaces** the stored pack (clean preset switches). * Pass `{ merge: true }` to shallow-merge into the existing pack. */ applyTheme(pack: ThemePack | Record, options?: { merge?: boolean; }): this; /** * Update built-in UI theme tokens without custom stylesheets. * By default **merges** into existing config (omitted keys stick). * Pass `{ replace: true }` to replace the stored config entirely. * Accepts a full `ThemePack` (`series`, `dashboard`, `diagram`, `automotive`). * * Automotive widgets are intentionally **not** retinted here — they keep * `props.theme` presets (`classic` | `sport` | `digital`). See theme-architecture.md. */ setUiTheme(tokens: ThemePack | UiThemeInput, options?: { replace?: boolean; }): this; /** Reset theme config to `{}` (CSS / module defaults). Equivalent to `setUiTheme({}, { replace: true })`. */ clearUiTheme(): this; /** * Load a scene. If the JSON root includes `theme`, it is applied first * (replace) so widgets build under that palette. * Optional second arg: `{ theme }` when the scene file has no root theme. */ loadJSON(json: SceneJSON | string, options?: { theme?: ThemePack | Record; }): Node | Group; /** Export scene. Pass `{ includeTheme: true }` to embed the current theme pack. */ exportJSON(options?: { includeTheme?: boolean; compact?: boolean; }): SceneJSON; /** Ingest pack into uiTheme + themeModules and re-resolve (no emit). */ private ingestThemePack; /** Apply resolved theme to renderer + live widgets and emit themechange. */ private publishTheme; /** Export scene — unified options object or legacy format string. */ export(options: ExportOptions): ExportResult; export(format: ExportFormat): string | SceneJSON | Uint8Array; toDataURL(type?: string, quality?: number): string; /** Remove all nodes from the scene (keeps the App instance). */ clear(): this; destroy(): void; static use(plugin: Plugin, LightDrawRef?: LightDrawStatic): void; }