import type { AnyCircuitElement } from "circuit-json" export interface CircuitRunnerConfiguration { snippetsApiBaseUrl: string cjsRegistryUrl: string verbose?: boolean } export interface WebWorkerConfiguration extends CircuitRunnerConfiguration { /** * @deprecated, renamed to webWorkerBlobUrl */ webWorkerUrl?: URL | string webWorkerBlobUrl?: URL | string } /** * API for the CircuitRunner class, used for eval'ing circuits */ export 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 } /** * @deprecated, use CircuitRunnerApi instead */ export type InternalWebWorkerApi = CircuitRunnerApi export type CircuitWebWorker = { execute: (code: string) => Promise executeWithFsMap: (opts: { entrypoint: string fsMap: Record }) => Promise renderUntilSettled: () => Promise getCircuitJson: () => Promise on: ( event: | "renderable:renderLifecycle:anyEvent" | `asyncEffect:start` | `asyncEffect:end` | `renderable:renderLifecycle:${string}`, callback: (...args: any[]) => void, ) => void clearEventListeners: () => void kill: () => Promise }