import { PresetMode, PresetName, PresetTheme } from '../presets'; import { DeformFn, DeformLayers, MaskFn, MetalFxInstance } from './core'; interface CreateInstanceOptions { hostCanvas: HTMLCanvasElement; cssWidth: number; cssHeight: number; cornerRadius: number; kind: 'pill' | 'circle'; shaderScale?: number; ringCssPx?: number; opacityMul?: number; glowGain?: number; paused?: boolean; scale?: number; onAfterFrame?: () => void; onComposite?: () => void; onFirstCopy?: () => void; mask?: MaskFn | null; } export declare function createInstance(opts: CreateInstanceOptions): MetalFxInstance; export declare function destroyInstance(inst: MetalFxInstance): void; export declare function registerGlowInstance(inst: MetalFxInstance): void; export declare function unregisterGlowInstance(inst: MetalFxInstance): void; export declare function updateInstance(inst: MetalFxInstance, patch: Partial>): void; export declare function setInstanceVisible(inst: MetalFxInstance, visible: boolean): void; /** * Attach (or clear) a vector deformation to the instance that owns `canvas`. * `overscan` grows the canvas by that many CSS px on every side so outward * bulges aren't clipped. Redraws immediately so a paused instance updates. */ export declare function setInstanceDeform(canvas: HTMLCanvasElement, deform: DeformFn | null, layers?: DeformLayers | null, overscan?: number): boolean; /** Re-rasterise an instance after the devicePixelRatio changed (browser * zoom, a display switch). The CSS box is unchanged, so no ResizeObserver * fires; without this the canvas stays at the old backing resolution. */ export declare function refreshInstanceDpr(inst: MetalFxInstance): boolean; /** Re-composite one instance now — for callers driving `deform` per frame at * a higher rate than the shared 15 fps loop. */ export declare function redrawInstance(canvas: HTMLCanvasElement): void; export declare function setSharedPreset(name: PresetName, theme: PresetTheme): void; /** * Push raw Paper liquidMetal parameters into the shared renderer, bypassing * the named presets. Pass `null` to hand control back to `preset` / `theme`. * * This exists for the playground: every instance shares one GL program, so * tuning is necessarily global rather than per-instance. */ export declare function setSharedPresetMode(mode: PresetMode | null): void; /** The preset the shared renderer is currently drawing with, or null before * any instance has mounted. Read-only snapshot — mutate via the setters. */ export declare function getSharedPreset(): PresetMode | null; export declare function pauseShared(): void; export declare function resumeShared(): void; export declare function getSharedFrameCount(): number; /** Returns true when the glow wants per-frame ticks (mid-fade). */ export type GlowCallback = (inst: MetalFxInstance, nowMs: number) => boolean | void; export declare function setGlowCallback(cb: GlowCallback | null): void; /** Run one glow update for an instance now — for drivers (cursor light) that * need the hotspot to move at pointer rate rather than the shared 15 fps. */ export declare function tickInstanceGlow(inst: MetalFxInstance, nowMs: number): void; export {};