/** * WASM artifact management for proof generation. * @remarks * Proof generation requires circuit artifacts that are typically large binary blobs. * This module provides: * - Type definitions for those artifact bundles * - A configurable loader with caching/priming support via {@link TeleportArtifactsManager} * * Call {@link configureTeleportArtifactsLoader} once during app initialization. */ export interface SingleTeleportWasmArtifacts { localPk: Uint8Array; localVk: Uint8Array; globalPk: Uint8Array; globalVk: Uint8Array; } export interface BatchTeleportWasmArtifacts { localPp: Uint8Array; localVp: Uint8Array; globalPp: Uint8Array; globalVp: Uint8Array; } export interface TeleportWasmArtifacts { single: SingleTeleportWasmArtifacts; batch: BatchTeleportWasmArtifacts; } export interface LoadTeleportArtifactsOptions { /** Optional custom fetch implementation (reserved for future use). */ fetchImpl?: typeof fetch; } /** * Loader for teleport artifacts. * @remarks * The loader may be sync or async. The SDK does not prescribe the source of artifacts * (e.g. CDN, local filesystem, bundler inlining). */ export type TeleportArtifactsLoader = (() => Promise) | (() => TeleportWasmArtifacts); /** * Manager for teleport WASM artifacts with caching support. * Handles loading and caching of single and batch teleport artifacts. */ export declare class TeleportArtifactsManager { private loader; private allPromise; private singlePromise; private batchPromise; /** * Configures the loader function for loading artifacts. * Clears any existing cache when reconfigured. */ configure(loader: TeleportArtifactsLoader): void; /** * Clears all cached artifacts. */ clearCache(): void; /** * Resets the manager to its initial state. * Useful for testing to ensure clean state between tests. */ reset(): void; /** * Returns true if a loader has been configured. */ isConfigured(): boolean; /** * Primes all artifact caches. */ primeAll(artifacts: TeleportWasmArtifacts): void; /** * Primes the single artifacts cache. */ primeSingle(artifacts: SingleTeleportWasmArtifacts): void; /** * Primes the batch artifacts cache. */ primeBatch(artifacts: BatchTeleportWasmArtifacts): void; /** * Loads all teleport artifacts. * @param _options Reserved for future use (e.g., custom fetchImpl). Kept for API consistency. * @throws Error if loader is not configured. * @remarks Use this to pre-warm caches at app startup. */ loadAll(_options?: LoadTeleportArtifactsOptions): Promise; /** * Loads single teleport artifacts. * @throws Error if loader is not configured. * @remarks This caches the resolved artifacts. */ loadSingle(options?: LoadTeleportArtifactsOptions): Promise; /** * Loads batch teleport artifacts. * @throws Error if loader is not configured. * @remarks This caches the resolved artifacts. */ loadBatch(options?: LoadTeleportArtifactsOptions): Promise; private requireLoader; private resolveAll; } /** * Configures the teleport artifacts loader. * Clears any existing cache when reconfigured. */ export declare function configureTeleportArtifactsLoader(loader: TeleportArtifactsLoader): void; /** * Clears all cached teleport artifacts. */ export declare function clearTeleportArtifactsCache(): void; /** * @deprecated Use clearTeleportArtifactsCache instead. */ export declare function clearTeleportArtifactCache(_url?: string): void; /** * Primes all teleport artifact caches. */ export declare function primeTeleportArtifacts(artifacts: TeleportWasmArtifacts): void; /** * Primes the single teleport artifacts cache. */ export declare function primeSingleTeleportArtifacts(artifacts: SingleTeleportWasmArtifacts): void; /** * Primes the batch teleport artifacts cache. */ export declare function primeBatchTeleportArtifacts(artifacts: BatchTeleportWasmArtifacts): void; /** * Loads all teleport artifacts. * @throws Error if loader is not configured. */ export declare function loadTeleportArtifacts(options?: LoadTeleportArtifactsOptions): Promise; /** * Loads single teleport artifacts. * @throws Error if loader is not configured. */ export declare function loadSingleTeleportArtifacts(options?: LoadTeleportArtifactsOptions): Promise; /** * Loads batch teleport artifacts. * @throws Error if loader is not configured. */ export declare function loadBatchTeleportArtifacts(options?: LoadTeleportArtifactsOptions): Promise; /** * Resets the default teleport artifacts manager to its initial state. * Useful for testing to ensure clean state between tests. */ export declare function resetTeleportArtifactsManager(): void; /** * Returns the default teleport artifacts manager instance. * Useful when you need direct access to the manager. */ export declare function getDefaultTeleportArtifactsManager(): TeleportArtifactsManager; //# sourceMappingURL=artifacts.d.ts.map