import { releaseProxy, type NodeEndpoint as NodeWorker, type Remote, type IsomorphicMessagePort, type ProxyMethods } from './comlink-sync'; import { type NodeProcess } from './comlink-node-process-adapter'; export declare const releaseApiProxy: typeof releaseProxy; export type WithAPIState = { /** * Resolves to true when the remote API is ready for * Comlink communication, but not necessarily fully initialized yet. */ isConnected: () => Promise; /** * Resolves to true when the remote API is declares it's * fully loaded and ready to be used. */ isReady: () => Promise; }; export type RemoteAPI = Remote & ProxyMethods & WithAPIState; export declare function consumeAPISync(remote: IsomorphicMessagePort): Promise; export declare function consumeAPI(remote: Worker | Window | NodeWorker | NodeProcess, context?: undefined | EventTarget): RemoteAPI; export type PublicAPI = RemoteAPI; export declare function exposeAPI(apiMethods?: Methods, pipedApi?: PipedAPI, targetWorker?: MessagePort | NodeWorker | NodeProcess): [() => void, (e: Error) => void, PublicAPI]; export declare function exposeSyncAPI(apiMethods: Methods, port: IsomorphicMessagePort): Promise<[() => void, (e: Error) => void, Methods]>;