Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CommonEventProperties type argument #1250

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading