-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
fix: Embed API Typings for 'on' and 'off' #16714
Conversation
68abc52
to
bd0c00c
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
@@ -1,7 +1,8 @@ | |||
import type { GlobalCal } from "./src/embed"; | |||
|
|||
const Cal = window.Cal as GlobalCal; | |||
const callback = function (e) { | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
const callback = function (e: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This callback is used by all types of events so we use any
// TODO: This makes api("on", {}) loose it's generic type. Find a way to fix it. | ||
// e.g. api("on", { action: "__dimensionChanged", callback: (e) => { /* `e.detail.data` has all possible values for all events/actions */} }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now fixed.
9bd9acf
to
27b9cd4
Compare
27b9cd4
to
1a7f7c6
Compare
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (09/19/24)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - this works but im not 100% sure how lol some TS magic going on here
E2E results are ready! |
What does this PR do?
callback
in 'on' and 'off'EmbedEvent
type so that it is easy to define a function separately to be assigned to callback. This is a requirement as well when using offBefore:
It was a union of all the events' payloads
Now:
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist