Skip to content

Commit f04de07

Browse files
authored
[FSSDK-11823] ActivateListenerPaylod type fix in shared_types (#1083)
Currently, the notification payload types are exported from shared_types. But the current current types used in the notification center has diverged from these types, and these types are not used in the sdk. Therefore, the sdk user should not import/use these types either. But as these has been publicly released, we cannot change them in a incompatible manner either. So, updating these types as generic map to keep them backwards comptabile. Also exporting the actual payload types being used with new names. The user should use these new types instead.
1 parent b9fb371 commit f04de07

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

lib/export_types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export type { Store } from './utils/cache/store'
7070
export type {
7171
NotificationType,
7272
NotificationPayload,
73+
ActivateListenerPayload as ActivateNotificationPayload,
74+
DecisionListenerPayload as DecisionNotificationPayload,
75+
TrackListenerPayload as TrackNotificationPayload,
76+
LogEventListenerPayload as LogEventNotificationPayload,
77+
OptimizelyConfigUpdateListenerPayload as OptimizelyConfigUpdateNotificationPayload,
7378
} from './notification_center/type';
7479

7580
export type {

lib/index.universal.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export type { Cache } from './utils/cache/cache';
101101
export type {
102102
NotificationType,
103103
NotificationPayload,
104+
ActivateListenerPayload as ActivateNotificationPayload,
105+
DecisionListenerPayload as DecisionNotificationPayload,
106+
TrackListenerPayload as TrackNotificationPayload,
107+
LogEventListenerPayload as LogEventNotificationPayload,
108+
OptimizelyConfigUpdateListenerPayload as OptimizelyConfigUpdateNotificationPayload,
104109
} from './notification_center/type';
105110

106111
export type {

lib/shared_types.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,12 @@ export interface Client {
366366
isOdpIntegrated(): boolean;
367367
}
368368

369-
export interface ActivateListenerPayload extends ListenerPayload {
370-
experiment: import('./shared_types').ExperimentCore;
371-
variation: import('./shared_types').Variation;
372-
logEvent: Event;
369+
export interface ActivateListenerPayload {
370+
[key: string]: any;
373371
}
374372

375-
export interface TrackListenerPayload extends ListenerPayload {
376-
eventKey: string;
377-
eventTags: EventTags;
378-
logEvent: Event;
373+
export interface TrackListenerPayload {
374+
[key: string]: any;
379375
}
380376

381377
/**

0 commit comments

Comments
 (0)