//#region src/proxy.d.ts declare const PROXY_SECRET_HEADER = "pinboard-proxy-secret"; declare const isReservedPinboardHeader: (name: string) => boolean; declare const proxySecretHeaders: (secret: string) => Record; /** In-band placement NACK: a pinned worker marks responses that refused to * start a new activation; stripped before anything reaches the client. */ declare const REFUSAL_HEADER = "pinned-refusal"; declare const LEASE_UNHEALTHY_REFUSAL = "lease-unhealthy"; declare const FROM_HEADER = "pinboard-from"; /** Placement epoch of the row a forward resolved against. */ declare const EPOCH_HEADER = "pinboard-epoch"; declare const SESSION_HEADER = "pinboard-session"; declare const SESSION_SECRET_HEADER = "pinboard-session-secret"; declare const DEPTH_HEADER = "pinboard-subrequest-depth"; declare const isConnectError: (err: unknown) => boolean; declare const isTimeoutError: (err: unknown) => boolean; type ForwardOutcome = "forwarded" | "aborted" | "unreachable" | "failed"; declare namespace Transport { type FetchLike = (request: Request) => Promise; type UpgradeHooks = { onFailure(outcome: Exclude): void; onClose(): void; }; /** Performs the upgrade forward; the returned Response completes the * client's upgrade (on Workers, a 101 carrying `webSocket`). */ type Upgrade = (req: Request, outbound: { url: string; headers: Headers; }, hooks: UpgradeHooks) => Promise; type Options = { fetch?: FetchLike | undefined; upgrade?: Upgrade | undefined; }; } /** Outbound headers: hop-by-hop and reserved Pinboard-* stripped, the stamp * applied, X-Forwarded-For reduced to the observed peer address. */ declare const outboundHeaders: (req: Request, address: string | undefined, stamp: Record) => Headers; declare const forward: (fetchImpl: Transport.FetchLike, req: Request, target: string, headers: Headers, onOutcome: (outcome: ForwardOutcome) => void, /** Cap on the wait for upstream response headers; streaming bodies are * never cut. Exceeding answers 504. */ timeoutMs?: number) => Promise; /** Workers-style upgrade: the platform fetch returns the 101 Response * (carrying the socket) directly. */ declare const fetchUpgrade: (fetchImpl: Transport.FetchLike) => Transport.Upgrade; //#endregion export { DEPTH_HEADER, EPOCH_HEADER, FROM_HEADER, ForwardOutcome, LEASE_UNHEALTHY_REFUSAL, PROXY_SECRET_HEADER, REFUSAL_HEADER, SESSION_HEADER, SESSION_SECRET_HEADER, Transport, fetchUpgrade, forward, isConnectError, isReservedPinboardHeader, isTimeoutError, outboundHeaders, proxySecretHeaders }; //# sourceMappingURL=proxy.d.ts.map