import { DecisionReason, Event, HackleRemoteConfig, PropertyValue, Screen, SdkConfig, User, VariationKey, HackleInAppMessageListener, HackleInAppMessageView, PropertyOperations, HackleSubscriptionOperations } from './models'; import { Emitter } from './utils'; interface HackleReactNativeSdkTypeClientEventMap { 'user-updated': User | null; } /** * Hackle React Native SDK client interface * * Provides methods for A/B testing, feature flags, remote config, event tracking, and user management. */ export interface ReactNativeSDKClient extends Emitter { /** * Gets the variation key for an A/B test experiment asynchronously * * @param experimentKey - The experiment key identifier * @returns Promise resolving to the variation key (e.g., "A", "B") */ variation(experimentKey: number): Promise; /** * Gets the variation key for an A/B test experiment synchronously * * @param experimentKey - The experiment key identifier * @returns The variation key (e.g., "A", "B") */ variationSync(experimentKey: number): string; /** * Gets detailed decision information for an A/B test experiment asynchronously * * @param experimentKey - The experiment key identifier * @returns Promise resolving to decision details including variation, reason, and parameters */ variationDetail(experimentKey: number): Promise; /** * Gets detailed decision information for an A/B test experiment synchronously * * @param experimentKey - The experiment key identifier * @returns Decision details including variation, reason, and parameters */ variationDetailSync(experimentKey: number): ReactNativeDecision; /** * Checks if a feature flag is enabled asynchronously * * @param featureKey - The feature flag key identifier * @returns Promise resolving to true if the feature is enabled, false otherwise */ isFeatureOn(featureKey: number): Promise; /** * Checks if a feature flag is enabled synchronously * * @param featureKey - The feature flag key identifier * @returns True if the feature is enabled, false otherwise */ isFeatureOnSync(featureKey: number): boolean; /** * Gets detailed decision information for a feature flag asynchronously * * @param featureKey - The feature flag key identifier * @returns Promise resolving to feature flag decision details including isOn status, reason, and parameters */ featureFlagDetail(featureKey: number): Promise; /** * Gets detailed decision information for a feature flag synchronously * * @param featureKey - The feature flag key identifier * @returns Feature flag decision details including isOn status, reason, and parameters */ featureFlagDetailSync(featureKey: number): ReactNativeFeatureFlagDecision; /** * Tracks an event * * @param event - The event to track with a key, and properties */ track(event: Event): void; /** * Gets the remote config asynchronously * * @returns Promise resolving to remote config object for retrieving configuration values */ remoteConfig(): Promise; /** * Gets the remote config synchronously * * @returns Remote config object for retrieving configuration values */ remoteConfigSync(): HackleRemoteConfig; /** * Waits for the SDK to be fully initialized * * @returns Promise that resolves when the SDK is ready */ onReady(): Promise; /** * Gets the current user object * * @returns Promise resolving to the current user */ getUser(): Promise; /** * Sets the current user * * @param user - The user object to set * @returns Promise that resolves when the user is set */ setUser(user: User): Promise; /** * Sets the user ID * * @param userId - The user ID to set, or null/undefined to clear * @returns Promise that resolves when the user ID is set */ setUserId(userId: string | null | undefined): Promise; /** * Sets the device ID * * @param deviceId - The device ID to set * @returns Promise that resolves when the device ID is set */ setDeviceId(deviceId: string): Promise; /** * Sets a user property * * @deprecated Use updateUserProperties(operations) instead * @param key - The property key * @param value - The property value * @returns Promise that resolves when the property is set */ setUserProperty(key: string, value: PropertyValue): Promise; /** * Sets user properties * * @deprecated Use updateUserProperties(operations) instead * @param properties - Object containing property key-value pairs * @returns Promise that resolves when the properties are set */ setUserProperties(properties: { [key: string]: PropertyValue; }): Promise; /** * Updates user properties using operations * * @param operations - Property operations to apply * @returns Promise that resolves when the operations are applied */ updateUserProperties(operations: PropertyOperations): Promise; /** * Updates push notification subscription preferences * * @param operations - Subscription operations to apply * @returns Promise that resolves when the subscriptions are updated */ updatePushSubscriptions(operations: HackleSubscriptionOperations): Promise; /** * Updates SMS subscription preferences * * @param operations - Subscription operations to apply * @returns Promise that resolves when the subscriptions are updated */ updateSmsSubscriptions(operations: HackleSubscriptionOperations): Promise; /** * Updates Kakao subscription preferences * * @param operations - Subscription operations to apply * @returns Promise that resolves when the subscriptions are updated */ updateKakaoSubscriptions(operations: HackleSubscriptionOperations): Promise; /** * Resets the current user to an anonymous state * * @returns Promise that resolves when the user is reset */ resetUser(): Promise; /** * Sets the user's phone number * * @param phoneNumber - The phone number to set * @returns Promise that resolves when the phone number is set */ setPhoneNumber(phoneNumber: string): Promise; /** * Removes the user's phone number * * @returns Promise that resolves when the phone number is unset */ unsetPhoneNumber(): Promise; /** * Shows the user explorer UI for debugging * * @returns Promise that resolves when the user explorer is shown */ showUserExplorer(): Promise; /** * Hides the user explorer UI * * @returns Promise that resolves when the user explorer is hidden */ hideUserExplorer(): Promise; /** * Manually fetches the latest configuration from the server * * @returns Promise that resolves when the fetch is complete */ fetch(): Promise; /** * Checks if a command string can be invoked via bridge * * @param command - The command string to check * @returns Promise resolving to true if the command is invocable, false otherwise */ isInvocableString(command: string): Promise; /** * Invokes a command via the bridge * * @param command - The command string to invoke * @returns Promise resolving to the command result string */ bridgeInvoke(command: string): Promise; /** * Sets the in-app message listener for handling in-app message events * * @param listener - The listener to handle in-app message events, or null to remove */ setInAppMessageListener(listener: HackleInAppMessageListener | null): void; /** * Dismisses the currently displayed in-app message view. * If no in-app message view is currently displayed, this method does nothing. * * @returns Promise that resolves when the dismiss is complete */ dismissDisplayedInAppMessageView(): Promise; /** * Configures whether the back button dismisses in-app message views (Android only) * * @param dismisses - True to allow back button to dismiss, false otherwise * @returns Promise that resolves when the setting is applied */ setBackButtonDismissesInAppMessageView(dismisses: boolean): Promise; /** * Updates the current screen * * @param screen - Screen information * @returns Promise that resolves when the screen is set */ setCurrentScreen(screen: Screen): Promise; /** * Sets the opt-out tracking state * * @param optOut - True to opt out of tracking, false to opt in * @returns Promise that resolves when the setting is applied */ setOptOutTracking(optOut: boolean): Promise; /** * Gets the current opt-out tracking state * * @returns Promise resolving to true if tracking is opted out, false otherwise */ isOptOutTracking(): Promise; } /** * Implementation of HackleInAppMessageView interface * * Provides methods to control in-app message views. */ export declare class HackleInAppMessageViewImpl implements HackleInAppMessageView { private readonly client; constructor(); /** * Closes the in-app message view */ close(): void; } /** * Creates a new Hackle SDK client instance * * @param sdkKey - The SDK key provided by Hackle * @param config - Optional SDK configuration * @param user - Optional user injected when initializing the SDK * @returns A new ReactNativeSDKClient instance */ export declare function createInstance(sdkKey: string, config?: SdkConfig, user?: User): ReactNativeSDKClient; /** * Gets the device ID * * @returns The device ID string */ export declare function getDeviceId(): string; /** * Feature flag decision result * * Contains the decision result for a feature flag evaluation including activation status, reason, and parameters. */ export declare class ReactNativeFeatureFlagDecision { /** Whether the feature flag is enabled */ isOn: boolean; /** The reason for the decision */ reason: DecisionReason; /** Additional parameters associated with the decision */ readonly parameters: { [key: string]: string | number | boolean; }; constructor(isOn: boolean, reason: DecisionReason, parameters: { [key: string]: string | number | boolean; }); } /** * A/B test experiment decision result * * Contains the decision result for an A/B test experiment including variation, reason, and parameters. */ export declare class ReactNativeDecision { /** The assigned variation key (e.g., "A", "B") */ variation: VariationKey; /** The reason for the decision */ reason: DecisionReason; /** Additional parameters associated with the decision */ readonly parameters: { [key: string]: string | number | boolean; }; constructor(variation: VariationKey, reason: DecisionReason, parameters: { [key: string]: string | number | boolean; }); } /** * Implementation of HackleRemoteConfig interface * * Provides methods to retrieve remote configuration values. */ export declare class HackleRemoteConfigImpl implements HackleRemoteConfig { private readonly client; constructor(); /** * Gets a remote configuration value asynchronously * * @param key - The configuration key * @param defaultValue - The default value to return if the key is not found * @returns Promise resolving to the configuration value */ get(key: string, defaultValue: string | number | boolean): Promise; /** * Gets a remote configuration value synchronously * * @param key - The configuration key * @param defaultValue - The default value to return if the key is not found * @returns The configuration value */ getSync(key: string, defaultValue: string | number | boolean): string | number | boolean; } export {};