import { type PairingSession } from "@gryt/crypto"; import type { PairingClock, PairingEndReason } from "./interfaces.js"; import type { PairingRelay, RelayMessage } from "./relayClient.js"; /** Thrown inside a pairing to stop it with a reason the screen can show. */ export declare class PairingEnded extends Error { readonly reason: PairingEndReason; constructor(reason: PairingEndReason); } export declare const systemClock: PairingClock; export declare function reasonFor(error: unknown): PairingEndReason; export declare function sealJson(session: PairingSession, value: object): string; /** The next sealed message as JSON with a `t`, or a throw that ends the pairing as tampered. */ export declare function openJson(session: PairingSession, message: RelayMessage | null, t?: string): Record; /** The other side's messages in order, long-polling the relay. `next` gives null once `deadline` passes. */ export declare function mailbox(relay: PairingRelay, id: string, token: string, clock: PairingClock): { next(signal: AbortSignal, deadline?: number): Promise; };