@splitsoftware/splitio 10.21.2-rc.0 → 10.21.2-rc.1

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.
@@ -1 +1 @@
1
- export var packageVersion = '10.21.2-rc.0';
1
+ export var packageVersion = '10.21.2-rc.1';
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageVersion = void 0;
4
- exports.packageVersion = '10.21.2-rc.0';
4
+ exports.packageVersion = '10.21.2-rc.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "10.21.2-rc.0",
3
+ "version": "10.21.2-rc.1",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -33,7 +33,7 @@
33
33
  "node": ">=6"
34
34
  },
35
35
  "dependencies": {
36
- "@splitsoftware/splitio-commons": "1.6.2-rc.3",
36
+ "@splitsoftware/splitio-commons": "1.6.2-rc.4",
37
37
  "@types/google.analytics": "0.0.40",
38
38
  "@types/ioredis": "^4.28.0",
39
39
  "ioredis": "^4.28.0",
@@ -1 +1 @@
1
- export const packageVersion = '10.21.2-rc.0';
1
+ export const packageVersion = '10.21.2-rc.1';
@@ -2,7 +2,30 @@
2
2
  // Project: http://www.split.io/
3
3
  // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
4
 
5
- /// <reference types="@splitsoftware/splitio-commons/src/types" />
5
+ /// <reference types="@splitsoftware/splitio-commons" />
6
+
7
+ /**
8
+ * NodeJS.EventEmitter interface
9
+ * @see {@link https://nodejs.org/api/events.html}
10
+ */
11
+ interface NodeJSEventEmitter extends SplitIO.IEventEmitter {
12
+ addListener(event: string, listener: (...args: any[]) => void): this;
13
+ on(event: string, listener: (...args: any[]) => void): this;
14
+ once(event: string, listener: (...args: any[]) => void): this;
15
+ removeListener(event: string, listener: (...args: any[]) => void): this;
16
+ off(event: string, listener: (...args: any[]) => void): this;
17
+ removeAllListeners(event?: string): this;
18
+ setMaxListeners(n: number): this;
19
+ getMaxListeners(): number;
20
+ listeners(event: string): Function[];
21
+ rawListeners(event: string): Function[];
22
+ emit(event: string, ...args: any[]): boolean;
23
+ listenerCount(type: string): number;
24
+ // Added in Node 6...
25
+ prependListener(event: string, listener: (...args: any[]) => void): this;
26
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
27
+ eventNames(): Array<string | symbol>;
28
+ }
6
29
 
7
30
  /****** Exposed namespace ******/
8
31
  /**
@@ -198,17 +221,17 @@ declare namespace SplitIO {
198
221
  * Representation of a manager instance with synchronous storage of the SDK.
199
222
  * @interface IManager
200
223
  */
201
- interface IManager extends EventEmitter { }
224
+ interface IManager extends NodeJSEventEmitter { }
202
225
  /**
203
226
  * Representation of a manager instance with asynchronous storage of the SDK.
204
227
  * @interface IAsyncManager
205
228
  */
206
- interface IAsyncManager extends EventEmitter { }
229
+ interface IAsyncManager extends NodeJSEventEmitter { }
207
230
  /**
208
231
  * This represents the interface for the Client instance with synchronous method calls and server-side API, where we don't have only one key.
209
232
  * @interface IClient
210
233
  */
211
- interface IClient extends IClientSS, EventEmitter { }
234
+ interface IClient extends IClientSS, NodeJSEventEmitter { }
212
235
  /**
213
236
  * This represents the interface for the SDK instance with synchronous method calls and server-side API, where we don't have only one key.
214
237
  * @interface ISDK
@@ -219,7 +242,7 @@ declare namespace SplitIO {
219
242
  * @interface IAsyncClient
220
243
  * @extends IBasicClient
221
244
  */
222
- interface IAsyncClient extends IAsyncClientSS, EventEmitter { }
245
+ interface IAsyncClient extends IAsyncClientSS, NodeJSEventEmitter { }
223
246
  /**
224
247
  * This represents the interface for the SDK instance with asynchronous method calls and server-side API, where we don't have only one key.
225
248
  * @interface IAsyncSDK
@@ -229,7 +252,28 @@ declare namespace SplitIO {
229
252
  * This represents the interface for the Client instance with attributes binding, synchronous method calls, and client-side API, where each client has a key associated and optionally a traffic type.
230
253
  * @interface IBrowserClient
231
254
  */
232
- interface IBrowserClient extends IClientWithKeyLegacy, EventEmitter { }
255
+ interface IBrowserClient extends IClientWithKey, NodeJSEventEmitter {
256
+ /**
257
+ * Tracks an event to be fed to the results product on Split Webconsole.
258
+ * @function track
259
+ * @param {string} trafficType - The traffic type of the entity related to this event.
260
+ * @param {string} eventType - The event type corresponding to this event.
261
+ * @param {number=} value - The value of this event.
262
+ * @param {Properties=} properties - The properties of this event. Values can be string, number, boolean or null.
263
+ * @returns {boolean} Whether the event was added to the queue successfully or not.
264
+ */
265
+ track(trafficType: string, eventType: string, value?: number, properties?: Properties): boolean,
266
+ /**
267
+ * Tracks an event to be fed to the results product on Split Webconsole.
268
+ * For usage on the Browser if we defined the key and also the trafficType on the settings.
269
+ * @function track
270
+ * @param {string} eventType - The event type corresponding to this event.
271
+ * @param {number=} value - The value of this event.
272
+ * @param {Properties=} properties - The properties of this event. Values can be string, number, boolean or null.
273
+ * @returns {boolean} Whether the event was added to the queue successfully or not.
274
+ */
275
+ track(eventType: string, value?: number, properties?: Properties): boolean
276
+ }
233
277
  /**
234
278
  * This represents the interface for the SDK instance with synchronous method calls and client-side API, where client instances have a key associated and optionally a traffic type.
235
279
  * @interface IBrowserSDK
@@ -238,7 +282,7 @@ declare namespace SplitIO {
238
282
  /**
239
283
  * Returns the default client instance of the SDK, associated with the key and optional traffic type provided on settings.
240
284
  * @function client
241
- * @returns {IClient} The client instance.
285
+ * @returns {IBrowserClient} The client instance.
242
286
  */
243
287
  client(): IBrowserClient,
244
288
  /**
@@ -246,7 +290,7 @@ declare namespace SplitIO {
246
290
  * @function client
247
291
  * @param {SplitKey} key The key for the new client instance.
248
292
  * @param {string=} trafficType The traffic type of the provided key.
249
- * @returns {IClientWithKeyLegacy} The client instance.
293
+ * @returns {IBrowserClient} The client instance.
250
294
  */
251
295
  client(key: SplitKey, trafficType?: string): IBrowserClient,
252
296
  }