import type { DevtoolsRequest, DevtoolsResponse } from './envelope.js'; import type { MethodKind } from './methods.js'; export interface MethodEntry { /** Method name (unique within a registry). */ name: string; /** Pause classification. */ kind: MethodKind; /** Handler — receives params (defaulted to `{}`), returns the result value. */ handler: (params: Record) => unknown | Promise; } export interface DispatchOptions { /** When true, `mutating` methods are rejected with a `paused` error. */ paused?: boolean; } /** * Transport-agnostic method registry + policy dispatcher. The in-app * adapters (DBus / WebSocket) register handlers here and route inbound * requests through {@link dispatch}; the pause policy and the * unclassified-method guard live here so every transport enforces them * identically. Pure TS — unit-tested on Node + GJS. */ export declare class MethodRegistry { private readonly _methods; register(entry: MethodEntry): void; has(name: string): boolean; list(): { name: string; kind: MethodKind; }[]; /** Dispatch a request through the pause policy. Never throws — failures become error responses. */ dispatch(req: DevtoolsRequest, opts?: DispatchOptions): Promise; }