-
Notifications
You must be signed in to change notification settings - Fork 0
/
StreamManagement.d.ts
41 lines (41 loc) · 1.28 KB
/
StreamManagement.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
37
38
39
40
41
import { Agent } from './';
import { IQ, Message, Presence, StreamManagementAck, StreamManagementEnabled, StreamManagementFailed, StreamManagementResume } from './protocol';
declare type Unacked = ['message', Message] | ['presence', Presence] | ['iq', IQ];
interface SMState {
handled: number;
id?: string;
jid?: string;
lastAck: number;
unacked: Unacked[];
}
export default class StreamManagement {
id?: string;
allowResume: boolean;
lastAck: number;
handled: number;
windowSize: number;
unacked: Unacked[];
private pendingAck;
private inboundStarted;
private outboundStarted;
private client;
private cacheHandler;
constructor(client: Agent);
started: boolean;
load(opts: SMState): void;
cache(handler: (data: SMState) => void): void;
enable(): void;
resume(): void;
enabled(resp: StreamManagementEnabled): void;
resumed(resp: StreamManagementResume): void;
failed(resp: StreamManagementFailed): void;
ack(): void;
request(): void;
process(ack: StreamManagementAck | StreamManagementResume | StreamManagementFailed, resend?: boolean): void;
track(kind: string, stanza: Message | Presence | IQ): void;
handle(): void;
needAck(): boolean;
private _cache;
private _reset;
}
export {};