-
Notifications
You must be signed in to change notification settings - Fork 83
[FSSDK-12115] Notification center type definition update #1119
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
[FSSDK-12115] Notification center type definition update #1119
Conversation
lib/shared_types.ts
Outdated
| export interface TrackListenerPayload extends ListenerPayload { | ||
| eventKey: string; | ||
| eventTags: EventTags; | ||
| eventTags?: EventTags; |
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 will be a breaking change. Need to keep this type unchanged
lib/shared_types.ts
Outdated
| export interface ActivateListenerPayload extends ListenerPayload { | ||
| experiment: import('./shared_types').Experiment; | ||
| variation: import('./shared_types').Variation; | ||
| experiment?: import('./shared_types').Experiment; |
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 will be a breaking change. Need to keep this unchanged
| }; | ||
|
|
||
| export type NotificationListener<T> = (notificationData: T) => void; | ||
| export interface NotificationCenter { |
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.
We cannot modify this interface, it would be a breaking change
| addNotificationListener<T extends ListenerPayload>( | ||
| notificationType: string, | ||
| callback: NotificationListener<T> | ||
| addNotificationListener<K extends keyof NotificationPayloadMap>( |
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.
we need to keep this unchanged
lib/shared_types.ts
Outdated
| export type NotificationListener<T extends ListenerPayload> = (notificationData: T) => void; | ||
| export type DecisionNotificationType = typeof DECISION_NOTIFICATION_TYPES[keyof typeof DECISION_NOTIFICATION_TYPES]; | ||
|
|
||
| export type DecisionSource = |
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.
can we do type DecisionSource = typeof DECISION_SOURCES[keyof typeof DECISION_SOURCES];
Summary
Notification center listener callback type definition update
Test plan
Existing tests should pass
Issues