hono-party
Version:
Use PartyServer with Hono
25 lines (23 loc) • 848 B
TypeScript
import * as hono0 from "hono";
import { Env } from "hono";
import { PartyServerOptions } from "partyserver";
//#region src/index.d.ts
/**
* Configuration options for the PartyServer middleware
*/
type PartyServerMiddlewareContext<E extends Env> = {
/** PartyServer-specific configuration options */
options?: PartyServerOptions<E>;
/** Optional error handler for caught errors */
onError?: (error: Error) => void;
};
/**
* Creates a middleware for handling PartyServer WebSocket and HTTP requests
* Processes both WebSocket upgrades and standard HTTP requests, delegating them to PartyServer
*/
declare function partyserverMiddleware<E extends Env = Env>(
ctx?: PartyServerMiddlewareContext<E>
): hono0.MiddlewareHandler<any, string, {}, Response>;
//#endregion
export { partyserverMiddleware };
//# sourceMappingURL=index.d.ts.map