@zelloptt/react-native-zello-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +21 -0
- package/android/build.gradle +122 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/zellosdk/DummyPackage.kt +18 -0
- package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +437 -0
- package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModuleHelper.kt +198 -0
- package/ios/Extensions/Date+Extension.swift +5 -0
- package/ios/Extensions/UIImage+Extension.swift +9 -0
- package/ios/Extensions/ZelloContact+Extension.swift +52 -0
- package/ios/Extensions/ZelloHistoryAlertMessage+Extension.swift +18 -0
- package/ios/Extensions/ZelloHistoryImageMessage+Extension.swift +17 -0
- package/ios/Extensions/ZelloHistoryLocationMessage+Extension.swift +23 -0
- package/ios/Extensions/ZelloHistoryTextMessage+Extension.swift +18 -0
- package/ios/Extensions/ZelloHistoryVoiceMessage+Extension.swift +18 -0
- package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +285 -0
- package/ios/Extensions/ZelloIncomingEmergency+Extension.swift +16 -0
- package/ios/Extensions/ZelloOutgoingEmergency+Extension.swift +14 -0
- package/ios/Extensions/ZelloRecentEntry+Extension.swift +16 -0
- package/ios/ZelloIOSSdkModule.swift +209 -0
- package/ios/ZelloIOSSdkModuleBridge.h +5 -0
- package/ios/ZelloIOSSdkModuleBridge.m +44 -0
- package/lib/commonjs/events/index.js +43 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/index.js +47 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/sdk/index.js +833 -0
- package/lib/commonjs/sdk/index.js.map +1 -0
- package/lib/commonjs/types/index.js +518 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/utils/algorithms/index.js +79 -0
- package/lib/commonjs/utils/algorithms/index.js.map +1 -0
- package/lib/commonjs/utils/index.js +60 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/events/index.js +39 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/sdk/index.js +829 -0
- package/lib/module/sdk/index.js.map +1 -0
- package/lib/module/types/index.js +547 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/algorithms/index.js +72 -0
- package/lib/module/utils/algorithms/index.js.map +1 -0
- package/lib/module/utils/index.js +52 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/events/index.d.ts +192 -0
- package/lib/typescript/commonjs/src/events/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/sdk/index.d.ts +221 -0
- package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/index.d.ts +560 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts +21 -0
- package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/events/index.d.ts +192 -0
- package/lib/typescript/module/src/events/index.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/sdk/index.d.ts +221 -0
- package/lib/typescript/module/src/sdk/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types/index.d.ts +560 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/algorithms/index.d.ts +21 -0
- package/lib/typescript/module/src/utils/algorithms/index.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/index.d.ts +8 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
- package/package.json +195 -0
- package/react-native-zello-sdk.podspec +43 -0
- package/src/events/index.ts +191 -0
- package/src/index.ts +8 -0
- package/src/sdk/index.ts +1038 -0
- package/src/types/index.ts +818 -0
- package/src/utils/algorithms/index.ts +88 -0
- package/src/utils/index.ts +145 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parent type for all Zello contact types, including users and channels.
|
|
3
|
+
*/
|
|
4
|
+
export type ZelloContact = {
|
|
5
|
+
/**
|
|
6
|
+
* The name of the contact. Names are unique within their type.
|
|
7
|
+
* When comparing names, it is recommended to do so in a case-insensitive manner.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The type of contact.
|
|
12
|
+
*/
|
|
13
|
+
type: ZelloContactType;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the contact is muted.
|
|
16
|
+
* When a contact is muted, messages from the contact will not play live, but they will still be in the history.
|
|
17
|
+
*/
|
|
18
|
+
isMuted: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The type of {@link ZelloContact}.
|
|
22
|
+
*/
|
|
23
|
+
export declare enum ZelloContactType {
|
|
24
|
+
User = "user",
|
|
25
|
+
Channel = "channel"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The status of a {@link ZelloUser}.
|
|
29
|
+
*/
|
|
30
|
+
export declare enum ZelloUserStatus {
|
|
31
|
+
/**
|
|
32
|
+
* The user is connected. Messages will play live.
|
|
33
|
+
*/
|
|
34
|
+
Available = "available",
|
|
35
|
+
/**
|
|
36
|
+
* The user is connected. Messages will not play live.
|
|
37
|
+
*/
|
|
38
|
+
Busy = "busy",
|
|
39
|
+
/**
|
|
40
|
+
* The user is disconnected. Messages will not play live.
|
|
41
|
+
* The user will download messages sent to them when they reconnect.
|
|
42
|
+
*/
|
|
43
|
+
Standby = "standby",
|
|
44
|
+
/**
|
|
45
|
+
* The user is disconnected and cannot receive messages.
|
|
46
|
+
*/
|
|
47
|
+
Offline = "offline"
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A Zello user.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ZelloUser implements ZelloContact {
|
|
53
|
+
name: string;
|
|
54
|
+
/**
|
|
55
|
+
* The display name of the user. This should be used for UI purposes.
|
|
56
|
+
* Display names are not unique.
|
|
57
|
+
*/
|
|
58
|
+
displayName: string;
|
|
59
|
+
type: ZelloContactType;
|
|
60
|
+
isMuted: boolean;
|
|
61
|
+
status: ZelloUserStatus;
|
|
62
|
+
/**
|
|
63
|
+
* The URL of the user's profile picture.
|
|
64
|
+
*/
|
|
65
|
+
profilePictureUrl: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The URL of the user's profile picture thumbnail.
|
|
68
|
+
* This can be used for displaying a smaller version of the profile picture (such as in a list).
|
|
69
|
+
*/
|
|
70
|
+
profilePictureThumbnailUrl: string | undefined;
|
|
71
|
+
constructor(name: string, displayName: string, isMuted: boolean, status: ZelloUserStatus, profilePictureUrl: string | undefined, profilePictureThumbnailUrl: string | undefined);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A Zello channel. A channel contains multiple users.
|
|
75
|
+
*/
|
|
76
|
+
export declare class ZelloChannel implements ZelloContact {
|
|
77
|
+
name: string;
|
|
78
|
+
type: ZelloContactType;
|
|
79
|
+
isMuted: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The connection status of the channel. Connecting to a channel is asynchronous.
|
|
82
|
+
*/
|
|
83
|
+
connectionStatus: ZelloChannelConnectionStatus;
|
|
84
|
+
/**
|
|
85
|
+
* The number of users connected to the channel.
|
|
86
|
+
*/
|
|
87
|
+
usersOnline: number;
|
|
88
|
+
/**
|
|
89
|
+
* The options of the channel.
|
|
90
|
+
*/
|
|
91
|
+
options: ZelloChannelOptions;
|
|
92
|
+
constructor(name: string, isMuted: boolean, connectionStatus: ZelloChannelConnectionStatus, usersOnline: number, options: ZelloChannelOptions);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The connection status of a {@link ZelloChannel}.
|
|
96
|
+
*/
|
|
97
|
+
export declare enum ZelloChannelConnectionStatus {
|
|
98
|
+
Disconnected = "disconnected",
|
|
99
|
+
Connecting = "connecting",
|
|
100
|
+
Connected = "connected"
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The options of a {@link ZelloChannel}.
|
|
104
|
+
*/
|
|
105
|
+
export type ZelloChannelOptions = {
|
|
106
|
+
/**
|
|
107
|
+
* Whether the user is allowed to disconnect from the channel.
|
|
108
|
+
* When this is true, you should not show any UI to allow the user to disconnect from the channel.
|
|
109
|
+
*/
|
|
110
|
+
noDisconnect: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the user is allowed to change the channel's connection state.
|
|
113
|
+
* When this is true, you should not show any UI to allow the user to connect or disconnect the channel.
|
|
114
|
+
*/
|
|
115
|
+
hidePowerButton: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the user is allowed to talk on the channel.
|
|
118
|
+
* When this is true, you should not show any UI to allow the user to talk on the channel.
|
|
119
|
+
*/
|
|
120
|
+
listenOnly: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the user is allowed to send alert messages to the channel.
|
|
123
|
+
* When this is true, you should not show any UI to allow the user to send alert messages to the channel.
|
|
124
|
+
*/
|
|
125
|
+
allowAlerts: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the user is allowed to send text messages to the channel.
|
|
128
|
+
* When this is true, you should not show any UI to allow the user to send text messages to the channel.
|
|
129
|
+
*/
|
|
130
|
+
allowTextMessages: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Whether the user is allowed to send location messages to the channel.
|
|
133
|
+
* When this is true, you should not show any UI to allow the user to send location messages to the channel.
|
|
134
|
+
*/
|
|
135
|
+
allowLocations: boolean;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* A user in a {@link ZelloChannel}. A {@link ZelloChannelUser} may or may not not be part of your contact list.
|
|
139
|
+
*/
|
|
140
|
+
export declare class ZelloChannelUser {
|
|
141
|
+
name: string;
|
|
142
|
+
constructor(name: string);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The credentials required to connect to Zello.
|
|
146
|
+
*/
|
|
147
|
+
export type ZelloCredentials = {
|
|
148
|
+
/**
|
|
149
|
+
* The network to connect to.
|
|
150
|
+
* This is the "x" in your {x.zellowork.com} Zello Work console login.
|
|
151
|
+
*/
|
|
152
|
+
network: string;
|
|
153
|
+
/**
|
|
154
|
+
* The username to connect.
|
|
155
|
+
*/
|
|
156
|
+
username: string;
|
|
157
|
+
/**
|
|
158
|
+
* The password for the user.
|
|
159
|
+
*/
|
|
160
|
+
password: string;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* The connection state of the Zello SDK.
|
|
164
|
+
*/
|
|
165
|
+
export declare enum ZelloConnectionState {
|
|
166
|
+
Disconnected = "disconnected",
|
|
167
|
+
Connecting = "connecting",
|
|
168
|
+
Connected = "connected",
|
|
169
|
+
Reconnecting = "reconnecting"
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The error that occurred when connecting to Zello.
|
|
173
|
+
*/
|
|
174
|
+
export declare enum ZelloConnectionError {
|
|
175
|
+
Unknown = "unknown",
|
|
176
|
+
InvalidCredentials = "invalidcredentials",
|
|
177
|
+
InvalidState = "invalidstate"
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The error that occurred when sending a voice message.
|
|
181
|
+
*/
|
|
182
|
+
export declare enum ZelloOutgoingVoiceMessageError {
|
|
183
|
+
Unknown = "unknown",
|
|
184
|
+
NoMicPermission = "nomicpermission"
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The status of the current account.
|
|
188
|
+
*/
|
|
189
|
+
export declare enum ZelloAccountStatus {
|
|
190
|
+
/**
|
|
191
|
+
* The user is connected. Messages will play live.
|
|
192
|
+
*/
|
|
193
|
+
Available = "available",
|
|
194
|
+
/**
|
|
195
|
+
* The user is connected. Messages will not play live.
|
|
196
|
+
* The received messages will be available in the history.
|
|
197
|
+
*/
|
|
198
|
+
Busy = "busy"
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The parent type for all Zello messages.
|
|
202
|
+
*/
|
|
203
|
+
export type ZelloMessage = {
|
|
204
|
+
/**
|
|
205
|
+
* The contact that sent or received the message. If this is a channel message, the contact will be the channel.
|
|
206
|
+
*/
|
|
207
|
+
contact: ZelloContact;
|
|
208
|
+
/**
|
|
209
|
+
* If incoming, the author that sent the message, if the message was sent in a channel.
|
|
210
|
+
* If outgoing, undefined.
|
|
211
|
+
*/
|
|
212
|
+
channelUser: ZelloChannelUser | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* The timestamp of the message.
|
|
215
|
+
*/
|
|
216
|
+
timestamp: number;
|
|
217
|
+
/**
|
|
218
|
+
* Whether the message was received or sent.
|
|
219
|
+
*/
|
|
220
|
+
incoming: boolean;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* An incoming Zello voice message.
|
|
224
|
+
*/
|
|
225
|
+
export declare class ZelloIncomingVoiceMessage implements ZelloMessage {
|
|
226
|
+
contact: ZelloContact;
|
|
227
|
+
channelUser: ZelloChannelUser | undefined;
|
|
228
|
+
timestamp: number;
|
|
229
|
+
incoming: boolean;
|
|
230
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* An outgoing Zello voice message.
|
|
234
|
+
*/
|
|
235
|
+
export declare class ZelloOutgoingVoiceMessage implements ZelloMessage {
|
|
236
|
+
contact: ZelloContact;
|
|
237
|
+
timestamp: number;
|
|
238
|
+
channelUser: undefined;
|
|
239
|
+
incoming: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* The state of the message.
|
|
242
|
+
*/
|
|
243
|
+
state: ZelloOutgoingVoiceMessageState;
|
|
244
|
+
constructor(contact: ZelloContact, timestamp: number, state: ZelloOutgoingVoiceMessageState);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The state of an outgoing Zello voice message.
|
|
248
|
+
*/
|
|
249
|
+
export declare enum ZelloOutgoingVoiceMessageState {
|
|
250
|
+
None = "none",
|
|
251
|
+
Connecting = "connecting",
|
|
252
|
+
Sending = "sending",
|
|
253
|
+
Sent = "sent",
|
|
254
|
+
Failed = "failed"
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* A Zello image message.
|
|
258
|
+
*/
|
|
259
|
+
export declare class ZelloImageMessage implements ZelloMessage {
|
|
260
|
+
contact: ZelloContact;
|
|
261
|
+
channelUser: ZelloChannelUser | undefined;
|
|
262
|
+
incoming: boolean;
|
|
263
|
+
timestamp: number;
|
|
264
|
+
/**
|
|
265
|
+
* Base64 encoded thumbnail image
|
|
266
|
+
*/
|
|
267
|
+
thumbnail: string | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* Base64 encoded full image
|
|
270
|
+
*/
|
|
271
|
+
image: string;
|
|
272
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, incoming: boolean, timestamp: number, thumbnail: string | undefined, image: string);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* A Zello alert message. Alert messages contain text and are typically used for important messages.
|
|
276
|
+
* They will play a recurring sound until the user acknowledges them by bringing the app to the foreground.
|
|
277
|
+
*/
|
|
278
|
+
export declare class ZelloAlertMessage implements ZelloMessage {
|
|
279
|
+
contact: ZelloContact;
|
|
280
|
+
channelUser: ZelloChannelUser | undefined;
|
|
281
|
+
incoming: boolean;
|
|
282
|
+
timestamp: number;
|
|
283
|
+
/**
|
|
284
|
+
* The text body of the message.
|
|
285
|
+
*/
|
|
286
|
+
text: string;
|
|
287
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, incoming: boolean, timestamp: number, text: string);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* The level of user a channel alert message should be sent to.
|
|
291
|
+
*/
|
|
292
|
+
export declare enum ZelloChannelAlertLevel {
|
|
293
|
+
/**
|
|
294
|
+
* Users currently connected to the channel.
|
|
295
|
+
*/
|
|
296
|
+
Connected = "connected",
|
|
297
|
+
/**
|
|
298
|
+
* All users part of the channel, whether they are connected or not.
|
|
299
|
+
* This will send as a push notification if the user is not connected to Zello.
|
|
300
|
+
*/
|
|
301
|
+
All = "all"
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* A Zello text message.
|
|
305
|
+
*/
|
|
306
|
+
export declare class ZelloTextMessage implements ZelloMessage {
|
|
307
|
+
contact: ZelloContact;
|
|
308
|
+
channelUser: ZelloChannelUser | undefined;
|
|
309
|
+
incoming: boolean;
|
|
310
|
+
timestamp: number;
|
|
311
|
+
/**
|
|
312
|
+
* The text body of the message.
|
|
313
|
+
*/
|
|
314
|
+
text: string;
|
|
315
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, incoming: boolean, timestamp: number, text: string);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* A Zello location message.
|
|
319
|
+
*/
|
|
320
|
+
export declare class ZelloLocationMessage implements ZelloMessage {
|
|
321
|
+
contact: ZelloContact;
|
|
322
|
+
channelUser: ZelloChannelUser | undefined;
|
|
323
|
+
incoming: boolean;
|
|
324
|
+
timestamp: number;
|
|
325
|
+
/**
|
|
326
|
+
* The latitude of the location.
|
|
327
|
+
*/
|
|
328
|
+
latitude: number;
|
|
329
|
+
/**
|
|
330
|
+
* The longitude of the location.
|
|
331
|
+
*/
|
|
332
|
+
longitude: number;
|
|
333
|
+
/**
|
|
334
|
+
* The horizontal accuracy of the location in meters.
|
|
335
|
+
*/
|
|
336
|
+
accuracy: number;
|
|
337
|
+
/**
|
|
338
|
+
* The reverse-geolocation address, if available.
|
|
339
|
+
*/
|
|
340
|
+
address: string | undefined;
|
|
341
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, incoming: boolean, timestamp: number, latitude: number, longitude: number, accuracy: number, address: string | undefined);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* An incoming Zello emergency.
|
|
345
|
+
*/
|
|
346
|
+
export declare class ZelloIncomingEmergency {
|
|
347
|
+
/**
|
|
348
|
+
* The emergency channel.
|
|
349
|
+
*/
|
|
350
|
+
channel: ZelloChannel;
|
|
351
|
+
/**
|
|
352
|
+
* The user that started the emergency.
|
|
353
|
+
*/
|
|
354
|
+
channelUser: ZelloChannelUser;
|
|
355
|
+
/**
|
|
356
|
+
* The unique identifier of the emergency.
|
|
357
|
+
*/
|
|
358
|
+
emergencyId: string;
|
|
359
|
+
/**
|
|
360
|
+
* The timestamp when the emergency started.
|
|
361
|
+
*/
|
|
362
|
+
startTimestamp: number;
|
|
363
|
+
/**
|
|
364
|
+
* The timestamp when the emergency ended, or undefined if it's ongoing.
|
|
365
|
+
*/
|
|
366
|
+
endTimestamp: number | undefined;
|
|
367
|
+
constructor(channel: ZelloChannel, channelUser: ZelloChannelUser, emergencyId: string, startTimestamp: number, endTimestamp: number | undefined);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* An outgoing Zello emergency.
|
|
371
|
+
*/
|
|
372
|
+
export declare class ZelloOutgoingEmergency {
|
|
373
|
+
/**
|
|
374
|
+
* The emergency channel.
|
|
375
|
+
*/
|
|
376
|
+
channel: ZelloChannel;
|
|
377
|
+
/**
|
|
378
|
+
* The timestamp when the emergency started.
|
|
379
|
+
*/
|
|
380
|
+
startTimestamp: number;
|
|
381
|
+
/**
|
|
382
|
+
* The timestamp when the emergency ended, or undefined if it's ongoing.
|
|
383
|
+
*/
|
|
384
|
+
endTimestamp: number | undefined;
|
|
385
|
+
constructor(channel: ZelloChannel, startTimestamp: number, endTimestamp: number | undefined);
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* A Zello recent entry.
|
|
389
|
+
*/
|
|
390
|
+
export declare class ZelloRecentEntry {
|
|
391
|
+
/**
|
|
392
|
+
* The contact that the recent entry is for.
|
|
393
|
+
*/
|
|
394
|
+
contact: ZelloContact;
|
|
395
|
+
/**
|
|
396
|
+
* If incoming, the author that sent the most recent message, if the message was sent in a channel.
|
|
397
|
+
* If outgoing, undefined.
|
|
398
|
+
*/
|
|
399
|
+
channelUser: ZelloChannelUser | undefined;
|
|
400
|
+
/**
|
|
401
|
+
* The timestamp of the most recent message.
|
|
402
|
+
*/
|
|
403
|
+
timestamp: number;
|
|
404
|
+
/**
|
|
405
|
+
* The type of the most recent message.
|
|
406
|
+
*/
|
|
407
|
+
type: ZelloRecentEntryType;
|
|
408
|
+
/**
|
|
409
|
+
* Whether the most recent message was incoming.
|
|
410
|
+
*/
|
|
411
|
+
incoming: boolean;
|
|
412
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, type: ZelloRecentEntryType, incoming: boolean);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* The type of {@link ZelloRecentEntry}.
|
|
416
|
+
*/
|
|
417
|
+
export declare enum ZelloRecentEntryType {
|
|
418
|
+
Voice = "voice",
|
|
419
|
+
Image = "image",
|
|
420
|
+
Alert = "alert",
|
|
421
|
+
Text = "text",
|
|
422
|
+
Location = "location"
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The parent type for all Zello history messages.
|
|
426
|
+
*/
|
|
427
|
+
export type ZelloHistoryMessage = {
|
|
428
|
+
/**
|
|
429
|
+
* The contact that sent or received the message.
|
|
430
|
+
*/
|
|
431
|
+
contact: ZelloContact;
|
|
432
|
+
/**
|
|
433
|
+
* If incoming, the author that sent the message, if the message was sent in a channel.
|
|
434
|
+
* If outgoing, undefined.
|
|
435
|
+
*/
|
|
436
|
+
channelUser: ZelloChannelUser | undefined;
|
|
437
|
+
/**
|
|
438
|
+
* The timestamp of the message.
|
|
439
|
+
*/
|
|
440
|
+
timestamp: number;
|
|
441
|
+
/**
|
|
442
|
+
* The unique identifier of the message. This can be used to lookup messages in the history.
|
|
443
|
+
* This identifier persists across sessions.
|
|
444
|
+
*/
|
|
445
|
+
historyId: string;
|
|
446
|
+
/**
|
|
447
|
+
* Whether the message was received or sent.
|
|
448
|
+
*/
|
|
449
|
+
incoming: boolean;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* A Zello history voice message.
|
|
453
|
+
* To play the message, use the {@link sdk.Zello#playHistoryMessage | Zello#playHistoryMessage} function.
|
|
454
|
+
*/
|
|
455
|
+
export declare class ZelloHistoryVoiceMessage implements ZelloHistoryMessage {
|
|
456
|
+
contact: ZelloContact;
|
|
457
|
+
channelUser: ZelloChannelUser | undefined;
|
|
458
|
+
timestamp: number;
|
|
459
|
+
historyId: string;
|
|
460
|
+
incoming: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* The duration of the voice message in milliseconds.
|
|
463
|
+
*/
|
|
464
|
+
durationMs: number;
|
|
465
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, historyId: string, incoming: boolean, durationMs: number);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A Zello history image message.
|
|
469
|
+
* To retrieve the image data for the message, use the {@link sdk.Zello#getImageDataForHistoryImageMessage | Zello#getImageDataForHistoryImageMessage} method.
|
|
470
|
+
*/
|
|
471
|
+
export declare class ZelloHistoryImageMessage implements ZelloHistoryMessage {
|
|
472
|
+
contact: ZelloContact;
|
|
473
|
+
channelUser: ZelloChannelUser | undefined;
|
|
474
|
+
timestamp: number;
|
|
475
|
+
historyId: string;
|
|
476
|
+
incoming: boolean;
|
|
477
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, historyId: string, incoming: boolean);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* A Zello history alert message.
|
|
481
|
+
*/
|
|
482
|
+
export declare class ZelloHistoryAlertMessage implements ZelloHistoryMessage {
|
|
483
|
+
contact: ZelloContact;
|
|
484
|
+
channelUser: ZelloChannelUser | undefined;
|
|
485
|
+
timestamp: number;
|
|
486
|
+
historyId: string;
|
|
487
|
+
incoming: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* The text body of the message.
|
|
490
|
+
*/
|
|
491
|
+
text: string;
|
|
492
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, historyId: string, incoming: boolean, text: string);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* A Zello history text message.
|
|
496
|
+
*/
|
|
497
|
+
export declare class ZelloHistoryTextMessage implements ZelloHistoryMessage {
|
|
498
|
+
contact: ZelloContact;
|
|
499
|
+
channelUser: ZelloChannelUser | undefined;
|
|
500
|
+
timestamp: number;
|
|
501
|
+
historyId: string;
|
|
502
|
+
incoming: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* The text body of the message.
|
|
505
|
+
*/
|
|
506
|
+
text: string;
|
|
507
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, historyId: string, incoming: boolean, text: string);
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* A Zello history location message.
|
|
511
|
+
*/
|
|
512
|
+
export declare class ZelloHistoryLocationMessage implements ZelloHistoryMessage {
|
|
513
|
+
contact: ZelloContact;
|
|
514
|
+
channelUser: ZelloChannelUser | undefined;
|
|
515
|
+
timestamp: number;
|
|
516
|
+
historyId: string;
|
|
517
|
+
incoming: boolean;
|
|
518
|
+
/**
|
|
519
|
+
* The latitude of the location.
|
|
520
|
+
*/
|
|
521
|
+
latitude: number;
|
|
522
|
+
/**
|
|
523
|
+
* The longitude of the location.
|
|
524
|
+
*/
|
|
525
|
+
longitude: number;
|
|
526
|
+
/**
|
|
527
|
+
* The horizontal accuracy of the location in meters.
|
|
528
|
+
*/
|
|
529
|
+
accuracy: number;
|
|
530
|
+
/**
|
|
531
|
+
* The reverse-geolocation address, if available.
|
|
532
|
+
*/
|
|
533
|
+
address: string | undefined;
|
|
534
|
+
constructor(contact: ZelloContact, channelUser: ZelloChannelUser | undefined, timestamp: number, historyId: string, incoming: boolean, latitude: number, longitude: number, accuracy: number, address: string | undefined);
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* The configuration for the Zello SDK.
|
|
538
|
+
*/
|
|
539
|
+
export type ZelloConfig = {
|
|
540
|
+
android: {
|
|
541
|
+
/**
|
|
542
|
+
* Whether to enable message push notifications.
|
|
543
|
+
* By setting this to false, the user will not receive any push notifications for incoming messages when the user is offline.
|
|
544
|
+
*/
|
|
545
|
+
enableOfflineMessagePushNotifications: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Whether to enable the foreground service. A foreground service is necessary for the SDK to function properly in the background.
|
|
548
|
+
* The SDK comes configured with a default foreground service, but you can provide your own if you wish.
|
|
549
|
+
* If this is set to false, the SDK will not work properly when the app is in the background, unless you configure your own foreground service.
|
|
550
|
+
*/
|
|
551
|
+
enableForegroundService: boolean;
|
|
552
|
+
};
|
|
553
|
+
ios: {
|
|
554
|
+
/**
|
|
555
|
+
* Whether your application is being run in a debug or release build.
|
|
556
|
+
*/
|
|
557
|
+
isDebugBuild: boolean;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,OAAO,EAAE,OAA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YAAY,EACrB,WAAW,EAAE,gBAAgB,GAAG,SAAS,EACzC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,SAAS;CAY9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE;QACP;;;WAGG;QACH,qCAAqC,EAAE,OAAO,CAAC;QAC/C;;;;WAIG;QACH,uBAAuB,EAAE,OAAO,CAAC;KAClC,CAAC;IACF,GAAG,EAAE;QACH;;WAEG;QACH,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ZelloContact } from '../../types';
|
|
2
|
+
export declare function sortedArrayFind<T>(array: readonly T[], item: any, comparator: (item: any, arrayElement: T) => number): T | undefined;
|
|
3
|
+
export declare function lowerBound<T>(array: readonly T[], item: any, comparator: (item: any, arrayElement: T) => number): number;
|
|
4
|
+
/**
|
|
5
|
+
* Binary search algorithm adapted from https://stackoverflow.com/a/29018745.
|
|
6
|
+
*
|
|
7
|
+
* The array may contain duplicate items. If there are more than one equal items in the array,
|
|
8
|
+
* the returned value can be the index of any one of the equal items.
|
|
9
|
+
*
|
|
10
|
+
* Time complexity: O(log n)
|
|
11
|
+
* @param array A sorted array.
|
|
12
|
+
* @param item An item to search for.
|
|
13
|
+
* @param comparator A comparator function. The function takes two arguments: (a, b) and returns:
|
|
14
|
+
* a negative number if a is less than b;
|
|
15
|
+
* 0 if a is equal to b;
|
|
16
|
+
* a positive number of a is greater than b.
|
|
17
|
+
* @return The index of the item in a sorted array or (-n-1) where n is the insertion point for the new item.
|
|
18
|
+
*/
|
|
19
|
+
export declare function binarySearch<T>(array: readonly T[], item: any, comparator: (item: any, arrayElement: T) => number): number;
|
|
20
|
+
export declare function compareNameAscending(a: ZelloContact | string, b: ZelloContact | string): number;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/algorithms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,GAAG,EACT,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,KAAK,MAAM,GACjD,CAAC,GAAG,SAAS,CAMf;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,GAAG,EACT,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,KAAK,MAAM,GACjD,MAAM,CAiBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,GAAG,EACT,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,KAAK,MAAM,GACjD,MAAM,CAeR;AAED,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,YAAY,GAAG,MAAM,EACxB,CAAC,EAAE,YAAY,GAAG,MAAM,GACvB,MAAM,CAUR"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ZelloContact, ZelloHistoryMessage, ZelloIncomingEmergency } from '../types';
|
|
2
|
+
export declare const isSameContact: (a: ZelloContact, b: ZelloContact) => boolean;
|
|
3
|
+
export declare const isAndroid: boolean;
|
|
4
|
+
export declare const isiOS: boolean;
|
|
5
|
+
export declare function bridgeContactToSdkContact(eventContact: any): ZelloContact | undefined;
|
|
6
|
+
export declare function bridgeIncomingEmergencyToSdkIncomingEmergency(emergency: any): ZelloIncomingEmergency | undefined;
|
|
7
|
+
export declare function bridgeHistoryMessageToSdkHistoryMessage(message: any): ZelloHistoryMessage | undefined;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAIZ,mBAAmB,EAGnB,sBAAsB,EAGvB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,aAAa,MAAO,YAAY,KAAK,YAAY,KAAG,OACG,CAAC;AAErE,eAAO,MAAM,SAAS,SAA4B,CAAC;AACnD,eAAO,MAAM,KAAK,SAAwB,CAAC;AAE3C,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,GAAG,GAChB,YAAY,GAAG,SAAS,CAiC1B;AAED,wBAAgB,6CAA6C,CAC3D,SAAS,EAAE,GAAG,GACb,sBAAsB,GAAG,SAAS,CAYpC;AAED,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,GAAG,GACX,mBAAmB,GAAG,SAAS,CAkEjC"}
|