import type { PairingFetch } from "./interfaces.js"; /** A refusal from the relay: its status and the `error` it sent, or "network" when nothing came back. */ export declare class PairingRelayError extends Error { readonly status: number; readonly code: string; constructor(status: number, code: string); } export interface RelayMessage { seq: number; type: "claim" | "reveal" | "sealed"; pkA?: string; pkN?: string; body?: string; } export interface PairingRelay { create(commit: string): Promise<{ id: string; code: string; token: string; expiresAt: string; }>; claim(by: { id: string; } | { code: string; }, pkA: string): Promise<{ id: string; token: string; commit: string; location: string | null; yourLocation: string | null; }>; post(id: string, token: string, message: { type: "reveal"; pkN: string; } | { type: "sealed"; body: string; }): Promise; /** The other side's messages after `after`, waiting up to `waitSeconds`. Asking past one acks it. */ poll(id: string, token: string, after: number, waitSeconds: number, signal?: AbortSignal): Promise; close(id: string, token: string): Promise; /** A: one sealed history chunk into slot `n`. */ putChunk(id: string, token: string, n: number, sealed: Uint8Array, signal?: AbortSignal): Promise; /** N: the chunk in slot `n`. A 404 means the relay doesn't have it. */ getChunk(id: string, token: string, n: number, signal?: AbortSignal): Promise; /** N: done with slot `n`. */ deleteChunk(id: string, token: string, n: number): Promise; } /** The relay's HTTP API as auth#45 built it, under `{origin}/api/v1/pairing`. The chunk calls follow docs/pairing-design.md; the relay doesn't have them yet (GRYT-1591). */ export declare function createPairingRelay(origin: string, fetch: PairingFetch): PairingRelay;