/** * A custom element that renders Hydra sketches. * @extends HTMLElement */ export declare class HydraElement extends HTMLElement { #private; /** * Overridable engine factory (test seam). * @type {(options: import('./options.js').HydraOptions) => any} */ static hydraFactory: (options: import('./options.js').HydraOptions) => any; /** * Attributes the element reacts to. * @returns {string[]} */ static get observedAttributes(): string[]; constructor(); /** * The hydra-synth DSL instance, or `undefined` before init / after destroy. * @returns {unknown} */ get synth(): unknown; /** * Resolves once Hydra is initialized with `{ synth }`. * @returns {Promise<{ synth: unknown }>} */ get ready(): Promise<{ synth: unknown; }>; /** * The persistent eval scope (bare assignments, bound values, and `loadScript` survive engine resets). * @returns {Object} */ get scope(): Object; /** * Binds a static value into the eval scope; the bound name wins over live engine-owned reads (`time`, `width`, `height`, `speed`, …). * @param {string} name * @param {unknown} value */ bind(name: string, value: unknown): void; /** * Binds a live getter into the eval scope, re-read on every access (a sketch assignment replaces it). * @param {string} name * @param {() => any} provider */ bindLive(name: string, provider: () => any): void; /** * Removes a previously bound value or provider from the eval scope. * @param {string} name */ unbind(name: string): void; /** * Captures the next rendered frame as a PNG blob. * @returns {Promise} */ capture(): Promise; /** * The canvas element backing the render. * @returns {HTMLCanvasElement | null} */ get canvas(): HTMLCanvasElement | null; /** @param {HTMLCanvasElement} value */ set canvas(value: HTMLCanvasElement); /** * The custom GLSL transforms. * @returns {Array} */ get transforms(): Array; /** @param {Array} value */ set transforms(value: Array); /** * The rtc-patch-bay instance for streaming. * @returns {Object} */ get pb(): Object; /** @param {Object} value */ set pb(value: Object); /** * The scene code. * @returns {string} */ get code(): string; /** * Sets the code and evaluates it. * @param {string} value */ set code(value: string); /** Tears the element down (loop, sources, engine) without removing it from the DOM. */ destroy(): void; /** * Loads an extension script into the element's eval scope, dispatching `hydra-loadscript` and rethrowing on failure. * @param {string} url */ loadScript(url: string): Promise; /** * Folds an attribute change into the options, then reapplies or recreates. * @param {string} attrName * @param {string|null} oldValue * @param {string|null} newValue */ attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null): void; /** Initializes once on connect and evaluates the code. */ connectedCallback(): void; /** Tears the element down on removal; re-insertion re-initializes it. */ disconnectedCallback(): void; /** * Forwards a tick to the engine. * @param {number} dt */ tick(dt: number): void; }