import * as JsonRpc2 from './types'; import { EventDispatcher, EventDispatcherBinding } from '../core/EventDispatcher'; export declare abstract class Server extends EventDispatcher implements JsonRpc2.IServer { private _exposedMethodsMap; private _consoleLog; private _isEnabled; readonly isEnabled: boolean; constructor(opts?: JsonRpc2.IServerOpts); abstract sendMessage(to: ClientType, message: string): void; abstract getAllClients(): Iterable; on(method: 'error', callback: (error: any) => void, once?: boolean): EventDispatcherBinding; on(method: string, callback: (params: any, sender: ClientType) => void, once?: boolean): EventDispatcherBinding; once(method: 'error', callback: (error: any) => void): EventDispatcherBinding; once(method: string, callback: (params: any, sender: ClientType) => void): EventDispatcherBinding; setLogging({ logConsole }?: JsonRpc2.ILogOpts): void; expose(method: string, handler: (...params: any[]) => Promise): void; notify(method: string): void; notify(method: string, params: string): never; notify(method: string, params: number): never; notify(method: string, params: boolean): never; notify(method: string, params: null): never; notify(method: string, params: Iterable): void; notify(method: string, params?: Object): void; protected enable(): void; protected disable(): void; protected processMessage(from: ClientType, messageStr: string): void; private _logMessage; private _send; private _sendError; private _errorFromCode; }