@amplitude/analytics-types 2.8.0 → 2.8.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.
@@ -11,9 +11,13 @@ export type ActionType = 'click' | 'change';
11
11
  */
12
12
  export declare const DEFAULT_CSS_SELECTOR_ALLOWLIST: string[];
13
13
  /**
14
- * Default prefix to allo the plugin to capture data attributes as an event property.
14
+ * Default prefix to allow the plugin to capture data attributes as an event property.
15
15
  */
16
16
  export declare const DEFAULT_DATA_ATTRIBUTE_PREFIX = "data-amp-track-";
17
+ /**
18
+ * Default list of elements on the page should be tracked when the page changes.
19
+ */
20
+ export declare const DEFAULT_ACTION_CLICK_ALLOWLIST: string[];
17
21
  export interface ElementInteractionsOptions {
18
22
  /**
19
23
  * List of CSS selectors to allow auto tracking on.
@@ -35,7 +39,7 @@ export interface ElementInteractionsOptions {
35
39
  * @param actionType - The type of action that triggered the event.
36
40
  * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.
37
41
  */
38
- shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;
42
+ shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;
39
43
  /**
40
44
  * Prefix for data attributes to allow auto collecting.
41
45
  * Default is 'data-amp-track-'.
@@ -48,14 +52,22 @@ export interface ElementInteractionsOptions {
48
52
  enabled?: boolean;
49
53
  messenger?: Messenger;
50
54
  };
55
+ /**
56
+ * Debounce time in milliseconds for tracking events.
57
+ * This is used to detect rage clicks.
58
+ */
59
+ debounceTime?: number;
60
+ /**
61
+ * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist
62
+ */
63
+ actionClickAllowlist?: string[];
51
64
  }
52
65
  export interface Messenger {
53
66
  logger?: Logger;
54
67
  setup: () => void;
55
68
  }
56
- interface Element {
57
- id: string;
58
- className: string;
59
- }
69
+ type DomElement = typeof globalThis extends {
70
+ Element: infer T extends abstract new (...args: any) => any;
71
+ } ? InstanceType<T> : never;
60
72
  export {};
61
73
  //# sourceMappingURL=element-interactions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAS1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAEjF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAY1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,8BAA8B,UAAsD,CAAC;AAElG,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC;IAEpF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAKD,KAAK,UAAU,GAAG,OAAO,UAAU,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,GACvG,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = void 0;
2
+ exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = void 0;
3
3
  /**
4
4
  * Default CSS selectors to define which elements on the page to track.
5
5
  * Extend this list to include additional elements to track. For example:
@@ -16,11 +16,18 @@ exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = [
16
16
  'select',
17
17
  'textarea',
18
18
  'label',
19
+ 'video',
20
+ 'audio',
21
+ '[contenteditable="true" i]',
19
22
  '[data-amp-default-track]',
20
23
  '.amp-default-track',
21
24
  ];
22
25
  /**
23
- * Default prefix to allo the plugin to capture data attributes as an event property.
26
+ * Default prefix to allow the plugin to capture data attributes as an event property.
24
27
  */
25
28
  exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';
29
+ /**
30
+ * Default list of elements on the page should be tracked when the page changes.
31
+ */
32
+ exports.DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
26
33
  //# sourceMappingURL=element-interactions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":";;AAIA;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allo the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\ninterface Element {\n id: string;\n className: string;\n}\n"]}
