import { EventSubscription } from 'react-native'; import { TaplyticsUserAttributes, TaplyticsSessionInfo } from './user.types'; /** * Use this function to manually force a new user session. * */ export declare const startNewSession: () => Promise; /** * This function is used to retrieve select information about a session at a given time. * * @returns A promise that resolves to an object of with `appUser_id` and `session_id` properties. */ export declare const getSessionInfo: () => Promise; /** * Use this listener to ensure that all the properties have been loaded from the server * prior to utilizing feature flags and experiment variable values. The listener returns * back an event subscriber that can be used to cleanup the event listener using the `remove` function. * * On iOS this listener is triggered in the following situations: * - Properties have been loaded on app start. * - A new session is generated by the SDK, or when explicitly started using the `startNewSession` method. * - A user's `email` or `user_id` fields are updated using the `setUserAttribute` method. * * On Android this listener is triggered in the following situations: * - A new session is generated by the SDK, or when explicitly started using the `startNewSession` method. * - A user's `email` or `user_id` fields are updated using the `setUserAttribute` method. * * *NOTE:* This listener does not trigger on app start for `android` devices. * * @param callback A function that gets executed when a new session is created. * * @returns On `ios` and `android` devices an event subscriber object is returned. * Use the `remove` function to clean up the event listener. */ export declare const setTaplyticsNewSessionListener: (callback: (loaded: boolean) => void) => EventSubscription | undefined; /** * Use this function to segment your users based on custom user attributes. * Ensure that either the `user_id` or `email` is unique to identify the user across multiple device. * * @param attributes An object of type `TaplyticsUserAttributes`. * */ export declare const setUserAttributes: (attributes: TaplyticsUserAttributes) => Promise; /** * Once a user logs out of your app, their User Attributes are no longer valid. * You can reset their data by calling this function. * Make sure you do not set any new user attributes until the promise resolves. * */ export declare const resetAppUser: () => Promise; /** * Use this function to log custom events. * * @param eventName The name of the event. * @param value A numerical value associated with the event. This is an optional parameter, * if no value is passed it is initialized to 0. * @param customAttributes A custom object that gets associated with the event. This is an * optional parameter, if no value is passed it is initialized with an empty object. */ export declare const logEvent: (eventName: string, value?: number, customAttributes?: object) => void; /** * Use this function to log revenue. * * @param eventName The name of the revenue event. * @param value A numerical value associated with the revenue event. This is an optional parameter, * if no value is passed it is initialized to 0. * @param customAttributes A custom object that gets associated with the revenue event. This is an * optional parameter, if no value is passed it is initialized with an empty object. */ export declare const logRevenue: (eventName: string, value?: number, customAttributes?: object) => void;