///
import { Animated, LayoutChangeEvent, TextStyle, ViewStyle } from 'react-native';
import { ButtonProps } from './Button';
import { BaseModal } from './ModalCenter';
import BaseComponent from '../BaseComponent';
import { ThemeVars } from '../../modules/theme/ThemeBuilder';
import EndCallback = Animated.EndCallback;
export interface Modal extends BaseModal {
title?: string | JSX.Element;
containerStyle?: ViewStyle;
body?: string | JSX.Element;
autoDismiss?: number;
actions?: ModalAction[];
}
export interface ConfirmModal extends Modal {
onSuccess: () => void;
onCancel: () => void;
title?: string | JSX.Element;
actionConfirm?: string;
actionCancel?: string;
}
export interface ModalAction extends ButtonProps {
title: string;
onPress: () => void;
}
export interface ModalItemProps {
item: Modal | ConfirmModal;
onHide: () => void;
}
export interface State {
top: Animated.Value;
fade: Animated.Value;
itemHeight: number;
}
export default class ModalItem extends BaseComponent {
state: {
top: Animated.Value;
fade: Animated.Value;
itemHeight: number;
};
private animation;
private timeoutDismiss;
onLayout(event: LayoutChangeEvent): void;
show(): void;
hide(cb: EndCallback): void;
componentDidMount(): void;
componentWillUnmount(): void;
autoDismissSetup(): void;
componentDidUpdate(prevProps: ModalItemProps, prevState: State): void;
render(): JSX.Element;
loadStyles(theme: ThemeVars): {
container: ViewStyle;
backdrop: ViewStyle;
content: ViewStyle;
title: TextStyle;
header: ViewStyle;
body: ViewStyle;
bodyText: TextStyle;
footer: ViewStyle;
};
}