/** * The FDv1 fallback directive parsed from a connection's response headers. * Its presence (`fdv1Fallback === true`) means the server asked the SDK to * fall back to FDv1. * * `fdv1FallbackTtlMs` is how long to remain on FDv1 before retrying FDv2: * - `undefined`: the server gave no TTL header (caller uses a 1-hour default). * - `0`: indefinite fallback (no automatic recovery). * - `> 0`: milliseconds to wait before attempting FDv2 recovery. * * This is the single place that interprets `x-ld-fd-fallback` and * `x-ld-fd-fallback-ttl`. */ export interface FallbackDirective { fdv1Fallback: boolean; fdv1FallbackTtlMs?: number; } /** * Reads the FDv1 fallback directive from response headers. Returns * `{ fdv1Fallback: false }` when `x-ld-fd-fallback` is absent or not `"true"`. * * @param headers Header accessor. The `get` method must accept header names * in any casing; callers normalize to lowercase before calling this * function. */ export declare function readFallbackDirective(headers: { get(name: string): string | null; }): FallbackDirective; /** * Reads the FDv1 fallback directive from an FDv2 `goodbye` event's data. * * SDKs that cannot read streaming response headers (e.g. browsers using the * native `EventSource` API) receive the fallback directive in-band via the * goodbye message's `protocolFallbackTTL` field. * Presence of a finite numeric `protocolFallbackTTL` signals FDv1 fallback; * the value carries the same semantics as the `x-ld-fd-fallback-ttl` header * (`0` indicates indefinite fallback). A missing, non-numeric, or non-finite * value is not a fallback signal and yields `{ fdv1Fallback: false }`. * * @param data The raw, parsed goodbye event data (typed `unknown` because the * caller has not narrowed it). */ export declare function readGoodbyeFallbackDirective(data: unknown): FallbackDirective; //# sourceMappingURL=fallbackDirective.d.ts.map