@splitsoftware/splitio 11.0.0-rc.1 → 11.0.0-rc.2
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 = '11.0.0-rc.
|
|
1
|
+
export var packageVersion = '11.0.0-rc.2';
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = '11.0.0-rc.
|
|
1
|
+
export const packageVersion = '11.0.0-rc.2';
|
package/types/splitio.d.ts
CHANGED
|
@@ -8,28 +8,6 @@ import { RequestOptions } from "http";
|
|
|
8
8
|
export as namespace SplitIO;
|
|
9
9
|
export = SplitIO;
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* NodeJS.EventEmitter interface
|
|
13
|
-
* @see {@link https://nodejs.org/api/events.html}
|
|
14
|
-
*/
|
|
15
|
-
interface EventEmitter {
|
|
16
|
-
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
17
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
18
|
-
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
19
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
20
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
21
|
-
removeAllListeners(event?: string | symbol): this;
|
|
22
|
-
setMaxListeners(n: number): this;
|
|
23
|
-
getMaxListeners(): number;
|
|
24
|
-
listeners(event: string | symbol): Function[];
|
|
25
|
-
rawListeners(event: string | symbol): Function[];
|
|
26
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
27
|
-
listenerCount(type: string | symbol): number;
|
|
28
|
-
// Added in Node 6...
|
|
29
|
-
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
30
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
31
|
-
eventNames(): Array<string | symbol>;
|
|
32
|
-
}
|
|
33
11
|
/**
|
|
34
12
|
* @typedef {Object} EventConsts
|
|
35
13
|
* @property {string} SDK_READY The ready event.
|
|
@@ -430,10 +408,9 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
430
408
|
}
|
|
431
409
|
/**
|
|
432
410
|
* Common API for entities that expose status handlers.
|
|
433
|
-
* @
|
|
434
|
-
* @extends EventEmitter
|
|
411
|
+
* @typedef IStatusInterface
|
|
435
412
|
*/
|
|
436
|
-
|
|
413
|
+
type IStatusInterface<TEventEmitter extends SplitIO.IEventEmitter = SplitIO.EventEmitter> = TEventEmitter & {
|
|
437
414
|
/**
|
|
438
415
|
* Constant object containing the SDK events for you to use.
|
|
439
416
|
* @property {EventConsts} Event
|
|
@@ -461,10 +438,9 @@ interface IStatusInterface extends EventEmitter {
|
|
|
461
438
|
}
|
|
462
439
|
/**
|
|
463
440
|
* Common definitions between clients for different environments interface.
|
|
464
|
-
* @
|
|
465
|
-
* @extends IStatusInterface
|
|
441
|
+
* @typedef IBasicClient
|
|
466
442
|
*/
|
|
467
|
-
|
|
443
|
+
type IBasicClient<TEventEmitter extends SplitIO.IEventEmitter = SplitIO.EventEmitter> = IStatusInterface<TEventEmitter> & {
|
|
468
444
|
/**
|
|
469
445
|
* Destroys the client instance.
|
|
470
446
|
* In 'standalone' mode, this method will flush any pending impressions and events, and stop the synchronization of feature flag definitions with the backend.
|
|
@@ -503,6 +479,42 @@ interface IBasicSDK {
|
|
|
503
479
|
* For the SDK package information see {@link https://www.npmjs.com/package/@splitsoftware/splitio}
|
|
504
480
|
*/
|
|
505
481
|
declare namespace SplitIO {
|
|
482
|
+
/**
|
|
483
|
+
* EventEmitter interface based on a subset of the NodeJS.EventEmitter methods. Used by the JavaScript Browser SDK and React Native SDK.
|
|
484
|
+
*/
|
|
485
|
+
interface IEventEmitter {
|
|
486
|
+
addListener(event: string, listener: (...args: any[]) => void): this
|
|
487
|
+
on(event: string, listener: (...args: any[]) => void): this
|
|
488
|
+
once(event: string, listener: (...args: any[]) => void): this
|
|
489
|
+
removeListener(event: string, listener: (...args: any[]) => void): this
|
|
490
|
+
off(event: string, listener: (...args: any[]) => void): this
|
|
491
|
+
removeAllListeners(event?: string): this
|
|
492
|
+
emit(event: string, ...args: any[]): boolean
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* NodeJS.EventEmitter interface. Used by the JavaScript SDK for both flavours: server-side (NodeJS) and client-side (Browser).
|
|
497
|
+
*
|
|
498
|
+
* @see {@link https://nodejs.org/api/events.html}
|
|
499
|
+
*/
|
|
500
|
+
interface EventEmitter extends IEventEmitter {
|
|
501
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
502
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
503
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
504
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
505
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
506
|
+
removeAllListeners(event?: string | symbol): this;
|
|
507
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
508
|
+
setMaxListeners(n: number): this;
|
|
509
|
+
getMaxListeners(): number;
|
|
510
|
+
listeners(event: string | symbol): Function[];
|
|
511
|
+
rawListeners(event: string | symbol): Function[];
|
|
512
|
+
listenerCount(type: string | symbol): number;
|
|
513
|
+
// Added in Node 6...
|
|
514
|
+
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
515
|
+
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
516
|
+
eventNames(): Array<string | symbol>;
|
|
517
|
+
}
|
|
506
518
|
/**
|
|
507
519
|
* Feature flag treatment value, returned by getTreatment.
|
|
508
520
|
* @typedef {string} Treatment
|
|
@@ -1237,30 +1249,30 @@ declare namespace SplitIO {
|
|
|
1237
1249
|
getState(keys?: SplitKey[]): PreloadedData,
|
|
1238
1250
|
}
|
|
1239
1251
|
/**
|
|
1240
|
-
* This represents the interface for the SDK instance with synchronous storage.
|
|
1252
|
+
* This represents the interface for the SDK instance with synchronous storage and client-side API.
|
|
1241
1253
|
* @interface IBrowserSDK
|
|
1242
1254
|
* @extends IBasicSDK
|
|
1243
1255
|
*/
|
|
1244
|
-
interface IBrowserSDK extends IBasicSDK {
|
|
1256
|
+
interface IBrowserSDK<TEventEmitter extends IEventEmitter = EventEmitter> extends IBasicSDK {
|
|
1245
1257
|
/**
|
|
1246
1258
|
* Returns the default client instance of the SDK.
|
|
1247
1259
|
* @function client
|
|
1248
1260
|
* @returns {IBrowserClient} The client instance.
|
|
1249
1261
|
*/
|
|
1250
|
-
client(): IBrowserClient
|
|
1262
|
+
client(): IBrowserClient<TEventEmitter>,
|
|
1251
1263
|
/**
|
|
1252
1264
|
* Returns a shared client of the SDK.
|
|
1253
1265
|
* @function client
|
|
1254
1266
|
* @param {SplitKey} key The key for the new client instance.
|
|
1255
1267
|
* @returns {IBrowserClient} The client instance.
|
|
1256
1268
|
*/
|
|
1257
|
-
client(key: SplitKey): IBrowserClient
|
|
1269
|
+
client(key: SplitKey): IBrowserClient<TEventEmitter>
|
|
1258
1270
|
/**
|
|
1259
1271
|
* Returns a manager instance of the SDK to explore available information.
|
|
1260
1272
|
* @function manager
|
|
1261
1273
|
* @returns {IManager} The manager instance.
|
|
1262
1274
|
*/
|
|
1263
|
-
manager(): IManager
|
|
1275
|
+
manager(): IManager<TEventEmitter>,
|
|
1264
1276
|
/**
|
|
1265
1277
|
* User consent API.
|
|
1266
1278
|
* @property UserConsent
|
|
@@ -1392,10 +1404,9 @@ declare namespace SplitIO {
|
|
|
1392
1404
|
* This represents the interface for the Client instance on client-side, where the user key is bound to the instance on creation and does not need to be provided on each method call.
|
|
1393
1405
|
* This interface is the default when importing the SDK in the Browser, or when importing the 'client' sub-package (e.g., `import { SplitFactory } from '@splitsoftware/splitio/client'`).
|
|
1394
1406
|
*
|
|
1395
|
-
* @
|
|
1396
|
-
* @extends IBasicClient
|
|
1407
|
+
* @typedef IBrowserClient
|
|
1397
1408
|
*/
|
|
1398
|
-
|
|
1409
|
+
type IBrowserClient<TEventEmitter extends IEventEmitter = EventEmitter> = IBasicClient<TEventEmitter> & {
|
|
1399
1410
|
/**
|
|
1400
1411
|
* Returns a Treatment value, which is the treatment string for the given feature.
|
|
1401
1412
|
*
|
|
@@ -1626,10 +1637,9 @@ declare namespace SplitIO {
|
|
|
1626
1637
|
}
|
|
1627
1638
|
/**
|
|
1628
1639
|
* Representation of a manager instance with synchronous storage of the SDK.
|
|
1629
|
-
* @
|
|
1630
|
-
* @extends IStatusInterface
|
|
1640
|
+
* @typedef IManager
|
|
1631
1641
|
*/
|
|
1632
|
-
|
|
1642
|
+
type IManager<TEventEmitter extends IEventEmitter = EventEmitter> = IStatusInterface<TEventEmitter> & {
|
|
1633
1643
|
/**
|
|
1634
1644
|
* Get the array of feature flag names.
|
|
1635
1645
|
* @function names
|