gtm-event-tracker
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -26,2 +26,36 @@ /** | ||
/** | ||
* Available method for logs. | ||
* @public | ||
*/ | ||
export declare type Logger = { | ||
log: (action: LoggerAction) => void; | ||
warn: (action: LoggerAction) => void; | ||
error: (action: LoggerAction) => void; | ||
}; | ||
/** | ||
* Available types of log actions. | ||
* @public | ||
*/ | ||
export declare type LoggerAction = { | ||
type: 'event'; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-created'; | ||
contextName?: string; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-updated'; | ||
contextName?: string; | ||
previousProperties: EventProperties; | ||
currentProperties: EventProperties; | ||
}; | ||
/** | ||
* Sets a custom logger. | ||
* @public | ||
*/ | ||
export declare const setLogger: (targetLogger: Logger) => void; | ||
/** | ||
* Will subtract `PropsToSubtract` type from `OriginalProps` type. And ensure | ||
@@ -28,0 +62,0 @@ * that those properties are compatible with a track event type. |
@@ -26,2 +26,36 @@ /** | ||
/** | ||
* Available method for logs. | ||
* @public | ||
*/ | ||
export declare type Logger = { | ||
log: (action: LoggerAction) => void; | ||
warn: (action: LoggerAction) => void; | ||
error: (action: LoggerAction) => void; | ||
}; | ||
/** | ||
* Available types of log actions. | ||
* @public | ||
*/ | ||
export declare type LoggerAction = { | ||
type: 'event'; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-created'; | ||
contextName?: string; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-updated'; | ||
contextName?: string; | ||
previousProperties: EventProperties; | ||
currentProperties: EventProperties; | ||
}; | ||
/** | ||
* Sets a custom logger. | ||
* @public | ||
*/ | ||
export declare const setLogger: (targetLogger: Logger) => void; | ||
/** | ||
* Will subtract `PropsToSubtract` type from `OriginalProps` type. And ensure | ||
@@ -28,0 +62,0 @@ * that those properties are compatible with a track event type. |
@@ -26,2 +26,36 @@ /** | ||
/** | ||
* Available method for logs. | ||
* @public | ||
*/ | ||
export declare type Logger = { | ||
log: (action: LoggerAction) => void; | ||
warn: (action: LoggerAction) => void; | ||
error: (action: LoggerAction) => void; | ||
}; | ||
/** | ||
* Available types of log actions. | ||
* @public | ||
*/ | ||
export declare type LoggerAction = { | ||
type: 'event'; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-created'; | ||
contextName?: string; | ||
properties: EventProperties; | ||
} | { | ||
type: 'context-updated'; | ||
contextName?: string; | ||
previousProperties: EventProperties; | ||
currentProperties: EventProperties; | ||
}; | ||
/** | ||
* Sets a custom logger. | ||
* @public | ||
*/ | ||
export declare const setLogger: (targetLogger: Logger) => void; | ||
/** | ||
* Will subtract `PropsToSubtract` type from `OriginalProps` type. And ensure | ||
@@ -28,0 +62,0 @@ * that those properties are compatible with a track event type. |
export { createTrackerContext, TrackerContext, TrackerContextOptions, } from './tracker-context'; | ||
export { withTrackerContext, TrackModule, SubtractEventProperties, } from './with-tracker'; | ||
export type { EventProperties } from './data-layer'; | ||
export { setLogger, Logger, LoggerAction } from './logger'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.withTrackerContext = exports.createTrackerContext = void 0; | ||
exports.setLogger = exports.withTrackerContext = exports.createTrackerContext = void 0; | ||
var tracker_context_1 = require("./tracker-context"); | ||
@@ -8,2 +8,4 @@ Object.defineProperty(exports, "createTrackerContext", { enumerable: true, get: function () { return tracker_context_1.createTrackerContext; } }); | ||
Object.defineProperty(exports, "withTrackerContext", { enumerable: true, get: function () { return with_tracker_1.withTrackerContext; } }); | ||
var logger_1 = require("./logger"); | ||
Object.defineProperty(exports, "setLogger", { enumerable: true, get: function () { return logger_1.setLogger; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A type-safe, reusable, and flexible way for triggering Google Tag Manager track events.", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -14,1 +14,2 @@ export { | ||
export type { EventProperties } from './data-layer' | ||
export { setLogger, Logger, LoggerAction } from './logger' |
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
56224
75
1408