@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.
Files changed (84) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +21 -0
  3. package/android/build.gradle +122 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/zellosdk/DummyPackage.kt +18 -0
  8. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModule.kt +437 -0
  9. package/android/src/main/java/com/zellosdk/ZelloAndroidSdkModuleHelper.kt +198 -0
  10. package/ios/Extensions/Date+Extension.swift +5 -0
  11. package/ios/Extensions/UIImage+Extension.swift +9 -0
  12. package/ios/Extensions/ZelloContact+Extension.swift +52 -0
  13. package/ios/Extensions/ZelloHistoryAlertMessage+Extension.swift +18 -0
  14. package/ios/Extensions/ZelloHistoryImageMessage+Extension.swift +17 -0
  15. package/ios/Extensions/ZelloHistoryLocationMessage+Extension.swift +23 -0
  16. package/ios/Extensions/ZelloHistoryTextMessage+Extension.swift +18 -0
  17. package/ios/Extensions/ZelloHistoryVoiceMessage+Extension.swift +18 -0
  18. package/ios/Extensions/ZelloIOSSdkModule+Extension.swift +285 -0
  19. package/ios/Extensions/ZelloIncomingEmergency+Extension.swift +16 -0
  20. package/ios/Extensions/ZelloOutgoingEmergency+Extension.swift +14 -0
  21. package/ios/Extensions/ZelloRecentEntry+Extension.swift +16 -0
  22. package/ios/ZelloIOSSdkModule.swift +209 -0
  23. package/ios/ZelloIOSSdkModuleBridge.h +5 -0
  24. package/ios/ZelloIOSSdkModuleBridge.m +44 -0
  25. package/lib/commonjs/events/index.js +43 -0
  26. package/lib/commonjs/events/index.js.map +1 -0
  27. package/lib/commonjs/index.js +47 -0
  28. package/lib/commonjs/index.js.map +1 -0
  29. package/lib/commonjs/package.json +1 -0
  30. package/lib/commonjs/sdk/index.js +833 -0
  31. package/lib/commonjs/sdk/index.js.map +1 -0
  32. package/lib/commonjs/types/index.js +518 -0
  33. package/lib/commonjs/types/index.js.map +1 -0
  34. package/lib/commonjs/utils/algorithms/index.js +79 -0
  35. package/lib/commonjs/utils/algorithms/index.js.map +1 -0
  36. package/lib/commonjs/utils/index.js +60 -0
  37. package/lib/commonjs/utils/index.js.map +1 -0
  38. package/lib/module/events/index.js +39 -0
  39. package/lib/module/events/index.js.map +1 -0
  40. package/lib/module/index.js +10 -0
  41. package/lib/module/index.js.map +1 -0
  42. package/lib/module/package.json +1 -0
  43. package/lib/module/sdk/index.js +829 -0
  44. package/lib/module/sdk/index.js.map +1 -0
  45. package/lib/module/types/index.js +547 -0
  46. package/lib/module/types/index.js.map +1 -0
  47. package/lib/module/utils/algorithms/index.js +72 -0
  48. package/lib/module/utils/algorithms/index.js.map +1 -0
  49. package/lib/module/utils/index.js +52 -0
  50. package/lib/module/utils/index.js.map +1 -0
  51. package/lib/typescript/commonjs/package.json +1 -0
  52. package/lib/typescript/commonjs/src/events/index.d.ts +192 -0
  53. package/lib/typescript/commonjs/src/events/index.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/src/index.d.ts +6 -0
  55. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/sdk/index.d.ts +221 -0
  57. package/lib/typescript/commonjs/src/sdk/index.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/types/index.d.ts +560 -0
  59. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts +21 -0
  61. package/lib/typescript/commonjs/src/utils/algorithms/index.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/utils/index.d.ts +8 -0
  63. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
  64. package/lib/typescript/module/package.json +1 -0
  65. package/lib/typescript/module/src/events/index.d.ts +192 -0
  66. package/lib/typescript/module/src/events/index.d.ts.map +1 -0
  67. package/lib/typescript/module/src/index.d.ts +6 -0
  68. package/lib/typescript/module/src/index.d.ts.map +1 -0
  69. package/lib/typescript/module/src/sdk/index.d.ts +221 -0
  70. package/lib/typescript/module/src/sdk/index.d.ts.map +1 -0
  71. package/lib/typescript/module/src/types/index.d.ts +560 -0
  72. package/lib/typescript/module/src/types/index.d.ts.map +1 -0
  73. package/lib/typescript/module/src/utils/algorithms/index.d.ts +21 -0
  74. package/lib/typescript/module/src/utils/algorithms/index.d.ts.map +1 -0
  75. package/lib/typescript/module/src/utils/index.d.ts +8 -0
  76. package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
  77. package/package.json +195 -0
  78. package/react-native-zello-sdk.podspec +43 -0
  79. package/src/events/index.ts +191 -0
  80. package/src/index.ts +8 -0
  81. package/src/sdk/index.ts +1038 -0
  82. package/src/types/index.ts +818 -0
  83. package/src/utils/algorithms/index.ts +88 -0
  84. package/src/utils/index.ts +145 -0
