/** * Browser stub for `transport.ts`. The Node `defaultTransportFactory` uses * the `ws` package and Node `Buffer`, neither of which exist in browser. * * Browser consumers must supply their own transport via `ClientOptions.transport` * — typically a small adapter around `globalThis.WebSocket`. The QAR * connection sends the bearer in the `Authorization` upgrade header; browser * `WebSocket` doesn't support custom upgrade headers, so the recommended * adapter passes the bearer via the `Sec-WebSocket-Protocol` field or a * pre-signed URL — that decision belongs to the consumer. * * Keepalive note: the WHATWG `WebSocket` exposes no app-level ping, so a * browser adapter cannot honor the `keepalive` factory arg with a protocol * ping. It may safely ignore the field (losing fast half-open detection and * idle-cutoff defense) or emulate it with a tiny app-level keepalive * envelope if the deployment needs it. * * Calling `defaultTransportFactory` directly in browser throws so consumers * who forgot to wire `transport:` get an actionable error rather than a * cryptic "Buffer is not defined" runtime crash deep inside the factory. */ export type { WSTransport, WSTransportFactory, WSTransportFactoryArgs, WSUpgradeAgent, WSEventHandlers, ResolvedKeepalive, } from './transport.js'; export { validateCloseReason, CLOSE_FRAME_REASON_MAX_BYTES, } from './transport.shared.js'; import type { WSTransportFactory } from './transport.js'; export declare const defaultTransportFactory: WSTransportFactory; //# sourceMappingURL=transport.browser.d.ts.map