import * as React from 'react'; import { Animated, EmitterSubscription, PanResponderGestureState, PanResponderInstance, StyleProp, ViewStyle, ViewProps } from 'react-native'; import * as PropTypes from 'prop-types'; import * as animatable from 'react-native-animatable'; import type { Direction, Orientation, OrNull, PresentationStyle, OnOrientationChange, GestureResponderEvent } from './modal.types'; export type OnSwipeCompleteParams = { swipingDirection: Direction; }; type State = { showContent: boolean; isVisible: boolean; deviceWidth: number; deviceHeight: number; isSwipeable: boolean; pan: OrNull; }; declare const defaultProps: { animationIn: animatable.Animation | animatable.CustomAnimation; animationInTiming: number; animationOut: animatable.Animation | animatable.CustomAnimation; animationOutTiming: number; avoidKeyboard: boolean; coverScreen: boolean; hasBackdrop: boolean; backdropColor: string; backdropOpacity: number; backdropTransitionInTiming: number; backdropTransitionOutTiming: number; customBackdrop: React.ReactNode; useNativeDriver: boolean; deviceHeight: OrNull; deviceWidth: OrNull; hideModalContentWhileAnimating: boolean; propagateSwipe: boolean | ((event: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean); isVisible: boolean; panResponderThreshold: number; swipeThreshold: number; onModalShow: () => void; onModalWillShow: () => void; onModalHide: () => void; onModalWillHide: () => void; onBackdropPress: () => void; onBackButtonPress: () => void; scrollTo: OrNull<(e: any) => void>; scrollOffset: number; scrollOffsetMax: number; scrollHorizontal: boolean; statusBarTranslucent: boolean; supportedOrientations: Orientation[]; }; export type ModalProps = ViewProps & { children: React.ReactNode; onSwipeStart?: (gestureState: PanResponderGestureState) => void; onSwipeMove?: (percentageShown: number, gestureState: PanResponderGestureState) => void; onSwipeComplete?: (params: OnSwipeCompleteParams, gestureState: PanResponderGestureState) => void; onSwipeCancel?: (gestureState: PanResponderGestureState) => void; style?: StyleProp; swipeDirection?: Direction | Array; onDismiss?: () => void; onShow?: () => void; hardwareAccelerated?: boolean; onOrientationChange?: OnOrientationChange; presentationStyle?: PresentationStyle; useNativeDriverForBackdrop?: boolean; title?: string; showClose?: boolean; showIcon?: (height: number, width: number) => React.ReactNode; iconSize?: 'normal' | 'large'; isLoading?: boolean; onClose?: () => void; primaryAction?: string; primaryActionHandler?: () => void; secondaryAction?: string; secondaryActionHandler?: () => void; } & typeof defaultProps; 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 any) | null | undefined>>; 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>; panResponderThreshold: PropTypes.Requireable; 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; useNativeDriverForBackdrop: 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: animatable.Animation | animatable.CustomAnimation; animationInTiming: number; animationOut: animatable.Animation | animatable.CustomAnimation; animationOutTiming: number; avoidKeyboard: boolean; coverScreen: boolean; hasBackdrop: boolean; backdropColor: string; backdropOpacity: number; backdropTransitionInTiming: number; backdropTransitionOutTiming: number; customBackdrop: React.ReactNode; useNativeDriver: boolean; deviceHeight: OrNull; deviceWidth: OrNull; hideModalContentWhileAnimating: boolean; propagateSwipe: boolean | ((event: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean); isVisible: boolean; panResponderThreshold: number; swipeThreshold: number; onModalShow: () => void; onModalWillShow: () => void; onModalHide: () => void; onModalWillHide: () => void; onBackdropPress: () => void; onBackButtonPress: () => void; scrollTo: OrNull<(e: any) => void>; scrollOffset: number; scrollOffsetMax: number; scrollHorizontal: boolean; statusBarTranslucent: boolean; supportedOrientations: Orientation[]; }; state: State; isTransitioning: boolean; inSwipeClosingState: boolean; currentSwipingDirection: OrNull; animationIn: string; animationOut: string; backdropRef: any; contentRef: any; panResponder: OrNull; didUpdateDimensionsEmitter: OrNull; interactionHandle: OrNull; constructor(props: ModalProps); static getDerivedStateFromProps(nextProps: Readonly, state: State): { isVisible: boolean; showContent: boolean; } | null; componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: ModalProps): void; getDeviceHeight: () => number; getDeviceWidth: () => number; onBackButtonPress: () => boolean; shouldPropagateSwipe: (evt: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean; 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; makeBackdrop: () => JSX.Element | null; render(): JSX.Element; } export default ReactNativeModal;