import { AnyFn } from '../utils/index.js'; import { Endpoint } from './Endpoint.js'; export declare type Method = (...args: T) => unknown; export declare type NamespaceMethods = Record>; export declare type Wrapper = ((...args: unknown[]) => Promise) & { available: boolean; }; export declare type ListenerCallback = (methods: string[]) => void; export declare type Listener = { event: string; callback: ListenerCallback; listeners: Listener | null; }; export declare class Namespace { name: string; owner: Endpoint; methods: NamespaceMethods; remoteMethodWrappers: Record; remoteMethods: string[]; listeners: Listener | null; constructor(name: string, owner: Endpoint); isMethodProvided(methodName: string): boolean; provide(methodName: string | NamespaceMethods, fn?: Method): void; revoke(methodName: string | string[]): void; isRemoteMethodExists(methodName: string): boolean; callRemote(method: string, ...args: unknown[]): Promise; getRemoteMethod(methodName: string): Wrapper; onRemoteMethodsChanged(callback: ListenerCallback): AnyFn; static invoke(namespace: Namespace, method: string, args: unknown[], callback: AnyFn): void; static notifyRemoteMethodsChanged(namespace: Namespace): void; }