import type { WsClientMsg, WsTopic } from "@yinuo-ngm/protocol";
import { WsContext } from "./ws.context";
export type TopicHandler = {
    topic: WsTopic;
    sub(ctx: WsContext, msg: Extract<WsClientMsg, {
        op: "sub";
    }>): Promise<void> | void;
    unsub(ctx: WsContext, msg: Extract<WsClientMsg, {
        op: "unsub";
    }>): Promise<void> | void;
    resize?(ctx: WsContext, msg: Extract<WsClientMsg, {
        op: "resize";
    }>): Promise<void> | void;
};
export declare class WsRouter {
    private handlers;
    register(handler: TopicHandler): void;
    handleRaw(ctx: WsContext, raw: unknown): undefined;
    private err;
}
