|
1 | 1 | /** |
2 | | - * Copyright 2020, Optimizely |
| 2 | + * Copyright 2020, 2022, Optimizely |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | -import { objectValues } from '@optimizely/js-sdk-utils'; |
17 | 16 | import { LogHandler, ErrorHandler } from '@optimizely/js-sdk-logging'; |
18 | | -import { NOTIFICATION_TYPES as notificationTypesEnum } from '@optimizely/js-sdk-utils'; |
| 17 | +import { objectValues } from '../../utils/fns'; |
19 | 18 | import { NotificationListener, ListenerPayload } from '../../shared_types'; |
20 | 19 |
|
21 | 20 | import { |
@@ -186,9 +185,9 @@ export class NotificationCenter { |
186 | 185 |
|
187 | 186 | /** |
188 | 187 | * Remove all previously added notification listeners for the argument type |
189 | | - * @param {notificationTypesEnum} notificationType One of NOTIFICATION_TYPES |
| 188 | + * @param {NOTIFICATION_TYPES} notificationType One of NOTIFICATION_TYPES |
190 | 189 | */ |
191 | | - clearNotificationListeners(notificationType: notificationTypesEnum): void { |
| 190 | + clearNotificationListeners(notificationType: NOTIFICATION_TYPES): void { |
192 | 191 | try { |
193 | 192 | this.notificationListeners[notificationType] = []; |
194 | 193 | } catch (e) { |
@@ -239,3 +238,9 @@ export class NotificationCenter { |
239 | 238 | export function createNotificationCenter(options: NotificationCenterOptions): NotificationCenter { |
240 | 239 | return new NotificationCenter(options); |
241 | 240 | } |
| 241 | + |
| 242 | +export interface NotificationSender { |
| 243 | + // TODO[OASIS-6649]: Don't use any type |
| 244 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 245 | + sendNotifications(notificationType: NOTIFICATION_TYPES, notificationData?: any): void |
| 246 | +} |
0 commit comments