@khanacademy/perseus-core
Advanced tools
Comparing version 0.0.1 to 0.0.2
# @khanacademy/perseus-core | ||
## 0.0.2 | ||
### Patch Changes | ||
- 71c631ea: Add keypad opened and closed analytics events | ||
## 0.0.1 | ||
@@ -4,0 +10,0 @@ |
export type PerseusAnalyticsEvent = { | ||
type: "perseus:expression-evaluated"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
virtualKeypadVersion?: string; | ||
result: "correct" | "incorrect" | "invalid"; | ||
}; | ||
} | { | ||
type: "math-input:keypad-closed"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
}; | ||
} | { | ||
type: "math-input:keypad-opened"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
}; | ||
}; | ||
/** A function to send analytics events. */ | ||
export type SendEventFn = (event: PerseusAnalyticsEvent) => Promise<void>; |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "access": "public" |
// A type union of all the events that any package in the Perseus ecosystem can | ||
// send. | ||
export type PerseusAnalyticsEvent = { | ||
type: "perseus:expression-evaluated"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
result: "correct" | "incorrect" | "invalid"; | ||
}; | ||
}; | ||
export type PerseusAnalyticsEvent = | ||
| { | ||
type: "perseus:expression-evaluated"; | ||
payload: { | ||
// Keypad version can be supplied by Perseus sometimes, but not always. | ||
// The host application will need to fill this in if it's not present. | ||
virtualKeypadVersion?: string; | ||
result: "correct" | "incorrect" | "invalid"; | ||
}; | ||
} | ||
| { | ||
type: "math-input:keypad-closed"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
}; | ||
} | ||
| { | ||
type: "math-input:keypad-opened"; | ||
payload: { | ||
virtualKeypadVersion: string; | ||
}; | ||
}; | ||
// Add more events here as needed. Note that each event should have a `type` | ||
@@ -11,0 +26,0 @@ // key and a payload that varies by type. |
Sorry, the diff of this file is not supported yet
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
50471
91