import type { ParamValues } from './scad-params.js'; import type { MultiPassConfig, RenderedPart, TextGlyphsConfig } from './protocol.js'; export interface OpenScadPreviewOptions { canvas: HTMLCanvasElement; /** URL of the .scad entry file (also fetched on the main thread to build the form). */ scadUrl: string; /** URL of the render worker (this package's src/worker.js, or a project-custom one). */ workerUrl: string | URL; /** Container the auto-generated form is rendered into. */ controlsEl?: HTMLElement; /** Text node updated with render status ("Rendering…", "Ready", errors). */ statusEl?: HTMLElement; /** Wired to trigger an STL download of the current render. */ downloadBtn?: HTMLButtonElement; /** localStorage key for persisting form values across reloads. */ storageKey?: string; /** Square build-plate grid/outline size in mm. */ bedSize?: number; backgroundColor?: number; /** Virtual FS path for the entry file inside the worker (default: derived from scadUrl). */ entryFsPath?: string; /** Extra `use ; /** Override the openscad-wasm CDN URL (defaults to a pinned version). */ wasmUrl?: string; textGlyphs?: (values: ParamValues) => TextGlyphsConfig | undefined; /** Non-null return triggers N colored render passes instead of one plain * pass — see the "Multi-part / colored output" section of the README. */ multiPass?: (values: ParamValues) => MultiPassConfig | null; timeoutSec?: number; debounceMs?: number; downloadName?: (values: ParamValues) => string; /** Fully override the default STL download behavior. */ onDownload?: (parts: RenderedPart[], values: ParamValues) => void; /** Receives worker debug/log lines. */ onLog?: (text: string) => void; loadingText?: string; renderingText?: string; readyText?: string; } export declare class OpenScadPreview { private opts; private viewer; private worker; private rendering; private pendingRender; private renderTimer; private lastParts; private form; private schema; constructor(opts: OpenScadPreviewOptions); private init; private setStatus; private onWorkerMessage; private finishRender; triggerRender(): void; scheduleRender(): void; /** Programmatically change form values (e.g. a "reset to defaults" button) and re-render. */ setValues(partial: Partial): void; download(): void; terminate(): void; }