UNPKG

react-native-adapty

Version:
35 lines 1.18 kB
import type { EmitterSubscription } from 'react-native'; import type { AdaptyProfile } from '../types'; export type ParamKey = (typeof ParamKeys)[number]; export type MethodName = (typeof MethodNames)[number]; /** * Types of values that can be passed * to the bridge without corruption */ export type Serializable = string | number | boolean | string[] | null | undefined; /** * Interface of error that emit from native SDK */ export interface AdaptyNativeError { adaptyCode: number; message: string; detail?: string | undefined; } /** * Interface of error that was raised by native bridge */ export interface AdaptyBridgeError { errorType: string; name?: string; type?: string; underlyingError?: string; description?: string; } interface EventMap { onLatestProfileLoad: string; } type UserEventName = keyof EventMap; export type AddListenerGeneric<E extends UserEventName, Data> = (event: E, callback: (data: Data) => void | Promise<void>) => EmitterSubscription; export type AddListenerFn = AddListenerGeneric<'onLatestProfileLoad', AdaptyProfile>; export {}; //# sourceMappingURL=bridge.d.ts.map