-
Notifications
You must be signed in to change notification settings - Fork 0
/
saltyrtc-task-relayed-data.d.ts
59 lines (48 loc) · 1.74 KB
/
saltyrtc-task-relayed-data.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Copyright (C) 2018-2022 Threema GmbH
*
* This software may be modified and distributed under the terms
* of the MIT license. See the `LICENSE.md` file for details.
*/
declare namespace saltyrtc.tasks.relayed_data {
interface RelayedDataTask extends saltyrtc.Task {
/**
* Send an end-to-end encrypted message through the WebSocket.
*/
sendMessage(data: any): void;
/**
* Enable or disable debug logs.
*/
setDebug(enabled: boolean): void;
/**
* Attach an event handler to the specified event(s).
*
* Note: The same event handler object cannot be registered multiple
* times. It will only run once.
*/
on(event: string | string[], handler: saltyrtc.SaltyRTCEventHandler): void;
/**
* Attach a one-time event handler to the specified event(s).
*
* Note: If the same handler was already registered previously as a
* regular event handler, it will be completely removed after running
* once.
*/
once(event: string | string[], handler: saltyrtc.SaltyRTCEventHandler): void;
/**
* Remove an event handler from the specified event(s).
*
* If no handler is specified, remove all handlers for the specified
* event(s).
*
* If no event name is specified, all event handlers will be cleared.
*/
off(event?: string | string[], handler?: saltyrtc.SaltyRTCEventHandler): void;
}
interface RelayedDataTaskStatic {
new(debug?: boolean): RelayedDataTask;
}
}
declare var saltyrtcTaskRelayedData: {
RelayedDataTask: saltyrtc.tasks.relayed_data.RelayedDataTaskStatic,
};