import type { PrecompiledManifest, ShaderCoverage, ShaderRegistrationKind } from './types.cjs'; /** Symbol-keyed, devtools-only observer. No capture implementation ships in this module. */ export declare const SHADER_CAPTURE_CACHE_HOOK: unique symbol; /** Last application cache to register or activate a scene, shared across package copies. */ export declare const SHADER_CAPTURE_CACHE_VALUE: unique symbol; export type ShaderCaptureCacheHook = (cache: ShaderCache) => void; export interface ShaderRegistrationOptions { /** Defaults to the cache's active scene. */ readonly scene?: string; /** Explicit HMR replacement. Replacements invalidate this key for the session. */ readonly replace?: boolean; } export interface ShaderInvalidation { readonly scene: string; readonly key?: string; readonly reason: string; } export interface ShaderRegistrationHandle { readonly scene: string; readonly key: string; readonly kind: ShaderRegistrationKind | 'container'; dispose(): void; } export interface ShaderSceneCacheOptions { /** Replace registrations left by the previous scene on each key's first use. */ readonly replaceExisting?: boolean; } export interface ShaderAutomaticRegistrationOptions { /** Defaults to the cache's active scene. */ readonly scene?: string; /** Human-readable key prefix. Defaults to `auto`. */ readonly prefix?: string; } export interface ShaderRegistration { readonly scene: string; readonly key: string; readonly kind: ShaderRegistrationKind; /** True only for registrations synthesized by gallery/devtools discovery. */ readonly automatic?: boolean; /** Material for render registrations, compute root for compute registrations. */ readonly target: object; /** Original pipeline for pipeline registrations; otherwise the target. */ readonly owner: object; } export interface ShaderContainerRegistration { readonly scene: string; readonly key: string; readonly target: object; } /** Scene-local convenience facade. */ export declare class ShaderSceneCache { #private; readonly scene: string; constructor(cache: ShaderCache, scene: string, options?: ShaderSceneCacheOptions); material(key: string, material: object, options?: Omit): ShaderRegistrationHandle; pipeline(key: string, pipeline: object, options?: Omit): ShaderRegistrationHandle; compute(key: string, computeNode: object, options?: Omit): ShaderRegistrationHandle; container(key: string, container: object, options?: Omit): ShaderRegistrationHandle; invalidateKey(key: string, reason?: string): void; invalidate(reason?: string): void; } /** * Stable, scene-scoped shader registration. No renderer or Vite hooks are installed by * construction; worker setup opts into those through `installShaderCache()`. */ export declare class ShaderCache { #private; constructor(activeScene?: string); get activeScene(): string; activateScene(scene: string): ShaderSceneCache; forScene(scene: string, options?: ShaderSceneCacheOptions): ShaderSceneCache; /** * Opt a scene into deterministic build-order registrations. * * This is intended for generated galleries and other closed build matrices where the * capture and production routes execute the same bundle. Applications should continue * to prefer explicit semantic keys through material(), pipeline(), and compute(). */ enableAutomaticRegistration(options?: ShaderAutomaticRegistrationOptions): void; /** Prefix currently governing deterministic automatic keys for one scene. */ automaticRegistrationPrefix(scene?: string): string | undefined; material(key: string, material: object, options?: ShaderRegistrationOptions): ShaderRegistrationHandle; pipeline(key: string, pipeline: object, options?: ShaderRegistrationOptions): ShaderRegistrationHandle; /** Compatibility spelling for the integration lab's former `post()` API. */ post(key: string, pipeline: object, options?: ShaderRegistrationOptions): ShaderRegistrationHandle; compute(key: string, computeNode: object, options?: ShaderRegistrationOptions): ShaderRegistrationHandle; container(key: string, container: object, options?: ShaderRegistrationOptions): ShaderRegistrationHandle; registrationForRender(material: object, scene?: string, renderObject?: object): ShaderRegistration | undefined; registrationForCompute(computeNode: object, scene?: string): ShaderRegistration | undefined; registration(key: string, scene?: string): ShaderRegistration | undefined; containerFor(key: string, scene?: string): object | undefined; /** Read-only capture view of explicitly registered non-node containers. */ containers(scene?: string): readonly ShaderContainerRegistration[]; registrations(scene?: string): readonly ShaderRegistration[]; invalidateKey(key: string, reason?: string, scene?: string): void; invalidateScene(scene?: string, reason?: string): void; invalidationFor(key: string, scene?: string): ShaderInvalidation | undefined; coverage(manifest: PrecompiledManifest, scene?: string): ShaderCoverage; } export declare function createShaderCache(activeScene?: string): ShaderCache; /** Optional shared registry for concise generated-app registration. */ export declare const shaderCache: ShaderCache;