|
2 | 2 | // Project: http://www.split.io/ |
3 | 3 | // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/> |
4 | 4 |
|
5 | | -/// <reference types="node" /> |
6 | 5 | /// <reference types="google.analytics" /> |
7 | 6 |
|
8 | 7 | export as namespace SplitIO; |
9 | 8 | export = SplitIO; |
10 | 9 |
|
| 10 | +/** |
| 11 | + * NodeJS.EventEmitter interface |
| 12 | + * @see {@link https://nodejs.org/api/events.html} |
| 13 | + */ |
| 14 | +interface EventEmitter { |
| 15 | + addListener(event: string | symbol, listener: (...args: any[]) => void): this; |
| 16 | + on(event: string | symbol, listener: (...args: any[]) => void): this; |
| 17 | + once(event: string | symbol, listener: (...args: any[]) => void): this; |
| 18 | + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; |
| 19 | + off(event: string | symbol, listener: (...args: any[]) => void): this; |
| 20 | + removeAllListeners(event?: string | symbol): this; |
| 21 | + setMaxListeners(n: number): this; |
| 22 | + getMaxListeners(): number; |
| 23 | + listeners(event: string | symbol): Function[]; |
| 24 | + rawListeners(event: string | symbol): Function[]; |
| 25 | + emit(event: string | symbol, ...args: any[]): boolean; |
| 26 | + listenerCount(type: string | symbol): number; |
| 27 | + // Added in Node 6... |
| 28 | + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; |
| 29 | + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; |
| 30 | + eventNames(): Array<string | symbol>; |
| 31 | +} |
11 | 32 | /** |
12 | 33 | * @typedef {Object} EventConsts |
13 | 34 | * @property {string} SDK_READY The ready event. |
@@ -338,9 +359,9 @@ interface INodeBasicSettings extends ISharedSettings { |
338 | 359 | /** |
339 | 360 | * Common API for entities that expose status handlers. |
340 | 361 | * @interface IStatusInterface |
341 | | - * @extends NodeJS.EventEmitter |
| 362 | + * @extends EventEmitter |
342 | 363 | */ |
343 | | -interface IStatusInterface extends NodeJS.EventEmitter { |
| 364 | +interface IStatusInterface extends EventEmitter { |
344 | 365 | /** |
345 | 366 | * Constant object containing the SDK events for you to use. |
346 | 367 | * @property {EventConsts} Event |
@@ -744,13 +765,13 @@ declare namespace SplitIO { |
744 | 765 | */ |
745 | 766 | type UrlSettings = { |
746 | 767 | /** |
747 | | - * String property to override the base URL where the SDK will get feature flagging related data like a Split rollout plan or segments information. |
| 768 | + * String property to override the base URL where the SDK will get feature flagging related data like a Split rollout plan or segments information. |
748 | 769 | * @property {string} sdk |
749 | 770 | * @default 'https://sdk.split.io/api' |
750 | 771 | */ |
751 | 772 | sdk?: string, |
752 | 773 | /** |
753 | | - * String property to override the base URL where the SDK will post event-related information like impressions. |
| 774 | + * String property to override the base URL where the SDK will post event-related information like impressions. |
754 | 775 | * @property {string} events |
755 | 776 | * @default 'https://events.split.io/api' |
756 | 777 | */ |
|
0 commit comments