/** * ICE restart support (RFC 9725 §4.4, RFC 8840). * * When a client's local address changes — Wi-Fi to cellular, a VPN toggle, a * laptop moving networks — the gathered candidates are dead and the connection * cannot heal on its own. Re-POSTing an offer would allocate a new session on * the server, losing the conversation history and replaying the greeting. An * ICE restart instead swaps only the ICE generation on the *existing* session, * so nothing above the transport notices. * * The wire format is an SDP fragment rather than a full description, so these * helpers translate in both directions: our new local offer becomes a fragment * to PATCH, and the server's reply fragment is folded back into the answer we * already have. */ /** Media type of an ICE restart body. */ export declare const ICE_FRAGMENT_CONTENT_TYPE = "application/trickle-ice-sdpfrag"; /** Splits an SDP or fragment into lines, tolerating LF-only bodies. */ export declare function splitSdpLines(sdp: string): string[]; export interface IceDetails { ufrag: string; pwd: string; candidates: string[]; } /** * Reads the ICE credentials and candidates out of an SDP or fragment. * Credentials may sit at session or media level; the first of each wins, which * is what a bundled description means anyway. */ export declare function parseIceDetails(sdp: string): IceDetails; /** * Renders our new local offer as the sdpfrag to PATCH: the credentials, then * the bundle-master m-line with its mid and candidates. Shaped after the * request example in RFC 9725 §4.4.2. */ export declare function iceFragmentFromSdp(localSdp: string): string; /** * Folds the server's reply fragment into the answer we already hold, producing * a full SDP that `setRemoteDescription` will accept. * * Only the ICE generation changes: credentials are replaced wherever they * appear, stale candidates are dropped, and the new ones are inserted into the * first media section. Everything else — m-lines, payload types, the DTLS * fingerprint, SSRCs — is carried over verbatim, because the restart is not * meant to renegotiate any of it. * * Throws if the fragment carries no credentials, which would mean it is not a * restart reply at all. */ export declare function applyIceFragment(remoteSdp: string, fragment: string): string; /** Increments the session version in an `o=` line, marking a new revision. */ export declare function bumpSdpOrigin(line: string): string; //# sourceMappingURL=icerestart.d.ts.map