@types/ari-client 2.2.3 → 2.2.7

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.
ari-client/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for ari-client (https://github.com/asteri
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ari-client.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 07 Jul 2021 21:44:31 GMT
11
+ * Last updated: Thu, 25 Nov 2021 21:01:10 GMT
12
12
  * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
13
13
  * Global values: none
14
14
 
ari-client/index.d.ts CHANGED
@@ -28,22 +28,30 @@ export interface TextMessageVariable {
28
28
  }
29
29
 
30
30
  export interface Client extends Resource {
31
+ /**
32
+ * Creates the WebSocket connection, subscribing to the given apps.
33
+ *
34
+ * @param apps - Name or array of names of the applications to be started.
35
+ * @param [subscribeAll] - Subscribe to all Asterisk events (true/false).
36
+ */
37
+ start(apps: string | string[], subscribeAll?: boolean): Promise<void>;
38
+
31
39
  /**
32
40
  * Creates the WebSocket connection, subscribing to the given apps.
33
41
  *
34
42
  * @param apps - Name or array of names of the applications to be started.
35
43
  * @param subscribeAll - Subscribe to all Asterisk events (true/false).
36
- * @param [callback] - The callback to be called after applications have started.
44
+ * @param callback - The callback to be called after applications have started.
37
45
  */
38
- start(apps: string | string[], subscribeAll: boolean, callback?: (err: Error, ...args: any[]) => void): void;
46
+ start(apps: string | string[], subscribeAll: boolean, callback: (err: Error, ...args: any[]) => void): void;
39
47
 
40
48
  /**
41
49
  * Creates the WebSocket connection, subscribing to the given apps.
42
50
  *
43
51
  * @param apps - Name or array of names of the applications to be started.
44
- * @param [callback] - The callback to be called after applications have started.
52
+ * @param callback - The callback to be called after applications have started.
45
53
  */
46
- start(apps: string | string[], callback?: (err: Error, ...args: any[]) => void): void;
54
+ start(apps: string | string[], callback: (err: Error, ...args: any[]) => void): void;
47
55
 
48
56
  /**
49
57
  * Closes the WebSocket connection.
@@ -173,6 +181,10 @@ export interface IndexableObject {
173
181
  [key: string]: any;
174
182
  }
175
183
  /* Event Types */
184
+ export type WebSocketConnectedEventType = 'WebSocketConnected';
185
+ export type WebSocketReconnectingEventType = 'WebSocketReconnecting';
186
+ export type WebSocketMaxRetriesEventType = 'WebSocketMaxRetries';
187
+ export type PongEventType = 'pong';
176
188
  export type APILoadErrorEventType = 'APILoadError';
177
189
  export type EventsEventType = 'Events';
178
190
  export type MessageEventType = 'Message';
@@ -219,6 +231,11 @@ export type StasisStartEventType = 'StasisStart';
219
231
  export type TextMessageReceivedEventType = 'TextMessageReceived';
220
232
  export type ChannelConnectedLineEventType = 'ChannelConnectedLine';
221
233
  export type AnyEventType =
234
+ | WebSocketConnectedEventType
235
+ | WebSocketReconnectingEventType
236
+ | WebSocketMaxRetriesEventType
237
+ | PongEventType
238
+ | APILoadErrorEventType
222
239
  | EventsEventType
223
240
  | MessageEventType
224
241
  | MissingParamsEventType
@@ -892,6 +909,41 @@ export interface ChannelConnectedLine extends Event {
892
909
  channel: Channel;
893
910
  }
894
911
  export interface Resource {
912
+ /**
913
+ * The ARI client instance.
914
+ */
915
+ _client: Client;
916
+
917
+ /**
918
+ * Error emitted when WebSocket reconnection attempts exceeded MaxRetries.
919
+ */
920
+ // tslint:disable-next-line:unified-signatures
921
+ on(type: WebSocketMaxRetriesEventType, listener: (err: Error) => void): void;
922
+
923
+ /**
924
+ * Error emitted when the WebSocket is reconnecting.
925
+ */
926
+ // tslint:disable-next-line:unified-signatures
927
+ on(type: WebSocketReconnectingEventType, listener: (err: Error) => void): void;
928
+
929
+ /**
930
+ * Event emitted when the WebSocket is connected.
931
+ */
932
+ // tslint:disable-next-line:unified-signatures
933
+ on(type: WebSocketConnectedEventType, listener: () => void): void;
934
+
935
+ /**
936
+ * Event emitted when a WebSocket pong is received.
937
+ */
938
+ // tslint:disable-next-line:unified-signatures
939
+ on(type: PongEventType, listener: () => void): void;
940
+
941
+ /**
942
+ * Error event sent when connection to API fails.
943
+ */
944
+ // tslint:disable-next-line:unified-signatures
945
+ on(type: APILoadErrorEventType, listener: (err: Error) => void): void;
946
+
895
947
  /**
896
948
  * Base type for errors and events.
897
949
  */
@@ -1138,6 +1190,36 @@ export interface Resource {
1138
1190
  */
1139
1191
  on(event: ChannelConnectedLineEventType, callback: (event: ChannelConnectedLine, channel: Channel) => void): void;
1140
1192
 
1193
+ /**
1194
+ * Error emitted when WebSocket reconnection attempts exceeded MaxRetries.
1195
+ */
1196
+ // tslint:disable-next-line:unified-signatures
1197
+ once(type: WebSocketMaxRetriesEventType, listener: (err: Error) => void): void;
1198
+
1199
+ /**
1200
+ * Error emitted when the WebSocket is reconnecting.
1201
+ */
1202
+ // tslint:disable-next-line:unified-signatures
1203
+ once(type: WebSocketReconnectingEventType, listener: (err: Error) => void): void;
1204
+
1205
+ /**
1206
+ * Event emitted when the WebSocket is connected.
1207
+ */
1208
+ // tslint:disable-next-line:unified-signatures
1209
+ once(type: WebSocketConnectedEventType, listener: () => void): void;
1210
+
1211
+ /**
1212
+ * Event emitted when a WebSocket pong is received.
1213
+ */
1214
+ // tslint:disable-next-line:unified-signatures
1215
+ once(type: PongEventType, listener: () => void): void;
1216
+
1217
+ /**
1218
+ * Error event sent when connection to API fails.
1219
+ */
1220
+ // tslint:disable-next-line:unified-signatures
1221
+ once(type: APILoadErrorEventType, listener: (err: Error) => void): void;
1222
+
1141
1223
  /**
1142
1224
  * Base type for errors and events.
1143
1225
  */
@@ -1393,6 +1475,36 @@ export interface Resource {
1393
1475
  */
1394
1476
  once(event: ChannelConnectedLineEventType, callback: (event: ChannelConnectedLine, channel: Channel) => void): void;
1395
1477
 
1478
+ /**
1479
+ * Error emitted when WebSocket reconnection attempts exceeded MaxRetries.
1480
+ */
1481
+ // tslint:disable-next-line:unified-signatures
1482
+ addListener(type: WebSocketMaxRetriesEventType, listener: (err: Error) => void): void;
1483
+
1484
+ /**
1485
+ * Error emitted when the WebSocket is reconnecting.
1486
+ */
1487
+ // tslint:disable-next-line:unified-signatures
1488
+ addListener(type: WebSocketReconnectingEventType, listener: (err: Error) => void): void;
1489
+
1490
+ /**
1491
+ * Event emitted when the WebSocket is connected.
1492
+ */
1493
+ // tslint:disable-next-line:unified-signatures
1494
+ addListener(type: WebSocketConnectedEventType, listener: () => void): void;
1495
+
1496
+ /**
1497
+ * Event emitted when a WebSocket pong is received.
1498
+ */
1499
+ // tslint:disable-next-line:unified-signatures
1500
+ addListener(type: PongEventType, listener: () => void): void;
1501
+
1502
+ /**
1503
+ * Error event sent when connection to API fails.
1504
+ */
1505
+ // tslint:disable-next-line:unified-signatures
1506
+ addListener(type: APILoadErrorEventType, listener: (err: Error) => void): void;
1507
+
1396
1508
  /**
1397
1509
  * Base type for errors and events.
1398
1510
  */
ari-client/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/ari-client",
3
- "version": "2.2.3",
3
+ "version": "2.2.7",
4
4
  "description": "TypeScript definitions for ari-client",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ari-client",
6
6
  "license": "MIT",
@@ -22,6 +22,6 @@
22
22
  "dependencies": {
23
23
  "@types/node": "*"
24
24
  },
25
- "typesPublisherContentHash": "853108c6c32cb8c693801d2f0b36edf6958b3f74ee822861fc411dc9be54df9e",
26
- "typeScriptVersion": "3.6"
25
+ "typesPublisherContentHash": "9d0c715a527071ed025639308513700a800d8f800663e73aa9f7785246cfb574",
26
+ "typeScriptVersion": "3.8"
27
27
  }