UNPKG

@applicaster/zapp-react-native-utils

Version:

Applicaster Zapp React Native utilities package

161 lines (134 loc) 3.89 kB
declare module "@applicaster/zapp-react-native-utils"; declare enum AD_EVENT { ad_break_start = "player_ad_break_start", ad_break_completed = "player_ad_break_complete", ad_start = "player_ad_start", ad_skip = "player_ad_skip", ad_complete = "player_ad_complete", ad_error = "player_ad_error", ad_request = "player_ad_request", ad_clicked = "player_ad_clicked", } declare enum GENERAL_EVENT { player_presented = "player_presented", player_closed = "player_closed", session_end = "player_session_end", session_start = "player_session_start", } declare enum PLAYBACK_EVENT { play = "player_play", pause = "player_pause", complete = "player_complete", error = "player_error", buffer_start = "player_buffer_start", buffer_complete = "player_buffer_complete", seek_start = "player_seek_start", seek_complete = "player_seek_complete", stop = "player_stop", next = "player_next", previous = "previous", } declare type DataManager = { saveItem: () => Promise<ZappEntry[]>; removeItem: () => Promise<ZappEntry[]>; loadData: () => Promise<ZappEntry[]>; }; declare type StorageCommand = { execute: () => Promise<any>; }; declare type AnalyticsScreenProperties = { screen_name: string; screen_entry_title: string; screen_entry_id: string; screen_layout_id: string; screen_type: string; home_screen: boolean; }; declare type AnalyticsDefaultProperties = { analyticsScreenData: AnalyticsScreenProperties; extraProps: any; }; declare type AnalyticsEventHookProperties = { sendAnalyticsFunction: (props: AnalyticsDefaultProperties) => void; extraProps: any; }; declare type ExtraProps = ZappUIComponentProps & { item: ZappEntry; index: number; selected: boolean; screenData: ZappRiver; }; declare type WebConfirmationDialog = { message: string; confirmCompletion?: () => void; cancelCompletion?: () => void; }; declare type ConfirmationDialog = WebConfirmationDialog & { title: string; okButtonText?: string; cancelButtonText?: string; }; declare type CustomConfirmationDialog = ConfirmationDialog & {}; declare type AlertWebDialog = { message: string; completion?: () => void; }; declare type AlertDialogType = AlertWebDialog & { title: string; okButtonText: string; }; // Zapp-Frameworks-Utils declare interface NavigationController { back: () => void; close: () => void; canGoBack: () => boolean; } declare type NavBarState = { backHandler?: () => void; closeHandler?: () => void; title: string; }; declare type StorageValuesToAdd = Record<string, NamespaceValues>; declare type StorageValuesToRemove = { string?: string[]; }; declare type StorageOwnedValues = { string?: string[]; }; declare type NamespaceValues = Record<string, string>; declare type RefreshProps = { forceRefresh?: boolean; }; declare interface LoginProtocol { isLoggedIn(): Promise<boolean>; refresh(props?: RefreshProps): Promise<void>; // Refresh must throw exception with a reason logout(): Promise<void>; // Logout must throw exception with a reason deleteAccount?(): Promise<void>; // Delete Account must throw exception with a reason canDeleteAccount?(): boolean; // Check if application able to delete account startLoginFlow?(): Promise<void>; // Not implemented } declare type DataSource = { source: string; mapper?: string; }; declare type BuilderData = { dataSource: DataSource; bodyParams?: Record<string, unknown>; headers?: Record<string, unknown>; entry?: ZappEntry; river?: ZappRiver; method?: string; }; declare type AccessibilityState = { screenReaderEnabled: boolean; reduceMotionEnabled: boolean; boldTextEnabled: boolean; }; declare type AccessibilityProps = { accessibilityLabel?: string; accessibilityHint?: string; "aria-label"?: string; "aria-description"?: string; accessibilityRole?: string; "aria-role"?: string; };