/** * Patch `globalThis.fetch` to advertise HTTP/2 in TLS ALPN, with transparent * HTTP/1.1 fallback when the server doesn't negotiate `h2`. * * Bun's HTTP/2 client is gated on `BUN_FEATURE_FLAG_EXPERIMENTAL_HTTP2_CLIENT`, * read by the native runtime before any JS executes; assigning to * `process.env` from inside JS is a no-op. Per-request `protocol: "http2"` * activates h2 over TLS ALPN and rejects with `error.code === "HTTP2Unsupported"` * if the server picks anything else, so we catch and retry without the hint. * * Some HTTPS endpoints (e.g. corporate API gateways behind reverse proxies) * advertise h2 via ALPN but then refuse or reset the connection at the HTTP/2 * framing layer. Bun surfaces these as `ConnectionRefused`, `ConnectionReset`, * or `ConnectionClosed` rather than `HTTP2Unsupported`, so we treat those * codes as h2-fallback triggers as well. * * Bun negotiates h2 via ALPN over TLS only (no h2c), so plain `http://` URLs * skip the attempt entirely — avoids the throw/retry round-trip for localhost. * * Idempotent. */ export declare function installH2Fetch(): void;