UNPKG

nxkit

Version:

This is a collection of tools, independent of any other libraries

51 lines (50 loc) 1.95 kB
import * as _center from './_center'; import { EventNoticer, Notification, Event } from '../event'; import * as server from '../_server'; import * as service from './service'; import * as node from './node'; /** * @class FastMessageTransferCenterDelegate */ export declare class FastMessageTransferCenterDelegate { private m_host; private m_impl; constructor(host: FastMessageTransferCenter); get host(): FastMessageTransferCenter; exec(id: string, args?: any[], method?: string): Promise<any>; /** * @func auth() auth client, return client user info */ auth(fmtService: service.FMTService): Dict | null; /** * @func authFnode() auth fnode */ authFnode(fnodeRemoteService: node.FNodeRemoteService): boolean; /** * @func getCertificate() get current center certificate */ getCertificate(): string; triggerTo(id: string, event: string, data: any, sender: string): Promise<any>; callTo(id: string, method: string, data: any, timeout: number, sender: string): Promise<any>; sendTo(id: string, method: string, data: any, sender: string): Promise<any>; } /** * @class FastMessageTransferCenter */ export declare class FastMessageTransferCenter extends Notification { private m_impl; private m_delegate; readonly onAddNode: EventNoticer<Event<any, object>>; readonly onDeleteNode: EventNoticer<Event<any, object>>; readonly onLogin: EventNoticer<Event<any, object>>; readonly onLogout: EventNoticer<Event<any, object>>; get id(): string; get publishURL(): import("../path").URL | null; get routeTable(): Map<string, _center.Route>; constructor(server: server.Server, fnodes?: string[], publish?: string); client(id: string): service.FMTServerClient; hasOnline(id: string): Promise<boolean>; user(id: string): Promise<any>; trigger(event: string, data: any): number; publish(event: string, data: any): void; }