/** * Message dispatch pipeline: decode → discriminate → lookup → context → middleware → handler * Full message processing from raw frame to handler execution. */ import type { ConnectionData, MinimalContext } from "../context/base-context.js"; import type { EventHandler, Middleware } from "../core/types.js"; import type { RouterImpl } from "../internal.js"; import type { MessageDescriptor } from "../protocol/message-descriptor.js"; import type { ServerWebSocket } from "../ws/platform-adapter.js"; export interface DispatchOptions { globalMiddleware: Middleware[]; routeMiddleware: Middleware[]; handler: EventHandler; } /** * Low-level dispatch: run middleware → handler * Called by dispatchMessage after context is built. * * Errors are NOT caught here; callers handle error routing. */ export declare function dispatch(ctx: MinimalContext, schema: MessageDescriptor, opts: DispatchOptions): Promise; /** * Full message dispatch pipeline. * Handles: parse → guard → lookup → context → limits → middleware → handler → errors. * * @param raw Raw message data (string or ArrayBuffer) * @param clientId Stable client identifier (assigned at accept time) * @param ws WebSocket connection * @param impl Router implementation (provides registry, lifecycle, context factory, etc.) */ export declare function dispatchMessage(raw: string | ArrayBuffer, clientId: string, ws: ServerWebSocket, impl: RouterImpl): Promise; //# sourceMappingURL=dispatch.d.ts.map