import { a as Storage, U as UnexpectedErrorEvent, E as EventEmitter, j as EventMap, T as Trace, S as Selector } from './hive.DlaRxYsk.js'; import { Logger } from '../sdk/logger.js'; import * as hono_factory0 from 'hono/factory'; import { Auth } from '../sdk/auth.js'; //#region src/index.d.ts type ServerConfig = { /** * `Storage` instance that backs the `Server` instance. */ storage: Storage; /** * `Logger` instance to use for logging. * * @default null */ logger?: Logger | null | undefined; /** * Auth instance to use for authentication. * * @default null (disabled) */ auth?: Auth | null | undefined; /** * Port the `Server` instance runs on. * * @default 3000 */ port?: number | null | undefined; /** * Name the `Server` instance identifies itself with. * * @default `srv-${crypto.randomUUID().split('-')[0]}` */ name?: string | null | undefined; /** * `EventEmitter` instance to use for forwarding emitted events. */ events: EventEmitter; /** * Interval in milliseconds at which the `WebSocketServer` will send `ping` * messages to the `Connection`. * * @default 5_000 */ pingInterval?: number | null | undefined; /** * Threshold in milliseconds at which the `WebSocketServer` will consider a * `pong` message from a `WebSocketClient` to be late and terminate the * connection. * * @default 1_000 */ pongThreshold?: number | null | undefined; /** * Extend the internal Router instance. * * @default null */ route?: ((router: ReturnType) => void) | null | undefined; /** * Error handler to invoke with unexpected errors when they occur. */ onError?: ((event: UnexpectedErrorEvent) => void) | null | undefined; }; declare class Server { static readonly name = "server"; /** * `Storage` instance that backs the `Server` instance. */ readonly storage: Storage; /** * `Logger` instance to use for logging. */ readonly logger: Logger | null; /** * Auth instance to use for authentication. */ readonly auth: Auth | null; /** * Configuration the `Server` instance was created with. */ readonly config: ServerConfig; /** * Port the `Server` instance runs on. */ readonly port: number; /** * Name the `Server` instance identifies itself with. */ readonly name: string; /** * Error handler to invoke with unexpected errors when they occur. */ readonly onError: ((event: UnexpectedErrorEvent) => void) | null; /** * Hono instance used to handle incoming HTTP requests. */ readonly router: ReturnType; /** * Internal `Server` instance. */ private server; /** * Internal `WebSocketServer` instance. */ private wss; constructor(config: ServerConfig); private readonly forwardEvent; /** * Start the `Server` instance. * * @returns `Server` instance. */ readonly start: () => Promise; /** * Stop the `Server` instance. * * @returns `Server` instance. */ readonly stop: () => Promise; } //#endregion //#region src/factory.d.ts type Bindings = { storage: Storage; logger: Logger | null; auth: Auth | null; onError: ((event: UnexpectedErrorEvent) => void) | null; server: Server; }; type Variables = { trace: Trace; resource: Selector | null; 'api-version': string; token: string | null; }; declare const factory: hono_factory0.Factory<{ Bindings: Bindings; Variables: Variables; }, string>; export { Server as S, factory as f }; export type { Bindings as B, Variables as V, ServerConfig as a };