interface Natives { open: (method: string, url: string, async?: boolean) => void; send: (body?: Document | XMLHttpRequestBodyInit | null) => void; setRequestHeader: (name: string, value: string) => void; abort: () => void; } export default class ShadowXhrBridge { readonly shadow: XMLHttpRequest; private readonly original; private readonly natives; private readonly savedDescriptors; private savedGetResponseHeader; private savedGetAllResponseHeaders; private installedGetResponseHeader; private installedGetAllResponseHeaders; private started; private terminated; constructor(original: XMLHttpRequest, natives: Natives); /** * @param attemptTimeoutMs the shadow's own timeout for this attempt. Under transparent retry the balancer * passes what is left of the PLAYER's timeout, so a retried request still ends, as a timeout the player * sees, exactly when the player's own limit runs out (Fede 2026-09-25: their timeout is the hard limit). */ start(url: string, headers?: Record, attemptTimeoutMs?: number): void; /** True once the bridge has torn itself down (terminal event, abort or a failed start). */ isTerminated(): boolean; /** * Cancel the shadow WITHOUT telling the player. Used by the balancer's transparent retry: the * attempt that hit a deadline is abandoned, a new bridge starts on the next CDN, and the player * only ever sees the last attempt's terminal state. `cleanup()` runs first so `terminated` is * already set when the shadow's abort-time readystatechange / abort / loadend fire — `mirror()` * then drops them. The plain `abort()` below keeps mirroring, which is what a player-initiated * abort needs. */ abortSilently(): void; private failStart; abort(): void; private prepareOriginal; private wireShadow; private mirror; private dispatch; private cleanup; } export {};