/** * Pick a mux transport: worker-backed where that is possible, direct where it * is not. * * The worker version is what keeps audio flowing while the main thread is * busy, so it is the default wherever a `Worker` exists. It is not always * available — a `Worker` needs a real document origin, and there are hosts * (tests, embeddings, older runtimes) with none — and a session that cannot * spawn one must still connect rather than fail. The direct transport is the * same code, just running on the calling thread. */ import type { MuxWorkerOptions } from "./mux-worker-protocol"; import type { BlitDebug, BlitTransport } from "../types"; /** * What callers use, satisfied by both. Deliberately narrow: only the four * methods the app actually calls, so neither implementation is obliged to * mirror internals nobody exercises. */ export type AnyMuxTransport = { connect(): void; close(): void; updateWtCertHash(hexHash: string, wtUrl?: string): void; createChannel(destName: string): BlitTransport & { channelId: number; }; }; export interface CreateMuxTransportOptions extends MuxWorkerOptions { debug?: BlitDebug; /** Force the direct transport. The worker is otherwise preferred. */ inline?: boolean; } export declare function createMuxTransport(wsUrl: string, passphrase: string, options?: CreateMuxTransportOptions): AnyMuxTransport; //# sourceMappingURL=mux-any.d.ts.map