import { AnyFunction } from '@codeleap/types'; import { Subscriber, Subscription } from '../Subscription'; import { Message, NotificationInitializeCallback, NotificationManagerOptions, TNotification } from './types'; export * from './types'; /** * Requires `@react-native-firebase/messaging` to be installed and the app to have a valid `google-services.json` / `GoogleService-Info.plist`. `initialize` must be awaited at app boot — calling `registerEvent` before `initialize` is safe (events are stored) but `invokeForInitialNotification` will be skipped if `initialized` is already `true`, so calling `initialize` twice silently drops the cold-start notification. `onBackgroundMessage` registers a global Firebase background handler that persists beyond the component lifecycle; it is never automatically cleaned up. */ export declare class NotificationManager { parser: NotificationManagerOptions['parser']; currentOptions: NotificationManagerOptions; currentToken: null; private registeredUnsubscribers; private initialized; events: Subscription, E>; constructor(options?: NotificationManagerOptions); private invoke; log(description: string, data?: any): void; /** * Checks if you are authorized for notifications and returns the result * * @return hasAuthorization (boolean) */ getHasAuthorization(): Promise; /** * Gets and returns the device token * * @return token (string) or null if an error occurs */ getToken(): Promise; onTokenRefresh(cb: (token: string) => void): () => void; invokeForInitialNotification(): Promise; onBackgroundMessage(): () => void; /** * Responsible for initializing all notification services: token refresh, background, foreground, press and initial notification * * @param {function} callback Callback that is executed when the services are initialized, returning the device token */ initialize(callback: NotificationInitializeCallback): Promise; unsubscribe(): Promise; /** * Unsubscribe all services that have been started * * @param {function} callback Callback that is executed when the services are deinitialized */ deinitialize(callback?: AnyFunction): Promise; /** * Registers an event that will be called by all notification services that have been started * * @param {string} eventName Event name * @param {string} handler Function that will be performed * @return unsubscribe event (function) */ registerEvent(eventName: E, handler: Subscriber>): () => void; } //# sourceMappingURL=index.d.ts.map