Skip to content

Commit

Permalink
Add CommonEventProperties type argument (close #1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
igneel64 committed Oct 11, 2023
1 parent de97c3b commit e55e715
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-tracker",
"comment": "Add CommonEventProperties type argument",
"type": "none"
}
],
"packageName": "@snowplow/browser-tracker"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/tracker-core",
"comment": "Add CommonEventProperties type argument",
"type": "none"
}
],
"packageName": "@snowplow/tracker-core"
}
4 changes: 2 additions & 2 deletions libraries/tracker-core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ function getTimestamp(timestamp?: Timestamp | null): TimestampPayload {
}

/** Additional data points to set when tracking an event */
export interface CommonEventProperties {
export interface CommonEventProperties<T = Record<string, unknown>> {
/** Add context to an event by setting an Array of Self Describing JSON */
context?: Array<SelfDescribingJson> | null;
context?: Array<SelfDescribingJson<T>> | null;
/** Set the true timestamp or overwrite the device sent timestamp on an event */
timestamp?: Timestamp | null;
}
Expand Down
4 changes: 2 additions & 2 deletions trackers/browser-tracker/docs/browser-tracker.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ export interface ClientSession extends Record<string, unknown> {
}

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

0 comments on commit e55e715

Please sign in to comment.