Skip to content

Commit fed8695

Browse files
committed
Add CommonEventProperties type argument (close #1249)
1 parent 265d062 commit fed8695

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@snowplow/browser-tracker",
5+
"comment": "Add CommonEventProperties type argument",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@snowplow/browser-tracker"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@snowplow/tracker-core",
5+
"comment": "Add CommonEventProperties type argument",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@snowplow/tracker-core"
10+
}

libraries/tracker-core/src/core.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ function getTimestamp(timestamp?: Timestamp | null): TimestampPayload {
119119
}
120120

121121
/** Additional data points to set when tracking an event */
122-
export interface CommonEventProperties {
122+
export interface CommonEventProperties<T> {
123123
/** Add context to an event by setting an Array of Self Describing JSON */
124-
context?: Array<SelfDescribingJson> | null;
124+
context?: Array<SelfDescribingJson<T>> | null;
125125
/** Set the true timestamp or overwrite the device sent timestamp on an event */
126126
timestamp?: Timestamp | null;
127127
}

trackers/browser-tracker/docs/browser-tracker.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ export interface ClientSession extends Record<string, unknown> {
142142
}
143143

144144
// @public
145-
export interface CommonEventProperties {
146-
context?: Array<SelfDescribingJson> | null;
145+
export interface CommonEventProperties<T = Record<string, unknown>> {
146+
context?: Array<SelfDescribingJson<T>> | null;
147147
// Warning: (ae-forgotten-export) The symbol "Timestamp" needs to be exported by the entry point index.module.d.ts
148148
timestamp?: Timestamp | null;
149149
}

0 commit comments

Comments
 (0)