-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient.d.ts
36 lines (36 loc) · 1.43 KB
/
Client.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// <reference types="node" />
import { EventEmitter } from 'events';
import { Agent, AgentConfig, Transport } from './';
import * as JXT from './jxt';
import * as SASL from './lib/sasl';
import { IQ, Message, Presence, StreamError } from './protocol';
import StreamManagement from './StreamManagement';
export default class Client extends EventEmitter {
jid: string;
config: AgentConfig;
sm: StreamManagement;
transport?: Transport;
stanzas: JXT.Registry;
sessionStarted?: boolean;
transports: {
[key: string]: new (client: Agent, sm: StreamManagement, registry: JXT.Registry) => Transport;
};
sasl: SASL.Factory;
constructor(opts?: AgentConfig);
readonly stream: import("./protocol").Stream | undefined;
emit(name: string, ...args: any[]): boolean;
use(pluginInit: boolean | ((agent: Agent, registry: JXT.Registry, config: AgentConfig) => void)): void;
nextId(): string;
getCredentials(): Promise<SASL.Credentials>;
connect(): Promise<void>;
disconnect(): void;
send(name: string, data: object): void;
sendMessage(data: Message): string;
sendPresence(data?: Presence): string;
sendIQ<T extends IQ = IQ, R extends IQ = T>(data: T): Promise<R>;
sendIQResult(original: IQ, reply: Partial<IQ>): void;
sendIQError(original: IQ, error: Partial<IQ>): void;
sendStreamError(error: StreamError): void;
private _getConfiguredCredentials;
private _initConfig;
}