import { AnyCircuitElement } from 'circuit-json'; import { RootCircuit } from '@tscircuit/core'; interface CircuitRunnerConfiguration { snippetsApiBaseUrl: string; cjsRegistryUrl: string; verbose?: boolean; } interface WebWorkerConfiguration extends CircuitRunnerConfiguration { /** * @deprecated, renamed to webWorkerBlobUrl */ webWorkerUrl?: URL | string; webWorkerBlobUrl?: URL | string; } /** * API for the CircuitRunner class, used for eval'ing circuits */ interface CircuitRunnerApi { execute: (code: string, opts?: { name?: string; }) => Promise; executeWithFsMap(opts: { entrypoint: string; fsMap: Record; name?: string; }): Promise; renderUntilSettled: () => Promise; getCircuitJson: () => Promise; setSnippetsApiBaseUrl: (baseUrl: string) => Promise; on: (event: string, callback: (...args: any[]) => void) => void; clearEventListeners: () => void; kill: () => Promise; } interface ExecutionContext extends WebWorkerConfiguration { fsMap: Record; entrypoint: string; preSuppliedImports: Record; circuit: RootCircuit; } declare function createExecutionContext(webWorkerConfiguration: WebWorkerConfiguration, opts?: { name?: string; }): ExecutionContext; declare class CircuitRunner implements CircuitRunnerApi { _executionContext: ReturnType | null; _circuitRunnerConfiguration: CircuitRunnerConfiguration; _eventListeners: Record void)[]>; executeWithFsMap(opts: { entrypoint: string; fsMap: Record; name?: string; }): Promise; execute(code: string, opts?: { name?: string; }): Promise; on(event: string, callback: (...args: any[]) => void): void; renderUntilSettled(): Promise; getCircuitJson(): Promise; clearEventListeners(): void; kill(): Promise; setSnippetsApiBaseUrl(baseUrl: string): Promise; private _bindEventListeners; } export { CircuitRunner };