import type RNInsiderProduct from './src/InsiderProduct'; import type RNInsiderEvent from './src/InsiderEvent'; import type RNInsiderUser from './src/InsiderUser'; import type RNInsiderIdentifier from './src/InsiderIdentifier'; import type RNInsiderAppCards from './src/InsiderAppCards'; import type RNInsiderEvents from './src/InsiderEvents'; // App Frames is a React component, so it is a named export rather than a member of RNInsider. export { default as InsiderAppFrame } from './src/InsiderAppFrame'; export type { InsiderAppFrameProps, InsiderAppFrameHandle } from './src/InsiderAppFrame'; export { InsiderAppFramesError, InsiderAppFramesErrorCode, NO_DISMISS_CODE, } from './src/InsiderAppFramesError'; export type { InsiderAppFramesErrorCodeType } from './src/InsiderAppFramesError'; export { InsiderAppFrameStatus } from './src/InsiderAppFrameStatus'; export { isErrorStatus, isLoadingStatus } from './src/InsiderAppFrameLogic'; export type { InsiderAppFrameStatusType } from './src/InsiderAppFrameStatus'; import type { InsiderAppFramesError as InsiderAppFramesErrorClass } from './src/InsiderAppFramesError'; import type { InsiderAppFramesErrorCode as InsiderAppFramesErrorCodeEnum } from './src/InsiderAppFramesError'; export type { InsiderObject, InsiderObjectValue, InsiderNestedObject, InsiderObjectLeaf } from './src/InsiderObject'; export type CustomParameters = { [key: string]: string | number | boolean | Date | number[] | string[]; }; /** * Error codes for App Cards operations. * * These codes are aligned with the native SDK error codes on both Android and iOS: * - Android: AppCardsException.AppCardsExceptionCode * - iOS: InsiderAppCardsErrorCode * * @readonly * @enum {string} */ export declare const InsiderAppCardsErrorCode: { /** An unknown or unexpected error occurred. */ readonly UNKNOWN: 'unknown'; /** The Insider SDK is not initialized, frozen, or not GDPR compliant. */ readonly SDK_NOT_INITIALIZED: 'sdkNotInitialized'; /** An invalid parameter was provided (e.g., empty or null IDs). */ readonly INVALID_PARAMETER: 'invalidParameter'; /** A network error occurred during the request. */ readonly NETWORK_ERROR: 'networkError'; /** The server returned an error response. */ readonly SERVER_ERROR: 'serverError'; /** The server response could not be parsed. */ readonly PARSE_ERROR: 'parseError'; }; /** Union type of all possible error code values. */ export type InsiderAppCardsErrorCodeType = typeof InsiderAppCardsErrorCode[keyof typeof InsiderAppCardsErrorCode]; /** * Recorded-event types. They are defined alongside the `events` module in * `./src/InsiderEvents`, and re-exported here so that consumers can keep importing them * straight from the package root (`import { InsiderEventSubscription } from 'react-native-insider'`). */ export type { InsiderRecordedEventParameters, InsiderEventRecordedCallback, InsiderEventSubscription, } from './src/InsiderEvents'; /** * Represents a typed error from an App Cards operation. * * Extends the standard Error class with a structured error code * that maps to the native SDK error codes on both Android and iOS. * * @example * ```typescript * try { * const response = await RNInsider.appCards.getCampaigns(); * } catch (error) { * if (error instanceof InsiderAppCardsError) { * switch (error.code) { * case InsiderAppCardsErrorCode.NETWORK_ERROR: * console.log('Network issue, please try again'); * break; * case InsiderAppCardsErrorCode.SDK_NOT_INITIALIZED: * console.log('SDK not ready'); * break; * default: * console.log('Error:', error.code, error.message); * } * } * } * ``` */ export declare class InsiderAppCardsError extends Error { /** The name of the error, always 'InsiderAppCardsError'. */ readonly name: 'InsiderAppCardsError'; /** The error code identifying the type of error. */ readonly code: InsiderAppCardsErrorCodeType; /** * @param code - One of InsiderAppCardsErrorCode values. * @param message - A human-readable error description. */ constructor(code: InsiderAppCardsErrorCodeType, message: string); /** * Creates an InsiderAppCardsError from a native bridge error response. * * @param error - The error from the native bridge, either a structured object or a plain string. * @returns A new InsiderAppCardsError instance. */ static from(error: { code: string; message: string } | string | unknown): InsiderAppCardsError; } // Top level, not `declare module 'react-native-insider'`: this file is already a module, so such // a block would be read as an augmentation of itself and never applied. export interface InsiderCloseButtonPosition { LEFT: string; RIGHT: string; NONE: string; } export default class RNInsider { static closeButtonPosition: InsiderCloseButtonPosition; static AppCardsError: typeof InsiderAppCardsError; static AppCardsErrorCode: typeof InsiderAppCardsErrorCode; static AppFramesError: typeof InsiderAppFramesErrorClass; static AppFramesErrorCode: typeof InsiderAppFramesErrorCodeEnum; /** * Initializes the Insider SDK; pass `appIdentifier` when one partner serves several apps. * @param appIdentifier Optional app identifier given to you by Insider (`^[a-z0-9][a-z0-9_]{0,49}$`). * Omit it, or pass an empty string, to initialize without one. */ static init(partnerName: string, appGroup: string, insiderCallback: Function, appIdentifier?: string): void; /** * Initializes the Insider SDK against a custom endpoint; pass `appIdentifier` when one partner serves several apps. * @param appIdentifier Optional app identifier given to you by Insider (`^[a-z0-9][a-z0-9_]{0,49}$`). * Omit it, or pass an empty string, to initialize without one. */ static initWithCustomEndpoint(partnerName: string, appGroup: string, endpoint: string, insiderCallback: Function, appIdentifier?: string): void; static reinitWithPartnerName(partnerName: string): void; static tagEvent(name: string): RNInsiderEvent; static getCurrentUser(): RNInsiderUser; static get appCards(): RNInsiderAppCards; static get events(): RNInsiderEvents; static setGDPRConsent(gdprConsent: boolean): void; static setMobileAppAccess(mobileAppAccess: boolean): void; static createNewProduct( productID: string, name: string, taxonomy: Array, imageURL: string, price: number, currency: string ): RNInsiderProduct; static itemPurchased(uniqueSaleID: string, product: RNInsiderProduct, customParameters?: CustomParameters): void; static itemAddedToCart(product: RNInsiderProduct, customParameters?: CustomParameters): void; static itemRemovedFromCart(productID: string): void; static itemRemovedFromCart(productID: string, customParameters: CustomParameters): void; static itemRemovedFromCart(productID: string, saleID: string): void; static itemRemovedFromCart(productID: string, saleID: string, customParameters: CustomParameters): void; static cartCleared(customParameters?: CustomParameters): void; static itemAddedToWishlist(product: RNInsiderProduct, customParameters?: CustomParameters): void; static itemRemovedFromWishlist(productID: string, customParameters?: CustomParameters): void; static wishlistCleared(customParameters?: CustomParameters): void; static getMessageCenterData( limit: number, startDate: Date, endDate: Date, callback: (messageCenterData: any) => void ): void; static getMessageCenterDataWithIdentifiers( limit: number, startDate: Date, endDate: Date, identifiers: RNInsiderIdentifier, callback: (messageCenterData: any) => void ): void; static getSmartRecommendation( recommendationID: number, locale: string, currency: string, callback: (recommendation: any) => void ): void; static getSmartRecommendationWithProduct( product: RNInsiderProduct, recommendationID: number, locale: string, callback: (recommendation: any) => void ): void; static getSmartRecommendationWithProductIDs( productIDs: string[], recommendationID: number, locale: string, currency: string, callback: (recommendation: any) => void ): void; static clickSmartRecommendationProduct(recommendationID: number, product: RNInsiderProduct): void; static getContentStringWithName( variableName: string, defaultValue: string, contentOptimizerDataType: number, callback: (content: string) => void ): void; static getContentBoolWithName( variableName: string, defaultValue: boolean, contentOptimizerDataType: number, callback: (content: boolean) => void ): void; static getContentIntWithName( variableName: string, defaultValue: number, contentOptimizerDataType: number, callback: (content: number) => void ): void; static getContentStringWithoutCache( variableName: string, defaultValue: string, contentOptimizerDataType: number, callback: (content: string) => void ): void; static getContentBoolWithoutCache( variableName: string, defaultValue: boolean, contentOptimizerDataType: number, callback: (content: boolean) => void ): void; static getContentIntWithoutCache( variableName: string, defaultValue: number, contentOptimizerDataType: number, callback: (content: number) => void ): void; static markContentOptimizerAsSeen(variableName: string): void; static visitHomePage(customParameters?: CustomParameters): void; static visitListingPage(taxonomy: Array, customParameters?: CustomParameters): void; static visitProductDetailPage(product: RNInsiderProduct, customParameters?: CustomParameters): void; static visitCartPage(products: Array): void; static visitCartPage(products: Array, customParameters: CustomParameters): void; static visitCartPage(products: Array, saleID: string): void; static visitCartPage(products: Array, saleID: string, customParameters: CustomParameters): void; static visitWishlistPage(products: Array, customParameters?: CustomParameters): void; static startTrackingGeofence(): void; static setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates: boolean): void; static handleNotification(notification: any): void; static triggerPushProcessWithNotificationData(notification: any): void; static enableIDFACollection(enableIDFACollection: boolean): void; static removeInapp(): void; static registerWithQuietPermission(enabled: boolean): void; static setHybridPushToken(token: string): void; static showNativeAppReview(): void; static enableLocationCollection(consentStatus: boolean): void; static enableIpCollection(consentStatus: boolean): void; static enableCarrierCollection(consentStatus: boolean): void; static signUpConfirmation(customParameters?: CustomParameters): void; static setInternalBrowserCloseButtonPosition(position: string): void; static reenableTemplatesForIOS(): void; static disableTemplatesForIOS(): void; static setForegroundPushCallback(callback: (notification: any) => void): void; static setActiveForegroundPushView(): void; static handleUniversalLink(url: string): void; static getInsiderID(): Promise; static insiderIDListener(callback: (insiderID: string) => void): void; static disableInAppMessages(): void; static enableInAppMessages(): void; /** * Handles deep link URLs from Insider QR codes and email links. * * This method processes incoming URLs to enable deep linking functionality * for features available in the Insider panel. It parses the URL and routes * the user to the appropriate screen or action within the app, allowing * seamless integration with Insider's panel-based features. * * @platform iOS only - This method is only available on iOS platform * @param url - The URL string to be processed from Insider QR codes or email links * @example * RNInsider.handleURL('insider{your_partner_name}://test_device/...'); */ static handleURL(url: string): void; } // The event-channel constants (NOTIFICATION_OPEN, …) are module-local in index.js and not // exported; discriminate callbacks with `InsiderCallbackType`.