UNPKG

nxkit

Version:

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

40 lines (39 loc) 1.34 kB
import { EventNoticer, Notification } from '../event'; /** * @class FMTClient */ export declare class FMTClient extends Notification { private m_subscribe; private m_id; private m_cli; get id(): string; get conv(): import("../ws/cli/conv").WSConversation; get loaded(): boolean; close(): void; readonly onOnline: EventNoticer<import("../event").Event<any, object>>; readonly onOffline: EventNoticer<import("../event").Event<any, object>>; constructor(id?: string, url?: string, headers?: Dict); that(id: string): ThatClient; user(id?: string): Promise<any>; /** * @func handleCall() */ handleCall(method: string, data: any, sender?: string): any; /** * @func subscribe() */ subscribe(events: string[]): Promise<any>; /** * @func unsubscribe() */ unsubscribe(events: string[]): Promise<any>; getNoticer(name: string): EventNoticer<import("../event").Event<any, object>>; triggerListenerChange(name: string, count: number, change: number): void; } export interface ThatClient { hasOnline(): Promise<boolean>; trigger(event: string, data?: any): Promise<void>; call<T = any>(method: string, data?: any, timeout?: number): Promise<T>; send(method: string, data?: any): Promise<void>; user(): Promise<Dict>; }