@@ -0,0 +1,192 @@
1
+ export declare enum ZelloEvent {
2
+ /**
3
+ * The connection to the Zello Work network has failed.
4
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Disconnected | ZelloConnectionState.Disconnected}.
5
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
6
+ * @param {@link types.ZelloConnectionError | ZelloConnectionError} error The error that caused the connection to fail.
7
+ */
8
+ CONNECT_FAILED = "onConnectFailed",
9
+ /**
10
+ * The connection to the Zello Work network has started.
11
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Connecting | ZelloConnectionState.Connecting}.
12
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
13
+ * */
14
+ CONNECT_STARTED = "onConnectStarted",
15
+ /**
16
+ * The connection to the Zello Work network has succeeded.
17
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Connected | ZelloConnectionState.Connected}.
18
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
19
+ * */
20
+ CONNECT_SUCCEEDED = "onConnectSucceeded",
21
+ /**
22
+ * The connection to the Zello Work network has been disconnected.
23
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Disconnected | ZelloConnectionState.Disconnected}.
24
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
25
+ */
26
+ DISCONNECTED = "onDisconnected",
27
+ /**
28
+ * The connection to the Zello Work network is attempting to reconnect.
29
+ * {@link sdk.Zello.state | Zello.state} will be {@link types.ZelloConnectionState.Reconnecting | ZelloConnectionState.Reconnecting}.
30
+ * @param {@link types.ZelloConnectionState | ZelloConnectionState} state The current state of the connection.
31
+ */
32
+ RECONNECTING = "onWillReconnect",
33
+ /**
34
+ * The contact list has been updated.
35
+ * {@link sdk.Zello.users | Zello.users} and @{link sdk.Zello.channels | Zello.channels} will be updated.
36
+ * @param {@link types.ZelloUser | ZelloUser[]} users The list of users.
37
+ * @param {@link types.ZelloChannel | ZelloChannel[]} channels The list of channels.
38
+ */
39
+ CONTACT_LIST_UPDATED = "onContactListUpdated",
40
+ /**
41
+ * The selected contact has changed.
42
+ * {@link sdk.Zello.selectedContact | Zello.selectedContact} will be updated.
43
+ * @param {@link types.ZelloContact | ZelloContact} contact The selected contact.
44
+ */
45
+ SELECTED_CONTACT_CHANGED = "onSelectedContactChanged",
46
+ /**
47
+ * The account status has changed.
48
+ * {@link sdk.Zello.accountStatus | Zello.accountStatus} will be updated.
49
+ * @param {@link types.ZelloAccountStatus | ZelloAccountStatus} status The current account status.
50
+ */
51
+ ACCOUNT_STATUS_CHANGED = "onAccountStatusChanged",
52
+ /**
53
+ * An incoming voice message has started.
54
+ * {@link sdk.Zello.incomingVoiceMessage | Zello.incomingVoiceMessage} will be updated.
55
+ * @param {@link types.ZelloIncomingVoiceMessage | ZelloIncomingVoiceMessage} voiceMessage The incoming voice message.
56
+ */
57
+ INCOMING_VOICE_MESSAGE_STARTED = "onIncomingVoiceMessageStarted",
58
+ /**
59
+ * An incoming voice message has stopped.
60
+ * {@link sdk.Zello.incomingVoiceMessage | Zello.incomingVoiceMessage} will be set to undefined.
61
+ * @param {@link types.ZelloIncomingVoiceMessage | ZelloIncomingVoiceMessage} voiceMessage The incoming voice message.
62
+ */
63
+ INCOMING_VOICE_MESSAGE_STOPPED = "onIncomingVoiceMessageStopped",
64
+ /**
65
+ * An outgoing voice message is connecting.
66
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be updated.
67
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
68
+ */
69
+ OUTGOING_VOICE_MESSAGE_CONNECTING = "onOutgoingVoiceMessageConnecting",
70
+ /**
71
+ * An outgoing voice message has started.
72
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be updated.
73
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
74
+ */
75
+ OUTGOING_VOICE_MESSAGE_STARTED = "onOutgoingVoiceMessageStarted",
76
+ /**
77
+ * An outgoing voice message has stopped.
78
+ * {@link sdk.Zello.outgoingVoiceMessage | Zello.outgoingVoiceMessage} will be set to undefined.
79
+ * @param {@link types.ZelloOutgoingVoiceMessage | ZelloOutgoingVoiceMessage} voiceMessage The outgoing voice message.
80
+ * @param {@link types.ZelloOutgoingVoiceMessageState} error Optional; An error that caused the outgoing voice message to stop.
81
+ */
82
+ OUTGOING_VOICE_MESSAGE_STOPPED = "onOutgoingVoiceMessageStopped",
83
+ /**
84
+ * An incoming image message has been received.
85
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The incoming image message.
86
+ */
87
+ INCOMING_IMAGE_MESSAGE_RECEIVED = "onIncomingImageMessage",
88
+ /**
89
+ * An outgoing image message has been sent.
90
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The outgoing image message.
91
+ */
92
+ OUTGOING_IMAGE_MESSAGE_SENT = "onOutgoingImageMessageSent",
93
+ /**
94
+ * An outgoing image message has failed to send.
95
+ * @param {@link types.ZelloImageMessage | ZelloImageMessage} imageMessage The outgoing image message.
96
+ */
97
+ OUTGOING_IMAGE_MESSAGE_SEND_FAILED = "onOutgoingImageMessageSendFailed",
98
+ /**
99
+ * An incoming alert message has been received.
100
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The incoming alert message.
101
+ */
102
+ INCOMING_ALERT_MESSAGE_RECEIVED = "onIncomingAlertMessage",
103
+ /**
104
+ * An outgoing alert message has been sent.
105
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The outgoing alert message.
106
+ */
107
+ OUTGOING_ALERT_MESSAGE_SENT = "onOutgoingAlertMessageSent",
108
+ /**
109
+ * An outgoing alert message has failed to send.
110
+ * @param {@link types.ZelloAlertMessage | ZelloAlertMessage} alertMessage The outgoing alert message.
111
+ */
112
+ OUTGOING_ALERT_MESSAGE_SEND_FAILED = "onOutgoingAlertMessageSendFailed",
113
+ /**
114
+ * An incoming text message has been received.
115
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The incoming text message.
116
+ */
117
+ INCOMING_TEXT_MESSAGE_RECEIVED = "onIncomingTextMessage",
118
+ /**
119
+ * An outgoing text message has been sent.
120
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The outgoing text message.
121
+ */
122
+ OUTGOING_TEXT_MESSAGE_SENT = "onOutgoingTextMessageSent",
123
+ /**
124
+ * An outgoing text message has failed to send.
125
+ * @param {@link types.ZelloTextMessage | ZelloTextMessage} textMessage The outgoing text message.
126
+ */
127
+ OUTGOING_TEXT_MESSAGE_SEND_FAILED = "onOutgoingTextMessageSendFailed",
128
+ /**
129
+ * An incoming location message has been received.
130
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The incoming location message.
131
+ */
132
+ INCOMING_LOCATION_MESSAGE_RECEIVED = "onIncomingLocationMessage",
133
+ /**
134
+ * An outgoing location message has been sent.
135
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The outgoing location message.
136
+ */
137
+ OUTGOING_LOCATION_MESSAGE_SENT = "onOutgoingLocationMessageSent",
138
+ /**
139
+ * An outgoing location message has failed to send.
140
+ * @param {@link types.ZelloLocationMessage | ZelloLocationMessage} locationMessage The outgoing location message.
141
+ */
142
+ OUTGOING_LOCATION_MESSAGE_SEND_FAILED = "onOutgoingLocationMessageSendFailed",
143
+ /**
144
+ * An incoming emergency has started.
145
+ * {@link sdk.Zello.incomingEmergencies | Zello.incomingEmergencies} will be updated.
146
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency} emergency The incoming emergency.
147
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency[]} emergencies The list of incoming emergencies.
148
+ */
149
+ INCOMING_EMERGENCY_STARTED = "onIncomingEmergencyStarted",
150
+ /**
151
+ * An incoming emergency has stopped.
152
+ * {@link sdk.Zello.incomingEmergencies | Zello.incomingEmergencies} will be updated.
153
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency} emergency The stopped incoming emergency.
154
+ * @param {@link types.ZelloIncomingEmergency | ZelloIncomingEmergency[]} emergencies The list of incoming emergencies.
155
+ */
156
+ INCOMING_EMERGENCY_STOPPED = "onIncomingEmergencyStopped",
157
+ /**
158
+ * An outgoing emergency has started.
159
+ * {@link sdk.Zello.outgoingEmergency | Zello.outgoingEmergency} will be updated.
160
+ * @param {@link types.ZelloOutgoingEmergency | ZelloOutgoingEmergency} emergency The outgoing emergency.
161
+ */
162
+ OUTGOING_EMERGENCY_STARTED = "onOutgoingEmergencyStarted",
163
+ /**
164
+ * An outgoing emergency has stopped.
165
+ * {@link sdk.Zello.outgoingEmergency | Zello.outgoingEmergency} will be set to undefined.
166
+ * @param {@link types.ZelloOutgoingEmergency | ZelloOutgoingEmergency} emergency The stopped outgoing emergency.
167
+ */
168
+ OUTGOING_EMERGENCY_STOPPED = "onOutgoingEmergencyStopped",
169
+ /**
170
+ * The list of recent entries has been updated.
171
+ * {@link sdk.Zello.recents | Zello.recents} will be updated.
172
+ * @param {@link types.ZelloRecentEntry | ZelloRecentEntry[]} recents The list of recent entries.
173
+ */
174
+ RECENTS_UPDATED = "onRecentsUpdated",
175
+ /**
176
+ * The history has been updated.
177
+ */
178
+ HISTORY_UPDATED = "onHistoryUpdated",
179
+ /**
180
+ * The history playback of a voice message has started.
181
+ * {@link sdk.Zello.historyVoiceMessage | Zello.historyVoiceMessage} will be updated.
182
+ * @param {@link types.ZelloHistoryVoiceMessage | ZelloHistoryVoiceMessage} voiceMessage The started history voice message.
183
+ */
184
+ HISTORY_PLAYBACK_STARTED = "onHistoryPlaybackStarted",
185
+ /**
186
+ * The history playback of a voice message has stopped.
187
+ * {@link sdk.Zello.historyVoiceMessage | Zello.historyVoiceMessage} will be set to undefined.
188
+ * @param {@link types.ZelloHistoryVoiceMessage | ZelloHistoryVoiceMessage} voiceMessage The stopped history voice message.
189
+ */
190
+ HISTORY_PLAYBACK_STOPPED = "onHistoryPlaybackStopped"
191
+ }
192
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/events/index.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB;;;;;OAKG;IACH,cAAc,oBAAoB;IAClC;;;;SAIK;IACL,eAAe,qBAAqB;IACpC;;;;SAIK;IACL,iBAAiB,uBAAuB;IACxC;;;;OAIG;IACH,YAAY,mBAAmB;IAC/B;;;;OAIG;IACH,YAAY,oBAAoB;IAChC;;;;;OAKG;IACH,oBAAoB,yBAAyB;IAC7C;;;;OAIG;IACH,wBAAwB,6BAA6B;IACrD;;;;OAIG;IACH,sBAAsB,2BAA2B;IACjD;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;OAIG;IACH,iCAAiC,qCAAqC;IACtE;;;;OAIG;IACH,8BAA8B,kCAAkC;IAChE;;;;;OAKG;IACH,8BAA8B,kCAAkC;IAChE;;;OAGG;IACH,+BAA+B,2BAA2B;IAC1D;;;OAGG;IACH,2BAA2B,+BAA+B;IAC1D;;;OAGG;IACH,kCAAkC,qCAAqC;IACvE;;;OAGG;IACH,+BAA+B,2BAA2B;IAC1D;;;OAGG;IACH,2BAA2B,+BAA+B;IAC1D;;;OAGG;IACH,kCAAkC,qCAAqC;IACvE;;;OAGG;IACH,8BAA8B,0BAA0B;IACxD;;;OAGG;IACH,0BAA0B,8BAA8B;IACxD;;;OAGG;IACH,iCAAiC,oCAAoC;IACrE;;;OAGG;IACH,kCAAkC,8BAA8B;IAChE;;;OAGG;IACH,8BAA8B,kCAAkC;IAChE;;;OAGG;IACH,qCAAqC,wCAAwC;IAC7E;;;;;OAKG;IACH,0BAA0B,+BAA+B;IACzD;;;;;OAKG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,0BAA0B,+BAA+B;IACzD;;;;OAIG;IACH,eAAe,qBAAqB;IACpC;;OAEG;IACH,eAAe,qBAAqB;IACpC;;;;OAIG;IACH,wBAAwB,6BAA6B;IACrD;;;;OAIG;IACH,wBAAwB,6BAA6B;CACtD"}
@@ -0,0 +1,6 @@
1
+ import { Zello } from './sdk';
2
+ export default Zello;
3
+ export * from './events';
4
+ export * from './types';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,eAAe,KAAK,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,221 @@
1
+ import { ZelloAccountStatus, ZelloChannel, ZelloChannelAlertLevel, ZelloConfig, ZelloConnectionState, ZelloContact, ZelloCredentials, ZelloHistoryImageMessage, ZelloHistoryMessage, ZelloHistoryVoiceMessage, ZelloIncomingEmergency, ZelloIncomingVoiceMessage, ZelloOutgoingEmergency, ZelloOutgoingVoiceMessage, ZelloRecentEntry, ZelloUser } from '../types';
2
+ import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
3
+ /**
4
+ * Zello SDK.
5
+ * This class is a singleton, and can be accessed via {@link Zello.getInstance}.
6
+ */
7
+ export declare class Zello extends EventEmitter {
8
+ private static instance;
9
+ static getInstance(): Zello;
10
+ /**
11
+ * The current connection state of the SDK.
12
+ */
13
+ state: ZelloConnectionState;
14
+ /**
15
+ * The currently selected contact.
16
+ */
17
+ selectedContact: ZelloContact | undefined;
18
+ /**
19
+ * The list of {@link ZelloUser} in the contact list. Sorted by name, ascending.
20
+ */
21
+ users: ZelloUser[];
22
+ /**
23
+ * The list of {@link ZelloChannel} in the contact list. Sorted by name, ascending.
24
+ */
25
+ channels: ZelloChannel[];
26
+ /**
27
+ * The current account status. undefined when {@link state} is not {@link ZelloConnectionState.Connected}.
28
+ */
29
+ accountStatus: ZelloAccountStatus | undefined;
30
+ /**
31
+ * The current incoming voice message.
32
+ */
33
+ incomingVoiceMessage: ZelloIncomingVoiceMessage | undefined;
34
+ /**
35
+ * The current outgoing voice message.
36
+ */
37
+ outgoingVoiceMessage: ZelloOutgoingVoiceMessage | undefined;
38
+ /**
39
+ * The configured emergency channel.
40
+ */
41
+ emergencyChannel: ZelloChannel | undefined;
42
+ /**
43
+ * The list of incoming emergencies. There can be multiple emergencies on the emergency channel at once.
44
+ * Sorted by start timestamp, ascending.
45
+ */
46
+ incomingEmergencies: ZelloIncomingEmergency[];
47
+ /**
48
+ * The current outgoing emergency.
49
+ */
50
+ outgoingEmergency: ZelloOutgoingEmergency | undefined;
51
+ /**
52
+ * The list of recent entries. Sorted by timestamp, descending.
53
+ */
54
+ recents: ZelloRecentEntry[];
55
+ /**
56
+ * The currently playing history voice message.
57
+ */
58
+ historyVoiceMessage: ZelloHistoryVoiceMessage | undefined;
59
+ private eventListener;
60
+ private constructor();
61
+ /**
62
+ * Sets configuration variables for the SDK.
63
+ *
64
+ * At the moment, this is only functional on Android.
65
+ *
66
+ * @param config The configuration to set.
67
+ */
68
+ configure(config: ZelloConfig): void;
69
+ /**
70
+ * Destroys the SDK instance and cleans up resources.
71
+ * Call this when you are done using the SDK instance for good (application quit).
72
+ */
73
+ destroy(): void;
74
+ /**
75
+ * Signs into to the Zello Work network using the provided credentials.
76
+ * This will typically trigger the {@link ZelloEvent.CONNECT_STARTED} event, followed by either {@link ZelloEvent.CONNECT_SUCCEEDED} or {@link ZelloEvent.CONNECT_FAILED}.
77
+ * However, if the state is incorrect, {@link ZelloEvent.CONNECT_FAILED} will be triggered immediately.
78
+ * @param credentials The credentials to use for signing in.
79
+ */
80
+ connect(credentials: ZelloCredentials): void;
81
+ /**
82
+ * Signs out of the Zello Work network.
83
+ * This will trigger the {@link ZelloEvent.DISCONNECTED} event.
84
+ */
85
+ disconnect(): void;
86
+ /**
87
+ * Returns the user with the given name. Case-insensitive.
88
+ * @param name The name of the user to search for.
89
+ * @return The user with the given name, or null if no user with that name exists.
90
+ */
91
+ getUser(name: string): ZelloUser | undefined;
92
+ /**
93
+ * Returns the channel with the given name. Case-insensitive.
94
+ * @param name The name of the channel to search for.
95
+ * @return The channel with the given name, or null if no channel with that name exists.
96
+ */
97
+ getChannel(name: string): ZelloChannel | undefined;
98
+ /**
99
+ * Sets the selected contact.
100
+ * While optional, this is typically used for tracking the contact that the user is currently interacting with.
101
+ * This will trigger the {@link ZelloEvent.SELECTED_CONTACT_CHANGED} event.
102
+ * @param contact The contact to set as selected.
103
+ */
104
+ setSelectedContact(contact: ZelloContact): void;
105
+ /**
106
+ * Sets the user's online account status.
107
+ * This will trigger the {@link ZelloEvent.ACCOUNT_STATUS_CHANGED} event.
108
+ * @param status The account status to set.
109
+ */
110
+ setAccountStatus(status: ZelloAccountStatus): void;
111
+ /**
112
+ * Connects to the given channel.
113
+ * Once connected, the user will be able to send and receive messages from the channel.
114
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
115
+ * @param channel The channel to connect to.
116
+ */
117
+ connectChannel(channel: ZelloChannel): void;
118
+ /**
119
+ * Disconnects from the given channel.
120
+ * Once disconnected, the user will no longer be able to send or receive messages from the channel.
121
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
122
+ * @param channel The channel to disconnect from.
123
+ */
124
+ disconnectChannel(channel: ZelloChannel): void;
125
+ /**
126
+ * Starts a voice message with the given contact.
127
+ * This will trigger the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_CONNECTING} event, followed by the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STARTED} event.
128
+ * If there is an error, the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STOPPED} event will be triggered.
129
+ * @param contact The contact to start the voice message with.
130
+ */
131
+ startVoiceMessage(contact: ZelloContact): void;
132
+ /**
133
+ * Stops the current outgoing voice message.
134
+ * This will trigger the {@link ZelloEvent.OUTGOING_VOICE_MESSAGE_STOPPED} event.
135
+ */
136
+ stopVoiceMessage(): void;
137
+ /**
138
+ * Sends the image message data to the given contact.
139
+ * This will trigger the {@link ZelloEvent.OUTGOING_IMAGE_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_IMAGE_MESSAGE_SEND_FAILED} event.
140
+ * @param contact The contact to send the image to.
141
+ * @param data The image data to send.
142
+ */
143
+ sendImage(contact: ZelloContact, data: number[]): void;
144
+ /**
145
+ * Sends the alert message to the given contact.
146
+ * This will trigger the {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SEND_FAILED} event.
147
+ * @param contact The contact to send the alert to.
148
+ */
149
+ sendLocation(contact: ZelloContact): void;
150
+ /**
151
+ * Sends the text message to the given contact.
152
+ * This will trigger the {@link ZelloEvent.OUTGOING_TEXT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_TEXT_MESSAGE_SEND_FAILED} event.
153
+ * @param contact The contact to send the text to.
154
+ * @param text The text to send.
155
+ */
156
+ sendText(contact: ZelloContact, text: string): void;
157
+ /**
158
+ * Sends the alert message to the given contact.
159
+ * This will trigger the {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SENT} or {@link ZelloEvent.OUTGOING_ALERT_MESSAGE_SEND_FAILED} event.
160
+ * @param contact The contact to send the alert to.
161
+ * @param text The text to send.
162
+ * @param level Optional; The alert level to send. Only applicable for channels.
163
+ */
164
+ sendAlert(contact: ZelloContact, text: string, level?: ZelloChannelAlertLevel): void;
165
+ /**
166
+ * Submits a problem report to Zello.
167
+ * Additionally, please contact us to provide more information on what happened.
168
+ */
169
+ submitProblemReport(): void;
170
+ /**
171
+ * Mutes the given contact. When muted, incoming messages from this contact will not play live, but will still appear in the history.
172
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
173
+ * @param contact The contact to mute.
174
+ */
175
+ muteContact(contact: ZelloContact): void;
176
+ /**
177
+ * Unmutes a previously muted contact. When unmuted, incoming messages from this contact will play live.
178
+ * This will trigger the {@link ZelloEvent.CONTACT_LIST_UPDATED} event.
179
+ * @param contact The contact to unmute.
180
+ */
181
+ unmuteContact(contact: ZelloContact): void;
182
+ /**
183
+ * Starts an outgoing emergency to the emergency channel.
184
+ * Upon starting, the user's location will be sent, an alert message will be sent, and a 10-second-long voice message will start recording.
185
+ * This will trigger the {@link ZelloEvent.OUTGOING_EMERGENCY_STARTED} event.
186
+ */
187
+ startEmergency(): void;
188
+ /**
189
+ * Stops the outgoing emergency.
190
+ * This will trigger the {@link ZelloEvent.OUTGOING_EMERGENCY_STOPPED} event.
191
+ */
192
+ stopEmergency(): void;
193
+ /**
194
+ * Returns the history messages for the given contact.
195
+ * @param contact The contact to get the history for.
196
+ * @param size Optional; The number of history items to retrieve. Defaults to 50.
197
+ * @return The history items for the given contact.
198
+ */
199
+ getHistory(contact: ZelloContact, size?: number): Promise<ZelloHistoryMessage[]>;
200
+ /**
201
+ * Plays the given history message.
202
+ * This will trigger the {@link ZelloEvent.HISTORY_PLAYBACK_STARTED} event.
203
+ * @param message The history message to play.
204
+ */
205
+ playHistoryMessage(message: ZelloHistoryVoiceMessage): void;
206
+ /**
207
+ * Stops the current history message playback.
208
+ * This will trigger the {@link ZelloEvent.HISTORY_PLAYBACK_STOPPED} event.
209
+ */
210
+ stopHistoryMessagePlayback(): void;
211
+ /**
212
+ * Returns the image data for the given history image message.
213
+ * @param message The history image message to get the image data for.
214
+ * @return The image data for the given history image message.
215
+ */
216
+ getImageDataForHistoryImageMessage(message: ZelloHistoryImageMessage): Promise<string | undefined>;
217
+ private setupEventListener;
218
+ private clearContactList;
219
+ private static getSdk;
220
+ }
221
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAElB,YAAY,EACZ,sBAAsB,EAEtB,WAAW,EAEX,oBAAoB,EACpB,YAAY,EAEZ,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EAExB,sBAAsB,EACtB,yBAAyB,EAEzB,sBAAsB,EACtB,yBAAyB,EAGzB,gBAAgB,EAEhB,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAW9E;;;GAGG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAQ;WAEjB,WAAW,IAAI,KAAK;IAOlC;;OAEG;IACI,KAAK,EAAE,oBAAoB,CAAqC;IAEvE;;OAEG;IACI,eAAe,EAAE,YAAY,GAAG,SAAS,CAAC;IAEjD;;OAEG;IACI,KAAK,EAAE,SAAS,EAAE,CAAM;IAC/B;;OAEG;IAC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