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; /** * Session token for authenticating with the tscircuit npm registry. * Used to fetch private @tsci/* packages from npm.tscircuit.com */ tscircuitSessionToken?: string; } 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; /** * Disable npm package resolution from jsDelivr CDN. * When true, import statements for npm packages will throw an error instead * of being resolved from the CDN. * Default: false */ disableCdnLoading?: boolean; } type CircuitWebWorker = { execute: (code: string) => Promise; executeComponent: (component: any) => Promise; executeWithFsMap: (opts: { entrypoint?: string; mainComponentPath?: string; fsMap: Record; }) => Promise; renderUntilSettled: () => Promise; getCircuitJson: () => Promise; on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void; clearEventListeners: () => Promise; enableDebug: (namespace: string) => Promise; version: () => Promise; kill: () => Promise; }; declare global { interface Window { TSCIRCUIT_GLOBAL_CIRCUIT_WORKER: CircuitWebWorker | undefined; } var TSCIRCUIT_GLOBAL_CIRCUIT_WORKER: CircuitWebWorker | undefined; } declare const createCircuitWebWorker: (configuration: Partial) => Promise; export { type CircuitWebWorker, type WebWorkerConfiguration, createCircuitWebWorker, getImportsFromCode };