import { WSListenCallback } from './PerfectWS.js'; import type { WSDataMiddleware } from './middleware/dataMiddleware.js'; /** * A mountable RPC router scope. Create one with `PerfectWS.Router()`, add * router-wide middleware with `use()`, and attach children with `mount()`. */ export declare class PerfectWSSubRoute { _listenForRequests: Map; private _protocol; private _parent; private _mounts; private _fullPrefix; private _middleware; constructor(); on(method: string, validator: WSDataMiddleware, ...callbacks: WSListenCallback[]): this; on(method: string, ...callbacks: WSListenCallback[]): this; off(method: string): this; /** Add middleware that applies to every route in this router and its descendants. */ use(...middleware: WSListenCallback[]): this; /** Mount a child router under a prefix owned by this parent router. */ mount(prefix: string, router: PerfectWSSubRoute): this; private _validateMount; private _getFullMethod; private _getMiddleware; }