react-native-swipe-up-panel
Version:
Swipeable bottom panel for react native
58 lines (57 loc) • 1.8 kB
TypeScript
import * as React from 'react';
import { Animated, PanResponderInstance, ScrollViewProps } from 'react-native';
export declare enum STATUS {
CLOSED = 0,
SMALL = 1,
LARGE = 2
}
interface SwipeablePanelProps {
isActive: boolean;
canClose?: boolean;
onClose?: () => void;
showCloseButton?: boolean;
fullWidth?: boolean;
noBackgroundOpacity?: boolean;
style?: object;
closeRootStyle?: object;
closeIconStyle?: object;
closeOnTouchOutside?: boolean;
onlyLarge?: boolean;
onlySmall?: boolean;
openLarge?: boolean;
noBar?: boolean;
barStyle?: object;
allowTouchOutside?: boolean;
scrollViewProps?: ScrollViewProps;
smallPanelHeight?: number;
largePanelHeight?: number;
onChangeStatus?: (status: STATUS) => void;
}
interface SwipeablePanelState {
status: STATUS;
isActive: boolean;
showComponent: boolean;
canScroll: boolean;
opacity: Animated.Value;
pan: Animated.ValueXY;
orientation: 'portrait' | 'landscape';
deviceWidth: number;
deviceHeight: number;
panelHeight: number;
currentHeight: number;
}
declare class SwipeablePanel extends React.Component<SwipeablePanelProps, SwipeablePanelState> {
pan: Animated.ValueXY;
isClosing: boolean;
_panResponder: PanResponderInstance;
animatedValueY: number;
SMALL_PANEL_CONTENT_HEIGHT: number;
LARGE_PANEL_CONTENT_HEIGHT: number;
constructor(props: SwipeablePanelProps);
componentDidMount: () => void;
_onOrientationChange: () => void;
componentDidUpdate(prevProps: SwipeablePanelProps, prevState: SwipeablePanelState): void;
_animateTo: (newStatus?: number) => void;
render(): JSX.Element | null;
}
export { SwipeablePanel };