import type { InitializationData, ExecuteSyncOperationPayload, ExecuteAsyncOperationPayload } from './types'; import type { InAppCallback } from './InAppCallback'; import { LogLevel } from './LogLevel'; declare class MindboxSdkClass { private _initialized; private _initializing; private _callbacks; private _mindboxJsDeliveryEvents; private _emitterSubscribtion?; private readonly _prefix; constructor(); /** * @name initialized * @type {boolean} * @description Is MindboxSdk already initialized. */ get initialized(): boolean; /** * @name subscribedForPushClickedEvent * @type {boolean} * @description Is there any subscription on push notification tapped. */ get subscribedForPushClickedEvent(): boolean; registerInAppCallbacks(callbacks: Array): void; /** * @name initialize * @description Initialization of MindboxSdk. It is recommended to do this on app's launch. You can call this method multiple times to set new configuration params. * @param {InitializationData} initializationData Initialization data * * @example * await MindboxSdk.initialize({ * domain: 'api.mindbox.ru', * endpointId: 'your-endpoint-id-here', * subscribeCustomerIfCreated: true, * shouldCreateCustomer: true, * previousInstallId: '', * previousUuid: '', * }); */ initialize(initializationData: InitializationData): Promise; /** * @name getDeviceUUID * @description Requires a callback that will return device UUID. * @param {function(deviceUUID: String): void} callback Callback will return device UUID * * @example * MindboxSdk.getDeviceUUID((uuid: string) => { ... }); */ getDeviceUUID(callback: (deviceUUID: string) => void): void; /** * @name getToken * @description Requires a callback that will return FMS (Android) / APNS (iOS) token. * @param {function(token: String): void} callback Callback will return FMS (Android) / APNS (iOS) token * @deprecated since version 2.12.0. Use getTokens * @example * MindboxSdk.getToken((token: string) => { ... }); */ getToken(callback: (token: string) => void): void; /** * @name getTokens * @description Requires a callback that will return FMS (Android) / APNS (iOS) token . * method return jsin string like {"FCM":"token1","HMS":"token2","RuStore":"token3"} * @param {function(token: String): void} callback Callback will return FMS/HCM/RuStore (Android) / APNS (iOS) token * @example * MindboxSdk.getTokens((token: string) => { ... }); */ getTokens(callback: (token: string) => void): void; /** * @name updateToken * @description Updates your FMS/APNS token. * @param {String} token Your new fms/apns token * @deprecated since version 2.12.0. Use native methods * @example * await MindboxSdk.updateToken('your-fms/apns-token'); */ updateToken(token: string): Promise; /** * @name onPushClickReceived * @description Listens if push notification or push notification button were pressed. * @param {function(pushUrl: String, pushPayload: String): void} callback Callback will return push notification link or push notification button link * * @example * MindboxSdk.onPushClickReceived((pushClickRecievedData: string) => { ... }); */ onPushClickReceived(callback: (pushUrl: string | null, pushPayload: string | null) => void): void; /** * @name removeOnPushClickReceived * @description Removes onPushClickReceived subscribtion and event listener. * * @example * MindboxSdk.removeOnPushClickReceived(); */ removeOnPushClickReceived(): void; /** * @name executeAsyncOperation * @description Makes request to backend API without waiting any response. * @param {ExecuteAsyncOperationPayload} payload Payload with data * @param {String} payload.operationSystemName System name of the async operation * @param {Object} payload.operationBody Data for operation. Will be passed to the backed API * * @example * MindboxSdk.executeAsyncOperation({ * operationSystemName: '--YOUR SYSTEM NAME HERE--', * operationBody: { ... }, * }); */ executeAsyncOperation(payload: ExecuteAsyncOperationPayload): void; /** * @name executeSyncOperation * @description Makes request to backend API and waits response. * @param {ExecuteSyncOperationPayload} payload Payload with data * @param {String} payload.operationSystemName System name of the async operation * @param {Object} payload.operationBody Data for operation. Will be passed to the backed API * @param {function(data: ExecuteSyncOperationSuccess): void} payload.onSuccess Callback will return data in case of successfull request * @param {function(error: ExecuteSyncOperationError): void} payload.onError Callback will return error data in case of unsuccessfull request * * @example * MindboxSdk.executeSyncOperation({ * operationSystemName: '--YOUR SYSTEM NAME HERE--', * operationBody: { ... }, * onSuccess: (data) => { ... }, * onError: (error) => { ... }, * }); */ executeSyncOperation(payload: ExecuteSyncOperationPayload): void; /** * Method for managing sdk logging * * @param level - is used for showing Mindbox logs starts from [LogLevel]. Default * is [LogLevel.WARN]. [LogLevel.NONE] turns off all logs. */ setLogLevel(level: LogLevel): void; /** * Returns SDK version */ getSdkVersion(callback: (sdkVersion: string) => void): any; /** * * Creates and deliveries event of "Push delivered". Recommended call this method from * background thread. * * Use this method only if you have custom push handling you don't use [Mindbox.handleRemoteMessage]. * You must not call it otherwise. * * @param uniqKey unique identifier of push notification * @deprecated since version 2.10.3. Use native methods */ pushDelivered(uniqKey: string): any; /** * This method is kept for backward compatibility. The `granted` argument is ignored. * The SDK reads the current system authorization status and, if it differs * from the last known value, sends an update to the backend. * * @param granted current permission status * @deprecated Use `refreshNotificationPermissionStatus()` instead. */ updateNotificationPermissionStatus(granted: Boolean): any; /** * Checks the current system authorization status for push notifications * and reports any changes to Mindbox. * * @example * MindboxSdk.refreshNotificationPermissionStatus() */ refreshNotificationPermissionStatus(): any; /** * Writes a log message to the native Mindbox logging system. * * Usage example: * * MindboxSdk..writeNativeLog( * message: "This is a debug message", * logLevel: LogLevel.DEBUG, * ); * * @param message: The message to be logged. * @param logLevel: The severity level of the log message [LogLevel]. */ writeNativeLog(message: String, logLevel: LogLevel): any; } declare const MindboxSdk: MindboxSdkClass; export default MindboxSdk; export { LogLevel } from './LogLevel'; export { InAppCallback, CopyPayloadInAppCallback, EmptyInAppCallback, UrlInAppCallback } from './InAppCallback';