/** * Flowtype definitions for manager * Generated by Flowgen from a Typescript Definition * Flowgen v1.21.0 */ import { BehaviorSubject,Subject } from 'rxjs'; import { AppStorage } from '../app/storage'; declare export var NotificationTrigger: {| +TransactionReceived: "TransactionReceived",// "TransactionReceived" +RewardsUpdated: "RewardsUpdated",// "RewardsUpdated" +PrimaryTokenPriceChanged: "PrimaryTokenPriceChanged",// "PrimaryTokenPriceChanged" +Push: "Push",// "Push" +Banner: "Banner",// "Banner" |}; export type NotificationManagerMakerProps = { eventsStorage: AppStorage, configStorage: AppStorage, subscriptions?: $Rest<{ [typeof NotificationTrigger$'TransactionReceived']: Subject, [typeof NotificationTrigger$'RewardsUpdated']: Subject, [typeof NotificationTrigger$'PrimaryTokenPriceChanged']: Subject, [typeof NotificationTrigger$'Push']: Subject, [typeof NotificationTrigger$'Banner']: Subject,... }, {...}>, eventsLimit?: number,... };export type BannerNotificationEvent = { trigger: typeof NotificationTrigger.'Banner', metadata: { title: string, body: string, data?: {[key: string]: mixed, ...},... },... } & NotificationEventBase export type PushNotificationEvent = { trigger: typeof NotificationTrigger.'Push', metadata: { title: string, body: string, data?: {[key: string]: mixed, ...},... },... } & NotificationEventBase export type NotificationTransactionReceivedEvent = { trigger: typeof NotificationTrigger.'TransactionReceived', metadata: { walletId: string, previousTxsCounter: number, nextTxsCounter: number, txId: string, isSentByUser: boolean,... },... } & NotificationEventBase export type NotificationRewardsUpdatedEvent = { trigger: typeof NotificationTrigger.'RewardsUpdated', metadata: { walletId: string,... },... } & NotificationEventBase export type NotificationPrimaryTokenPriceChangedEvent = { trigger: typeof NotificationTrigger.'PrimaryTokenPriceChanged', metadata: { previousPrice: number, nextPrice: number,... },... } & NotificationEventBase export type NotificationGroup = "transaction-history" | "portfolio" | "push";export type NotificationEvent = NotificationTransactionReceivedEvent | NotificationPrimaryTokenPriceChangedEvent | NotificationRewardsUpdatedEvent | PushNotificationEvent | BannerNotificationEvent;declare type NotificationEventId = number;declare interface NotificationEventBase { id: NotificationEventId, date: string, isRead: boolean, } export type NotificationConfig = { displayDuration: number, [typeof NotificationTrigger$'Push']: { notify: boolean,... }, [typeof NotificationTrigger$'PrimaryTokenPriceChanged']: { notify: boolean, thresholdInPercent: number, interval: "24h" | "1h",... }, [typeof NotificationTrigger$'TransactionReceived']: { notify: boolean,... }, [typeof NotificationTrigger$'RewardsUpdated']: { notify: boolean,... }, [typeof NotificationTrigger$'Banner']: { notify: boolean,... },... };export type NotificationManager = { hydrate: () => void, unreadCounterByGroup$: BehaviorSubject<$ReadOnly>>, newEvents$: Subject, events: { markAllAsRead: () => Promise, markAsRead(id: NotificationEventId): Promise, remove(id: NotificationEventId): Promise<$ReadOnlyArray>, read: () => Promise<$ReadOnlyArray>, push: (event: $ReadOnly) => Promise, clear: () => Promise,... }, config: { read: () => Promise<$ReadOnly>, save: (config: $ReadOnly<$Rest>) => Promise, reset: () => Promise,... }, destroy: () => Promise, clear: () => Promise,... };