export declare type AlertTypes = 'success' | 'danger' | 'warning' | 'action'; export interface ReplaceToastOptions { /** * Id is optional, you may provide an id only if you want to update alert later using alert.update() */ id?: string; /** * In ms, How long alert will stay before it go away */ duration?: number; /** * Customize when alert should be placed */ placement?: 'top' | 'bottom'; /** * Customize how fast alert will show and hide */ animationDuration?: number; /** * Customize how alert is animated when added or removed */ animationType?: 'slide-in' | 'zoom-in'; /** * Register event for when alert is pressed. If you're using a custom alert you have to pass this to a Touchable. */ onPress?(id: string): void; /** * Execute event after alert is closed */ onClose?(): void; /** * Payload data for custom alerts. You can pass whatever you want */ data?: any; swipeEnabled?: boolean; } interface IAlertTopWithIcon extends ReplaceToastOptions { type?: never; /** * Customize alert icon - NOT enabled to use with type */ icon?: JSX.Element; } interface IAlertTopWithType extends ReplaceToastOptions { icon?: never; /** * Alert types, You can use default types. NOT enabled to use with icon */ type?: AlertTypes; } export declare type AlertOptions = IAlertTopWithIcon | IAlertTopWithType; export interface IAlertTop { /** * Shows a new alert. Returns id */ show: (message: string | JSX.Element, toastOptions?: AlertOptions | undefined) => string; /** * Updates a alerts, To use this create you must pass an id to show method first, then pass it here to update the alert. */ update: (id: string, message: string | JSX.Element, toastOptions?: AlertOptions | undefined) => void; /** * Removes a alert from stack */ hide: (id: string) => void; /** * Removes all alerts in stack */ hideAll: () => void; } export {};