import { r as Eventa } from "../../../eventa-CCPqecvv.mjs"; import { t as EventContext } from "../../../context-C4Cia9QU.mjs"; import { T as InvocableEventContext } from "../../../index-CeSxLb7L.mjs"; import { WSEvents } from "hono/ws"; //#region src/adapters/websocket/hono/shared.d.ts declare const wsConnectedEvent: Eventa; declare const wsDisconnectedEvent: Eventa; declare const wsErrorEvent: Eventa<{ error: unknown; }, undefined, undefined>; type HonoWsOpenEvent = Parameters>[0]; type HonoWsMessageEvent = Parameters>[0]; type HonoWsCloseEvent = Parameters>[0]; type HonoWsErrorEvent = Parameters>[0]; interface HonoWsRawEventOptions { raw?: { close?: HonoWsCloseEvent; error?: HonoWsErrorEvent; message?: HonoWsMessageEvent; open?: HonoWsOpenEvent; }; } type HonoWsEventContext = EventContext; type HonoWsInvocableEventContext = InvocableEventContext; //#endregion //#region src/adapters/websocket/hono/global.d.ts interface GlobalHooksResult { context: HonoWsEventContext; hooks: WSEvents; } /** * Creates Hono `WSEvents` hooks backed by one shared broadcasting context. * * Use when: * - A server needs one Eventa context that broadcasts outbound events to every * connected Hono WebSocket peer. * * Expects: * - Connected peers accept the standard Eventa websocket JSON wire format. * * Returns: * - A shared context plus Hono websocket hooks. */ declare function createGlobalHooks(): GlobalHooksResult; //#endregion //#region src/adapters/websocket/hono/peer.d.ts interface CreatePeerHooksOptions { onContext?: (ctx: HonoWsInvocableEventContext) => void; } interface PeerHooksResult { hooks: WSEvents; } /** * Creates Hono `WSEvents` hooks with one Eventa context per connected peer. * * Use when: * - A Hono route wants per-socket Eventa RPC handlers or per-peer fanout. * * Expects: * - The returned hooks are passed to Hono's `upgradeWebSocket(...)` helper. * * Returns: * - Hono websocket hooks. `options.onContext` receives the peer context after * `onOpen`, when Hono exposes the `WSContext`. */ declare function createPeerHooks(options?: CreatePeerHooksOptions): PeerHooksResult; //#endregion export { type CreatePeerHooksOptions, type GlobalHooksResult, type HonoWsCloseEvent, type HonoWsErrorEvent, type HonoWsEventContext, type HonoWsInvocableEventContext, type HonoWsMessageEvent, type HonoWsOpenEvent, type HonoWsRawEventOptions, type PeerHooksResult, createGlobalHooks, createPeerHooks, wsConnectedEvent, wsDisconnectedEvent, wsErrorEvent }; //# sourceMappingURL=index.d.mts.map