export interface ApiAnswer { status: number; user?: string; role?: string; error?: string; retryAfter?: string | null; } export interface RelayApi { verifyToken(token: string, address: string): Promise; redeemTicket(ticket: string): Promise; } export interface RelayOptions { port?: number; host?: string; api: RelayApi; tools: () => Promise; origins: string[]; trustProxy?: boolean; backend?: string; log?: (line: string) => void; callTimeoutMs?: number; /** How long a call may take once the tab said it is asking the user. */ waitTimeoutMs?: number; helloTimeoutMs?: number; pingMs?: number; maxMessageBytes?: number; maxBodyBytes?: number; sessionIdleMs?: number; agentRecentMs?: number; maxSessionsPerAccount?: number; } export interface Relay { port: number; stats(): { tabs: string[]; sessions: string[] }; close(): Promise; } export const PROTOCOL_VERSIONS: string[]; export const VIEW_URI: string; export const CLOSE: { replaced: number; badHello: number; refused: number; helloTimeout: number }; export function startRelay(options: RelayOptions): Promise;