UNPKG

2.55 kBTypeScriptView Raw
1import * as React from 'react';
2import { Animated, StyleProp, ViewProps, ViewStyle } from 'react-native';
3import type { EdgeInsets } from 'react-native-safe-area-context';
4import type { GestureDirection, Layout, StackCardStyleInterpolator, TransitionSpec } from '../../types';
5declare type Props = ViewProps & {
6 interpolationIndex: number;
7 closing: boolean;
8 next?: Animated.AnimatedInterpolation;
9 current: Animated.AnimatedInterpolation;
10 gesture: Animated.Value;
11 layout: Layout;
12 insets: EdgeInsets;
13 headerDarkContent: boolean | undefined;
14 pageOverflowEnabled: boolean;
15 gestureDirection: GestureDirection;
16 onOpen: () => void;
17 onClose: () => void;
18 onTransition: (props: {
19 closing: boolean;
20 gesture: boolean;
21 }) => void;
22 onGestureBegin: () => void;
23 onGestureCanceled: () => void;
24 onGestureEnd: () => void;
25 children: React.ReactNode;
26 overlay: (props: {
27 style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
28 }) => React.ReactNode;
29 overlayEnabled: boolean;
30 shadowEnabled: boolean;
31 gestureEnabled: boolean;
32 gestureResponseDistance?: number;
33 gestureVelocityImpact: number;
34 transitionSpec: {
35 open: TransitionSpec;
36 close: TransitionSpec;
37 };
38 styleInterpolator: StackCardStyleInterpolator;
39 containerStyle?: StyleProp<ViewStyle>;
40 contentStyle?: StyleProp<ViewStyle>;
41};
42export default class Card extends React.Component<Props> {
43 static defaultProps: {
44 shadowEnabled: boolean;
45 gestureEnabled: boolean;
46 gestureVelocityImpact: number;
47 overlay: ({ style, }: {
48 style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
49 }) => JSX.Element | null;
50 };
51 componentDidMount(): void;
52 componentDidUpdate(prevProps: Props): void;
53 componentWillUnmount(): void;
54 private isCurrentlyMounted;
55 private isClosing;
56 private inverted;
57 private layout;
58 private isSwiping;
59 private interactionHandle;
60 private pendingGestureCallback;
61 private lastToValue;
62 private animate;
63 private getAnimateToValue;
64 private setPointerEventsEnabled;
65 private handleStartInteraction;
66 private handleEndInteraction;
67 private handleGestureStateChange;
68 private getInterpolatedStyle;
69 private getCardAnimation;
70 private gestureActivationCriteria;
71 private contentRef;
72 render(): JSX.Element;
73}
74export declare const getIsModalPresentation: (cardStyleInterpolator: StackCardStyleInterpolator) => boolean;
75export {};