import { AnyCircuitElement } from 'circuit-json';
import { RootCircuitEventName } from '@tscircuit/core';

declare const getImportsFromCode: (code: string) => string[];

interface CircuitRunnerConfiguration {
    snippetsApiBaseUrl: string;
    cjsRegistryUrl: string;
    verbose?: boolean;
}
interface WebWorkerConfiguration extends CircuitRunnerConfiguration {
    evalVersion?: string;
    /**
     * @deprecated, renamed to webWorkerBlobUrl
     */
    webWorkerUrl?: URL | string;
    webWorkerBlobUrl?: URL | string;
}
type CircuitWebWorker = {
    execute: (code: string) => Promise<void>;
    executeWithFsMap: (opts: {
        entrypoint?: string;
        fsMap: Record<string, string>;
    }) => Promise<void>;
    renderUntilSettled: () => Promise<void>;
    getCircuitJson: () => Promise<AnyCircuitElement[]>;
    on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
    clearEventListeners: () => void;
    kill: () => Promise<void>;
};

declare const createCircuitWebWorker: (configuration: Partial<WebWorkerConfiguration>) => Promise<CircuitWebWorker>;

export { type CircuitWebWorker, type WebWorkerConfiguration, createCircuitWebWorker, getImportsFromCode };
