gtm-event-tracker
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -6,20 +6,1 @@ /** | ||
export declare type EventProperties = Record<string, string | number>; | ||
/** | ||
* The type-safe and recommended way for you to interact with `window.dataLayer`. | ||
* @public | ||
*/ | ||
export declare type DataLayerModule = Readonly<{ | ||
/** | ||
* Pushes an event to `window.dataLayer`. | ||
* @public | ||
*/ | ||
addEvent: (payload: EventProperties) => void; | ||
/** | ||
* Asserts `window.dataLayer` is available. | ||
* | ||
* This array is injected in the `window` by Google Tag Manager, so you | ||
* just need to have this dependency installed correctly. | ||
* @public | ||
*/ | ||
assertIsAvailable: () => void; | ||
}>; |
@@ -1,2 +0,3 @@ | ||
import type { DataLayerModule } from './data-layer-types'; | ||
export declare const dataLayer: DataLayerModule; | ||
import type { DataLayerFunctions } from './data-layer-types'; | ||
export declare function createDataLayerModule(): DataLayerFunctions; | ||
export declare const dataLayer: DataLayerFunctions; |
@@ -5,6 +5,2 @@ "use strict"; | ||
const data_layer_error_1 = require("./data-layer-error"); | ||
/** | ||
* Create the Data Layer module. | ||
* @internal | ||
*/ | ||
function createDataLayerModule() { | ||
@@ -11,0 +7,0 @@ function addEvent(payload) { |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "A type-safe, reusable, and flexible way for triggering Google Tag Manager track events.", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"clean": "rimraf dist temp *.tsbuildinfo", | ||
"dev": "yarn build --watch --preserveWatchOutput", | ||
"dev": "npm-run-all 'build:ts --watch --preserveWatchOutput'", | ||
"build": "npm-run-all clean build:ts", | ||
@@ -27,0 +27,0 @@ "build:ts": "tsc --project tsconfig.build.json", |
@@ -8,9 +8,8 @@ /** | ||
/** | ||
* The type-safe and recommended way for you to interact with `window.dataLayer`. | ||
* @public | ||
* The type-safe and recommended way to interact with `window.dataLayer`. | ||
* @internal | ||
*/ | ||
export type DataLayerModule = Readonly<{ | ||
export type DataLayerFunctions = Readonly<{ | ||
/** | ||
* Pushes an event to `window.dataLayer`. | ||
* @public | ||
*/ | ||
@@ -24,13 +23,4 @@ addEvent: (payload: EventProperties) => void | ||
* just need to have this dependency installed correctly. | ||
* @public | ||
*/ | ||
assertIsAvailable: () => void | ||
}> | ||
/** | ||
* Options for customizing the Data Layer module. | ||
* @internal | ||
*/ | ||
export type DataLayerModuleOptions = { | ||
debug?: boolean | ||
} |
@@ -6,9 +6,5 @@ import { | ||
} from './data-layer-error' | ||
import type { EventProperties, DataLayerModule } from './data-layer-types' | ||
import type { EventProperties, DataLayerFunctions } from './data-layer-types' | ||
/** | ||
* Create the Data Layer module. | ||
* @internal | ||
*/ | ||
export function createDataLayerModule(): DataLayerModule { | ||
export function createDataLayerModule(): DataLayerFunctions { | ||
function addEvent(payload: EventProperties) { | ||
@@ -34,2 +30,2 @@ window.dataLayer.push(payload) | ||
export const dataLayer: DataLayerModule = createDataLayerModule() | ||
export const dataLayer: DataLayerFunctions = createDataLayerModule() |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42121
964