import { AnyCircuitElement } from 'circuit-json';
import { RootCircuitEventName as RootCircuitEventName$1 } from '@tscircuit/core';
import { PlatformConfig } from '@tscircuit/props';

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

type RootCircuitEventName = RootCircuitEventName$1 | "debug:logOutput";
interface CircuitRunnerConfiguration {
    snippetsApiBaseUrl: string;
    cjsRegistryUrl: string;
    verbose?: boolean;
    platform?: PlatformConfig;
    projectConfig?: Partial<PlatformConfig>;
}
interface WebWorkerConfiguration extends CircuitRunnerConfiguration {
    evalVersion?: string;
    /**
     * @deprecated, renamed to webWorkerBlobUrl
     */
    webWorkerUrl?: URL | string;
    webWorkerBlobUrl?: URL | string;
    /**
     * Enable fetch proxy to route worker fetch requests through parent thread.
     * Useful when running in restricted environments (like ChatGPT) where
     * worker fetch requests are blocked.
     * Default: false
     */
    enableFetchProxy?: boolean;
}
type CircuitWebWorker = {
    execute: (code: string) => Promise<void>;
    executeComponent: (component: any) => Promise<void>;
    executeWithFsMap: (opts: {
        entrypoint?: string;
        mainComponentPath?: string;
        fsMap: Record<string, string>;
    }) => Promise<void>;
    renderUntilSettled: () => Promise<void>;
    getCircuitJson: () => Promise<AnyCircuitElement[]>;
    on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
    clearEventListeners: () => void;
    enableDebug: (namespace: string) => Promise<void>;
    version: () => Promise<string>;
    kill: () => Promise<void>;
};

declare global {
    interface Window {
        TSCIRCUIT_GLOBAL_CIRCUIT_WORKER: CircuitWebWorker | undefined;
    }
    var TSCIRCUIT_GLOBAL_CIRCUIT_WORKER: CircuitWebWorker | undefined;
}
declare const createCircuitWebWorker: (configuration: Partial<WebWorkerConfiguration>) => Promise<CircuitWebWorker>;

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