@rudderstack/analytics-js 3.6.1 → 3.7.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [3.7.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.6.1...@rudderstack/analytics-js@3.7.0) (2024-07-19)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@rudderstack/analytics-js-cookies` updated to version `3.6.1`
10
+ * `@rudderstack/analytics-js-common` updated to version `3.6.1`
11
+ * `@rudderstack/analytics-js-plugins` updated to version `3.6.1`
12
+
13
+ ### Features
14
+
15
+ * error reporting plugin ([#1601](https://github.com/rudderlabs/rudder-sdk-js/issues/1601)) ([1f2629e](https://github.com/rudderlabs/rudder-sdk-js/commit/1f2629e594740763ce9bd54a21213b92d80ae085))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * event API overloads ([#1782](https://github.com/rudderlabs/rudder-sdk-js/issues/1782)) ([02c5b47](https://github.com/rudderlabs/rudder-sdk-js/commit/02c5b47d0a83250fb5180e9ed467a92361663dab))
21
+
5
22
  ## [3.6.1](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.6.0...@rudderstack/analytics-js@3.6.1) (2024-07-05)
6
23
 
7
24
  ### Dependency Updates
@@ -44,7 +44,7 @@ type Nullable<T> = T | null;
44
44
  * Use for parameters like properties, traits etc.
45
45
  */
46
46
  type ApiObject = {
47
- [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | ApiObject)[] | undefined;
47
+ [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
48
48
  };
49
49
 
50
50
  type DestinationIntgConfig = boolean | undefined | ApiObject;
@@ -79,7 +79,7 @@ type APIEvent = {
79
79
  callback?: () => void;
80
80
  userId?: Nullable<string>;
81
81
  traits?: Nullable<ApiObject>;
82
- to?: Nullable<string>;
82
+ to?: string;
83
83
  from?: string;
84
84
  groupId?: Nullable<string>;
85
85
  };
@@ -338,7 +338,6 @@ type IdentifyTraits = {
338
338
  prospect?: string | boolean;
339
339
  doubleOptin?: string | boolean;
340
340
  event_id?: string;
341
- constructor?: Record<string, string>;
342
341
  organization?: string;
343
342
  region?: string;
344
343
  anonymous?: string | boolean;
@@ -354,45 +353,44 @@ type IdentifyTraits = {
354
353
  anonymousId?: string | number;
355
354
  ip_address?: string;
356
355
  number?: string | number;
357
- [index: string]: string | number | boolean | ApiObject | null | (string | number | boolean | null | ApiObject)[] | undefined;
356
+ [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
358
357
  };
359
358
 
360
359
  type AnalyticsIdentifyMethod = {
361
- (userId?: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
362
- (userId: string, traits: Nullable<IdentifyTraits>, callback: ApiCallback): void;
363
- (userId: string, callback: ApiCallback): void;
364
- (traits: Nullable<IdentifyTraits>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
360
+ (userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
361
+ (userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
362
+ (userId: string, callback?: ApiCallback): void;
363
+ (traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
365
364
  (traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
366
365
  };
367
366
  type AnalyticsPageMethod = {
368
- (category?: string, name?: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
369
- (category: string, name: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
367
+ (category: string, name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
368
+ (category: string, name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
369
+ (category: string, name: string, callback?: ApiCallback): void;
370
370
  (name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
371
- (category: string, name: string, callback: ApiCallback): void;
372
- (name: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
373
- (name: string, callback: ApiCallback): void;
374
- (properties: Nullable<ApiObject>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
371
+ (name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
372
+ (name: string, callback?: ApiCallback): void;
373
+ (properties: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
375
374
  (properties: Nullable<ApiObject>, callback?: ApiCallback): void;
375
+ (callback?: ApiCallback): void;
376
376
  };
377
377
  type AnalyticsTrackMethod = {
378
378
  (event: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
379
- (event: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
380
- (event: string, callback: ApiCallback): void;
379
+ (event: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
380
+ (event: string, callback?: ApiCallback): void;
381
381
  };
382
382
  type AnalyticsGroupMethod = {
383
- (groupId: string | number, traits?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
384
- (groupId: string | number, traits: Nullable<ApiObject>, callback: ApiCallback): void;
385
- (groupId: string | number, callback: ApiCallback): void;
386
- (traits: Nullable<ApiObject>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
387
- (traits: Nullable<ApiObject>, callback?: ApiCallback): void;
383
+ (groupId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
384
+ (groupId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
385
+ (groupId: string, callback?: ApiCallback): void;
386
+ (traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
387
+ (traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
388
388
  };
389
389
  type AnalyticsAliasMethod = {
390
- (to: Nullable<string>, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
391
- (to: Nullable<string>, from: string, callback: ApiCallback): void;
392
- (to: Nullable<string>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
393
- (to: Nullable<string>, callback: ApiCallback): void;
394
- (to: ApiCallback): void;
395
- (): void;
390
+ (to: string, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
391
+ (to: string, from?: string, callback?: ApiCallback): void;
392
+ (to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
393
+ (to: string, callback?: ApiCallback): void;
396
394
  };
397
395
  interface IRudderAnalytics<T = any> {
398
396
  analyticsInstances: Record<string, T>;
@@ -497,6 +495,20 @@ interface IRudderAnalytics<T = any> {
497
495
  consent(options?: ConsentOptions): void;
498
496
  }
499
497
 
498
+ /**
499
+ * A buffer queue to serve as a store for any type of data
500
+ */
501
+ declare class BufferQueue<T = any> {
502
+ items: T[];
503
+ constructor();
504
+ enqueue(item: T): void;
505
+ dequeue(): Nullable<T> | undefined;
506
+ isEmpty(): boolean;
507
+ size(): number;
508
+ clear(): void;
509
+ }
510
+ //# sourceMappingURL=BufferQueue.d.ts.map
511
+
500
512
  interface IExternalSourceLoadConfig {
501
513
  url: string;
502
514
  id: string;
@@ -509,36 +521,22 @@ interface IExternalSrcLoader {
509
521
  errorHandler?: {
510
522
  onError(error: unknown, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean): void;
511
523
  leaveBreadcrumb(breadcrumb: string): void;
512
- notifyError(error: Error): void;
524
+ notifyError(error: Error, errorState: ErrorState): void;
513
525
  };
514
526
  logger?: ILogger;
515
527
  timeout: number;
516
528
  loadJSFile(config: IExternalSourceLoadConfig): void;
517
529
  }
518
530
 
519
- /**
520
- * A buffer queue to serve as a store for any type of data
521
- */
522
- declare class BufferQueue<T = any> {
523
- items: T[];
524
- constructor();
525
- enqueue(item: T): void;
526
- dequeue(): Nullable<T> | undefined;
527
- isEmpty(): boolean;
528
- size(): number;
529
- clear(): void;
530
- }
531
- //# sourceMappingURL=BufferQueue.d.ts.map
532
-
533
531
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
534
532
  interface IErrorHandler {
535
533
  logger?: ILogger;
536
534
  pluginEngine?: IPluginEngine;
537
535
  errorBuffer: BufferQueue<PreLoadErrorData>;
538
- init(externalSrcLoader: IExternalSrcLoader): void;
536
+ init(httpClient: IHttpClient, externalSrcLoader: IExternalSrcLoader): void;
539
537
  onError(error: SDKError, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean, errorType?: string): void;
540
538
  leaveBreadcrumb(breadcrumb: string): void;
541
- notifyError(error: Error): void;
539
+ notifyError(error: Error, errorState: ErrorState): void;
542
540
  attachErrorListeners(): void;
543
541
  }
544
542
  type ErrorState = {
@@ -670,14 +668,14 @@ type TrackCallOptions = {
670
668
  callback?: ApiCallback;
671
669
  };
672
670
  type IdentifyCallOptions = {
673
- userId?: string | null;
671
+ userId?: Nullable<string>;
674
672
  traits?: Nullable<IdentifyTraits>;
675
673
  options?: Nullable<ApiOptions>;
676
674
  callback?: ApiCallback;
677
675
  };
678
676
  type AliasCallOptions = {
679
- to?: Nullable<string>;
680
- from?: Nullable<string>;
677
+ to: string;
678
+ from?: string;
681
679
  options?: Nullable<ApiOptions>;
682
680
  callback?: ApiCallback;
683
681
  };
@@ -982,23 +980,44 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
982
980
  /**
983
981
  * Process page arguments and forward to page call
984
982
  */
985
- page(category?: string | Nullable<ApiObject> | ApiCallback, name?: string | Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, properties?: Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
983
+ page(category: string, name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
984
+ page(category: string, name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
985
+ page(category: string, name: string, callback?: ApiCallback): void;
986
+ page(name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
987
+ page(name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
988
+ page(name: string, callback?: ApiCallback): void;
989
+ page(properties: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
990
+ page(properties: Nullable<ApiObject>, callback?: ApiCallback): void;
991
+ page(callback?: ApiCallback): void;
986
992
  /**
987
993
  * Process track arguments and forward to page call
988
994
  */
989
- track(event: string, properties?: Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
995
+ track(event: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
996
+ track(event: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
997
+ track(event: string, callback?: ApiCallback): void;
990
998
  /**
991
999
  * Process identify arguments and forward to page call
992
1000
  */
993
- identify(userId?: string | number | Nullable<IdentifyTraits>, traits?: Nullable<IdentifyTraits> | Nullable<ApiOptions> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1001
+ identify(userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1002
+ identify(userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1003
+ identify(userId: string, callback?: ApiCallback): void;
1004
+ identify(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1005
+ identify(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
994
1006
  /**
995
1007
  * Process alias arguments and forward to page call
996
1008
  */
997
- alias(to?: Nullable<string> | ApiCallback, from?: string | Nullable<ApiOptions> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1009
+ alias(to: string, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1010
+ alias(to: string, from?: string, callback?: ApiCallback): void;
1011
+ alias(to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1012
+ alias(to: string, callback?: ApiCallback): void;
998
1013
  /**
999
1014
  * Process group arguments and forward to page call
1000
1015
  */
1001
- group(groupId: string | number | Nullable<ApiObject> | ApiCallback, traits?: Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1016
+ group(groupId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1017
+ group(groupId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1018
+ group(groupId: string, callback?: ApiCallback): void;
1019
+ group(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1020
+ group(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1002
1021
  reset(resetAnonymousId?: boolean): void;
1003
1022
  getAnonymousId(options?: AnonymousIdOptions): string | undefined;
1004
1023
  setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string): void;
@@ -44,7 +44,7 @@ type Nullable<T> = T | null;
44
44
  * Use for parameters like properties, traits etc.
45
45
  */
46
46
  type ApiObject = {
47
- [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | ApiObject)[] | undefined;
47
+ [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
48
48
  };
49
49
 
50
50
  type DestinationIntgConfig = boolean | undefined | ApiObject;
@@ -79,7 +79,7 @@ type APIEvent = {
79
79
  callback?: () => void;
80
80
  userId?: Nullable<string>;
81
81
  traits?: Nullable<ApiObject>;
82
- to?: Nullable<string>;
82
+ to?: string;
83
83
  from?: string;
84
84
  groupId?: Nullable<string>;
85
85
  };
@@ -338,7 +338,6 @@ type IdentifyTraits = {
338
338
  prospect?: string | boolean;
339
339
  doubleOptin?: string | boolean;
340
340
  event_id?: string;
341
- constructor?: Record<string, string>;
342
341
  organization?: string;
343
342
  region?: string;
344
343
  anonymous?: string | boolean;
@@ -354,45 +353,44 @@ type IdentifyTraits = {
354
353
  anonymousId?: string | number;
355
354
  ip_address?: string;
356
355
  number?: string | number;
357
- [index: string]: string | number | boolean | ApiObject | null | (string | number | boolean | null | ApiObject)[] | undefined;
356
+ [index: string]: string | number | boolean | ApiObject | null | Date | (string | number | boolean | null | Date | ApiObject)[] | undefined;
358
357
  };
359
358
 
360
359
  type AnalyticsIdentifyMethod = {
361
- (userId?: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
362
- (userId: string, traits: Nullable<IdentifyTraits>, callback: ApiCallback): void;
363
- (userId: string, callback: ApiCallback): void;
364
- (traits: Nullable<IdentifyTraits>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
360
+ (userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
361
+ (userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
362
+ (userId: string, callback?: ApiCallback): void;
363
+ (traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
365
364
  (traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
366
365
  };
367
366
  type AnalyticsPageMethod = {
368
- (category?: string, name?: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
369
- (category: string, name: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
367
+ (category: string, name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
368
+ (category: string, name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
369
+ (category: string, name: string, callback?: ApiCallback): void;
370
370
  (name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
371
- (category: string, name: string, callback: ApiCallback): void;
372
- (name: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
373
- (name: string, callback: ApiCallback): void;
374
- (properties: Nullable<ApiObject>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
371
+ (name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
372
+ (name: string, callback?: ApiCallback): void;
373
+ (properties: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
375
374
  (properties: Nullable<ApiObject>, callback?: ApiCallback): void;
375
+ (callback?: ApiCallback): void;
376
376
  };
377
377
  type AnalyticsTrackMethod = {
378
378
  (event: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
379
- (event: string, properties: Nullable<ApiObject>, callback: ApiCallback): void;
380
- (event: string, callback: ApiCallback): void;
379
+ (event: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
380
+ (event: string, callback?: ApiCallback): void;
381
381
  };
382
382
  type AnalyticsGroupMethod = {
383
- (groupId: string | number, traits?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
384
- (groupId: string | number, traits: Nullable<ApiObject>, callback: ApiCallback): void;
385
- (groupId: string | number, callback: ApiCallback): void;
386
- (traits: Nullable<ApiObject>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
387
- (traits: Nullable<ApiObject>, callback?: ApiCallback): void;
383
+ (groupId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
384
+ (groupId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
385
+ (groupId: string, callback?: ApiCallback): void;
386
+ (traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
387
+ (traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
388
388
  };
389
389
  type AnalyticsAliasMethod = {
390
- (to: Nullable<string>, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
391
- (to: Nullable<string>, from: string, callback: ApiCallback): void;
392
- (to: Nullable<string>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
393
- (to: Nullable<string>, callback: ApiCallback): void;
394
- (to: ApiCallback): void;
395
- (): void;
390
+ (to: string, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
391
+ (to: string, from?: string, callback?: ApiCallback): void;
392
+ (to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
393
+ (to: string, callback?: ApiCallback): void;
396
394
  };
397
395
  interface IRudderAnalytics<T = any> {
398
396
  analyticsInstances: Record<string, T>;
@@ -497,6 +495,20 @@ interface IRudderAnalytics<T = any> {
497
495
  consent(options?: ConsentOptions): void;
498
496
  }
499
497
 
498
+ /**
499
+ * A buffer queue to serve as a store for any type of data
500
+ */
501
+ declare class BufferQueue<T = any> {
502
+ items: T[];
503
+ constructor();
504
+ enqueue(item: T): void;
505
+ dequeue(): Nullable<T> | undefined;
506
+ isEmpty(): boolean;
507
+ size(): number;
508
+ clear(): void;
509
+ }
510
+ //# sourceMappingURL=BufferQueue.d.ts.map
511
+
500
512
  interface IExternalSourceLoadConfig {
501
513
  url: string;
502
514
  id: string;
@@ -509,36 +521,22 @@ interface IExternalSrcLoader {
509
521
  errorHandler?: {
510
522
  onError(error: unknown, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean): void;
511
523
  leaveBreadcrumb(breadcrumb: string): void;
512
- notifyError(error: Error): void;
524
+ notifyError(error: Error, errorState: ErrorState): void;
513
525
  };
514
526
  logger?: ILogger;
515
527
  timeout: number;
516
528
  loadJSFile(config: IExternalSourceLoadConfig): void;
517
529
  }
518
530
 
519
- /**
520
- * A buffer queue to serve as a store for any type of data
521
- */
522
- declare class BufferQueue<T = any> {
523
- items: T[];
524
- constructor();
525
- enqueue(item: T): void;
526
- dequeue(): Nullable<T> | undefined;
527
- isEmpty(): boolean;
528
- size(): number;
529
- clear(): void;
530
- }
531
- //# sourceMappingURL=BufferQueue.d.ts.map
532
-
533
531
  type SDKError = unknown | Error | ErrorEvent | Event | PromiseRejectionEvent;
534
532
  interface IErrorHandler {
535
533
  logger?: ILogger;
536
534
  pluginEngine?: IPluginEngine;
537
535
  errorBuffer: BufferQueue<PreLoadErrorData>;
538
- init(externalSrcLoader: IExternalSrcLoader): void;
536
+ init(httpClient: IHttpClient, externalSrcLoader: IExternalSrcLoader): void;
539
537
  onError(error: SDKError, context?: string, customMessage?: string, shouldAlwaysThrow?: boolean, errorType?: string): void;
540
538
  leaveBreadcrumb(breadcrumb: string): void;
541
- notifyError(error: Error): void;
539
+ notifyError(error: Error, errorState: ErrorState): void;
542
540
  attachErrorListeners(): void;
543
541
  }
544
542
  type ErrorState = {
@@ -670,14 +668,14 @@ type TrackCallOptions = {
670
668
  callback?: ApiCallback;
671
669
  };
672
670
  type IdentifyCallOptions = {
673
- userId?: string | null;
671
+ userId?: Nullable<string>;
674
672
  traits?: Nullable<IdentifyTraits>;
675
673
  options?: Nullable<ApiOptions>;
676
674
  callback?: ApiCallback;
677
675
  };
678
676
  type AliasCallOptions = {
679
- to?: Nullable<string>;
680
- from?: Nullable<string>;
677
+ to: string;
678
+ from?: string;
681
679
  options?: Nullable<ApiOptions>;
682
680
  callback?: ApiCallback;
683
681
  };
@@ -982,23 +980,44 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
982
980
  /**
983
981
  * Process page arguments and forward to page call
984
982
  */
985
- page(category?: string | Nullable<ApiObject> | ApiCallback, name?: string | Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, properties?: Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
983
+ page(category: string, name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
984
+ page(category: string, name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
985
+ page(category: string, name: string, callback?: ApiCallback): void;
986
+ page(name: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
987
+ page(name: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
988
+ page(name: string, callback?: ApiCallback): void;
989
+ page(properties: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
990
+ page(properties: Nullable<ApiObject>, callback?: ApiCallback): void;
991
+ page(callback?: ApiCallback): void;
986
992
  /**
987
993
  * Process track arguments and forward to page call
988
994
  */
989
- track(event: string, properties?: Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
995
+ track(event: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
996
+ track(event: string, properties?: Nullable<ApiObject>, callback?: ApiCallback): void;
997
+ track(event: string, callback?: ApiCallback): void;
990
998
  /**
991
999
  * Process identify arguments and forward to page call
992
1000
  */
993
- identify(userId?: string | number | Nullable<IdentifyTraits>, traits?: Nullable<IdentifyTraits> | Nullable<ApiOptions> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1001
+ identify(userId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1002
+ identify(userId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1003
+ identify(userId: string, callback?: ApiCallback): void;
1004
+ identify(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1005
+ identify(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
994
1006
  /**
995
1007
  * Process alias arguments and forward to page call
996
1008
  */
997
- alias(to?: Nullable<string> | ApiCallback, from?: string | Nullable<ApiOptions> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1009
+ alias(to: string, from?: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1010
+ alias(to: string, from?: string, callback?: ApiCallback): void;
1011
+ alias(to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1012
+ alias(to: string, callback?: ApiCallback): void;
998
1013
  /**
999
1014
  * Process group arguments and forward to page call
1000
1015
  */
1001
- group(groupId: string | number | Nullable<ApiObject> | ApiCallback, traits?: Nullable<ApiOptions> | Nullable<ApiObject> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
1016
+ group(groupId: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1017
+ group(groupId: string, traits?: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1018
+ group(groupId: string, callback?: ApiCallback): void;
1019
+ group(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
1020
+ group(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
1002
1021
  reset(resetAnonymousId?: boolean): void;
1003
1022
  getAnonymousId(options?: AnonymousIdOptions): string | undefined;
1004
1023
  setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string): void;