import type { Procedure } from "../procedure.ts"; import { type WebSocketLike, type WebSocketOptions } from "../ws.ts"; interface AuthenticatedWebSocketOptions { /** * Timeout in milliseconds before a handshake procedure is considered failed. */ timeoutMs: number; /** * When connection is closed because the handshake procedure has failed, * these arguments are used as status code and reason for closure. */ closeArgs: [code: number, reason: string]; } /** * Creates a `WebSocketClient` and wraps it with * {@link makeAuthenticated `makeAuthenticated`}. */ export declare const createAuthenticatedWebSocketClient: (options: WebSocketOptions & AuthenticatedWebSocketOptions) => ((handshake: Procedure) => WebSocketLike); /** * Wraps the provided `WebSocketClient` and adds a handshake procedure that * executes every time connection is opened. If the handshake procedure fails, * the connection is closed. * * The `authed.open()` method resolves with the result of the handshake * procedure. */ export declare const makeAuthenticated: (ws: WebSocketLike, options: AuthenticatedWebSocketOptions) => (handshake: Procedure) => WebSocketLike; export {}; //# sourceMappingURL=auth.d.ts.map