1
+ {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":";;AAIA;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,4BAA4B;IAC5B,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAE/D;;GAEG;AACU,QAAA,8BAA8B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'video',\n 'audio',\n '[contenteditable=\"true\" i]',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allow the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\n/**\n * Default list of elements on the page should be tracked when the page changes.\n */\nexport const DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n\n /**\n * Debounce time in milliseconds for tracking events.\n * This is used to detect rage clicks.\n */\n debounceTime?: number;\n\n /**\n * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist\n */\n actionClickAllowlist?: string[];\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\n// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json\n// and never if it is not included\n// eslint-disable-next-line no-restricted-globals\ntype DomElement = typeof globalThis extends { Element: infer T extends abstract new (...args: any) => any }\n ? InstanceType<T>\n : never;\n"]}
@@ -24,5 +24,5 @@ export { UserSession } from './user-session';
24
24
  export { UTMData } from './utm';
25
25
  export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
26
26
  export { OfflineDisabled } from './offline';
27
- export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
27
+ export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, DEFAULT_ACTION_CLICK_ALLOWLIST, } from './element-interactions';
28
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,E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AAC/E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,0BAA0B,EAC1B,UAAU,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC"}
package/lib/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = exports.OfflineDisabled = exports.Status = exports.ServerZone = exports.LogLevel = exports.RevenueProperty = exports.IdentifyOperation = exports.SpecialEventType = void 0;
2
+ exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = exports.OfflineDisabled = exports.Status = exports.ServerZone = exports.LogLevel = exports.RevenueProperty = exports.IdentifyOperation = exports.SpecialEventType = void 0;
3
3
  var event_1 = require("./event");
4
4
  Object.defineProperty(exports, "SpecialEventType", { enumerable: true, get: function () { return event_1.SpecialEventType; } });
5
5
  Object.defineProperty(exports, "IdentifyOperation", { enumerable: true, get: function () { return event_1.IdentifyOperation; } });
