import { UpgradeWebSocket, WSContext, WSEvents } from "../../helper/websocket/index.js"; //#region src/adapter/bun/websocket.d.ts /** * @internal * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export interface BunServerWebSocket { send(data: string | ArrayBuffer | Uint8Array, compress?: boolean): void; close(code?: number, reason?: string): void; data: T; readyState: 0 | 1 | 2 | 3; } /** * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export interface BunWebSocketHandler { open(ws: BunServerWebSocket): void; close(ws: BunServerWebSocket, code?: number, reason?: string): void; message(ws: BunServerWebSocket, message: string | { buffer: ArrayBufferLike; }): void; } interface CreateWebSocket { upgradeWebSocket: UpgradeWebSocket; websocket: BunWebSocketHandler; } /** * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export interface BunWebSocketData { events: WSEvents; url: URL; protocol: string; } /** * @internal * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export declare const createWSContext: (ws: BunServerWebSocket) => WSContext; /** * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export declare const upgradeWebSocket: UpgradeWebSocket; /** * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead. */ export declare const websocket: BunWebSocketHandler; /** * @deprecated Import `upgradeWebSocket` and `websocket` directly from `hono/bun` instead. * @returns A function to create a Bun WebSocket handler. */ export declare const createBunWebSocket: () => CreateWebSocket; //#endregion export {};