import * as React from 'react'; import { ReactNode } from 'react'; import { Animated, PanResponderGestureState, PanResponderInstance, StyleProp, ViewStyle, ViewProps } from 'react-native'; import * as PropTypes from 'prop-types'; import { Animation, CustomAnimation } from 'react-native-animatable'; import { Direction, Orientation, OrNull, PresentationStyle, OnOrientationChange } from './types'; export declare type OnSwipeCompleteParams = { swipingDirection: Direction; }; declare type State = { showContent: boolean; isVisible: boolean; deviceWidth: number; deviceHeight: number; isSwipeable: boolean; pan: OrNull; }; export interface ModalProps extends ViewProps { children: ReactNode; onSwipeStart?: () => void; onSwipeMove?: (percentageShown: number) => void; onSwipeComplete?: (params: OnSwipeCompleteParams) => void; onSwipeCancel?: () => void; style?: StyleProp; swipeDirection?: Direction | Array; onDismiss?: () => void; onShow?: () => void; hardwareAccelerated?: boolean; onOrientationChange?: OnOrientationChange; presentationStyle?: PresentationStyle; animationIn: Animation | CustomAnimation; animationInTiming: number; animationOut: Animation | CustomAnimation; animationOutTiming: number; avoidKeyboard: boolean; coverScreen: boolean; hasBackdrop: boolean; backdropColor: string; backdropOpacity: number; backdropTransitionInTiming: number; backdropTransitionOutTiming: number; customBackdrop: ReactNode; useNativeDriver: boolean; deviceHeight: number; deviceWidth: number; hideModalContentWhileAnimating: boolean; propagateSwipe: boolean; isVisible: boolean; onModalShow: () => void; onModalWillShow: () => void; onModalHide: () => void; onModalWillHide: () => void; onBackButtonPress: () => void; onBackdropPress: () => void; swipeThreshold: number; scrollTo: OrNull<(e: any) => void>; scrollOffset: number; scrollOffsetMax: number; scrollHorizontal: boolean; supportedOrientations?: Orientation[]; } export declare class ReactNativeModal extends React.Component { static propTypes: { animationIn: PropTypes.Requireable; animationInTiming: PropTypes.Requireable; animationOut: PropTypes.Requireable; animationOutTiming: PropTypes.Requireable; avoidKeyboard: PropTypes.Requireable; coverScreen: PropTypes.Requireable; hasBackdrop: PropTypes.Requireable; backdropColor: PropTypes.Requireable; backdropOpacity: PropTypes.Requireable; backdropTransitionInTiming: PropTypes.Requireable; backdropTransitionOutTiming: PropTypes.Requireable; customBackdrop: PropTypes.Requireable; children: PropTypes.Validator; deviceHeight: PropTypes.Requireable; deviceWidth: PropTypes.Requireable; isVisible: PropTypes.Validator; hideModalContentWhileAnimating: PropTypes.Requireable; propagateSwipe: PropTypes.Requireable; onModalShow: PropTypes.Requireable<(...args: any[]) => any>; onModalWillShow: PropTypes.Requireable<(...args: any[]) => any>; onModalHide: PropTypes.Requireable<(...args: any[]) => any>; onModalWillHide: PropTypes.Requireable<(...args: any[]) => any>; onBackButtonPress: PropTypes.Requireable<(...args: any[]) => any>; onBackdropPress: PropTypes.Requireable<(...args: any[]) => any>; onSwipeStart: PropTypes.Requireable<(...args: any[]) => any>; onSwipeMove: PropTypes.Requireable<(...args: any[]) => any>; onSwipeComplete: PropTypes.Requireable<(...args: any[]) => any>; onSwipeCancel: PropTypes.Requireable<(...args: any[]) => any>; swipeThreshold: PropTypes.Requireable; swipeDirection: PropTypes.Requireable; useNativeDriver: PropTypes.Requireable; style: PropTypes.Requireable; scrollTo: PropTypes.Requireable<(...args: any[]) => any>; scrollOffset: PropTypes.Requireable; scrollOffsetMax: PropTypes.Requireable; scrollHorizontal: PropTypes.Requireable; supportedOrientations: PropTypes.Requireable<(string | null | undefined)[]>; }; static defaultProps: { animationIn: string; animationInTiming: number; animationOut: string; animationOutTiming: number; avoidKeyboard: boolean; coverScreen: boolean; hasBackdrop: boolean; backdropColor: string; backdropOpacity: number; backdropTransitionInTiming: number; backdropTransitionOutTiming: number; customBackdrop: null; useNativeDriver: boolean; deviceHeight: null; deviceWidth: null; hideModalContentWhileAnimating: boolean; propagateSwipe: boolean; isVisible: boolean; onModalShow: () => null; onModalWillShow: () => null; onModalHide: () => null; onModalWillHide: () => null; onBackdropPress: () => null; onBackButtonPress: () => null; swipeThreshold: number; scrollTo: null; scrollOffset: number; scrollOffsetMax: number; scrollHorizontal: boolean; supportedOrientations: string[]; }; state: State; isTransitioning: boolean; inSwipeClosingState: boolean; currentSwipingDirection: OrNull; animationIn: string; animationOut: string; backdropRef: any; contentRef: any; panResponder: OrNull; constructor(props: ModalProps); static getDerivedStateFromProps(nextProps: ModalProps, state: State): { isVisible: boolean; showContent: boolean; } | null; componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: ModalProps): void; buildPanResponder: () => void; getAccDistancePerDirection: (gestureState: PanResponderGestureState) => number; getSwipingDirection: (gestureState: PanResponderGestureState) => "left" | "right" | "up" | "down"; calcDistancePercentage: (gestureState: PanResponderGestureState) => number; createAnimationEventForSwipe: () => (...args: any[]) => void; isDirectionIncluded: (direction: Direction) => boolean; isSwipeDirectionAllowed: ({ dy, dx }: PanResponderGestureState) => boolean; handleDimensionsUpdate: () => void; open: () => void; close: () => void; render(): JSX.Element; } export default ReactNativeModal;