@@ -15,4 +15,5 @@ Object.defineProperty(exports, "OfflineDisabled", { enumerable: true, get: funct
15
15
  var element_interactions_1 = require("./element-interactions");
16
16
  Object.defineProperty(exports, "DEFAULT_CSS_SELECTOR_ALLOWLIST", { enumerable: true, get: function () { return element_interactions_1.DEFAULT_CSS_SELECTOR_ALLOWLIST; } });
17
17
  Object.defineProperty(exports, "DEFAULT_DATA_ATTRIBUTE_PREFIX", { enumerable: true, get: function () { return element_interactions_1.DEFAULT_DATA_ATTRIBUTE_PREFIX; } });
18
+ Object.defineProperty(exports, "DEFAULT_ACTION_CLICK_ALLOWLIST", { enumerable: true, get: function () { return element_interactions_1.DEFAULT_ACTION_CLICK_ALLOWLIST; } });
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAkCA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,+DAMgC;AAF9B,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n} from './element-interactions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAkCA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,+DAOgC;AAH9B,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA;AAC7B,sIAAA,8BAA8B,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n} from './element-interactions';\n"]}
@@ -11,9 +11,13 @@ export type ActionType = 'click' | 'change';
11
11
  */
12
12
  export declare const DEFAULT_CSS_SELECTOR_ALLOWLIST: string[];
13
13
  /**
14
- * Default prefix to allo the plugin to capture data attributes as an event property.
14
+ * Default prefix to allow the plugin to capture data attributes as an event property.
15
15
  */
16
16
  export declare const DEFAULT_DATA_ATTRIBUTE_PREFIX = "data-amp-track-";
17
+ /**
18
+ * Default list of elements on the page should be tracked when the page changes.
19
+ */
20
+ export declare const DEFAULT_ACTION_CLICK_ALLOWLIST: string[];
17
21
  export interface ElementInteractionsOptions {
18
22
  /**
19
23
  * List of CSS selectors to allow auto tracking on.
@@ -35,7 +39,7 @@ export interface ElementInteractionsOptions {
35
39
  * @param actionType - The type of action that triggered the event.
36
40
  * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.
37
41
  */
38
- shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;
42
+ shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;
39
43
  /**
40
44
  * Prefix for data attributes to allow auto collecting.
41
45
  * Default is 'data-amp-track-'.
@@ -48,14 +52,22 @@ export interface ElementInteractionsOptions {
48
52
  enabled?: boolean;
49
53
  messenger?: Messenger;
50
54
  };
55
+ /**
56
+ * Debounce time in milliseconds for tracking events.
57
+ * This is used to detect rage clicks.
58
+ */
59
+ debounceTime?: number;
60
+ /**
61
+ * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist
62
+ */
63
+ actionClickAllowlist?: string[];
51
64
  }
52
65
  export interface Messenger {
53
66
  logger?: Logger;
54
67
  setup: () => void;
55
68
  }
56
- interface Element {
57
- id: string;
58
- className: string;
59
- }
69
+ type DomElement = typeof globalThis extends {
70
+ Element: infer T extends abstract new (...args: any) => any;
71
+ } ? InstanceType<T> : never;
60
72
  export {};
61
73
  //# sourceMappingURL=element-interactions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAS1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAEjF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"element-interactions.d.ts","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,UAY1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,oBAAoB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,8BAA8B,UAAsD,CAAC;AAElG,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEvC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC;IAEpF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAKD,KAAK,UAAU,GAAG,OAAO,UAAU,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,GACvG,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC"}
@@ -14,11 +14,18 @@ export var DEFAULT_CSS_SELECTOR_ALLOWLIST = [
14
14
  'select',
15
15
  'textarea',
16
16
  'label',
17
+ 'video',
18
+ 'audio',
19
+ '[contenteditable="true" i]',
17
20
  '[data-amp-default-track]',
18
21
  '.amp-default-track',
19
22
  ];
20
23
  /**
21
- * Default prefix to allo the plugin to capture data attributes as an event property.
24
+ * Default prefix to allow the plugin to capture data attributes as an event property.
22
25
  */
23
26
  export var DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';
27
+ /**
28
+ * Default list of elements on the page should be tracked when the page changes.
29
+ */
30
+ export var DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
24
31
  //# sourceMappingURL=element-interactions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allo the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: Element) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\ninterface Element {\n id: string;\n className: string;\n}\n"]}
1
+ {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,4BAA4B;IAC5B,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,6BAA6B,GAAG,iBAAiB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,IAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'video',\n 'audio',\n '[contenteditable=\"true\" i]',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allow the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\n/**\n * Default list of elements on the page should be tracked when the page changes.\n */\nexport const DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n\n /**\n * Debounce time in milliseconds for tracking events.\n * This is used to detect rage clicks.\n */\n debounceTime?: number;\n\n /**\n * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist\n */\n actionClickAllowlist?: string[];\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\n// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json\n// and never if it is not included\n// eslint-disable-next-line no-restricted-globals\ntype DomElement = typeof globalThis extends { Element: infer T extends abstract new (...args: any) => any }\n ? InstanceType<T>\n : never;\n"]}
@@ -24,5 +24,5 @@ export { UserSession } from './user-session';
24
24
  export { UTMData } from './utm';
25
25
  export { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';
26
26
  export { OfflineDisabled } from './offline';
27
- export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
27
+ export { Messenger, ElementInteractionsOptions, ActionType, DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, DEFAULT_ACTION_CLICK_ALLOWLIST, } from './element-interactions';
28
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,eA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AAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,0BAA0B,EAC1B,UAAU,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC"}
package/lib/esm/index.js CHANGED
@@ -3,5 +3,5 @@ export { LogLevel } from './logger';
3
3
  export { ServerZone } from './server-zone';
4
4
  export { Status } from './status';
5
5
  export { OfflineDisabled } from './offline';
6
- export { DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, } from './element-interactions';
6
+ export { DEFAULT_CSS_SELECTOR_ALLOWLIST, DEFAULT_DATA_ATTRIBUTE_PREFIX, DEFAULT_ACTION_CLICK_ALLOWLIST, } from './element-interactions';
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,gBAAgB,EAChB,iBAAiB,EAMjB,eAAe,GAEhB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAU,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAQrE,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n} from './element-interactions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,gBAAgB,EAChB,iBAAiB,EAMjB,eAAe,GAEhB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAU,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAQrE,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n} from './element-interactions';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-types",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -35,5 +35,5 @@
35
35
  "files": [
36
36
  "lib"
37
37
  ],
38
- "gitHead": "1a070ad8aa0b2d274802acbac5a92bbbe38d2257"
38
+ "gitHead": "811bd12a8692e2eb3476ebd0f32bd4a5178c18c0"
39
39
  }