1 | import type { ParamListBase, Route, StackNavigationState } from '@react-navigation/native';
|
2 | import * as React from 'react';
|
3 | import { Animated } from 'react-native';
|
4 | import type { EdgeInsets } from 'react-native-safe-area-context';
|
5 | import type { Layout, Scene, StackDescriptorMap } from '../../types';
|
6 | import type { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
7 | declare type GestureValues = {
|
8 | [key: string]: Animated.Value;
|
9 | };
|
10 | declare type Props = {
|
11 | insets: EdgeInsets;
|
12 | state: StackNavigationState<ParamListBase>;
|
13 | descriptors: StackDescriptorMap;
|
14 | routes: Route<string>[];
|
15 | openingRouteKeys: string[];
|
16 | closingRouteKeys: string[];
|
17 | onOpenRoute: (props: {
|
18 | route: Route<string>;
|
19 | }) => void;
|
20 | onCloseRoute: (props: {
|
21 | route: Route<string>;
|
22 | }) => void;
|
23 | getPreviousRoute: (props: {
|
24 | route: Route<string>;
|
25 | }) => Route<string> | undefined;
|
26 | renderHeader: (props: HeaderContainerProps) => React.ReactNode;
|
27 | renderScene: (props: {
|
28 | route: Route<string>;
|
29 | }) => React.ReactNode;
|
30 | isParentHeaderShown: boolean;
|
31 | isParentModal: boolean;
|
32 | onTransitionStart: (props: {
|
33 | route: Route<string>;
|
34 | }, closing: boolean) => void;
|
35 | onTransitionEnd: (props: {
|
36 | route: Route<string>;
|
37 | }, closing: boolean) => void;
|
38 | onGestureStart: (props: {
|
39 | route: Route<string>;
|
40 | }) => void;
|
41 | onGestureEnd: (props: {
|
42 | route: Route<string>;
|
43 | }) => void;
|
44 | onGestureCancel: (props: {
|
45 | route: Route<string>;
|
46 | }) => void;
|
47 | detachInactiveScreens?: boolean;
|
48 | };
|
49 | declare type State = {
|
50 | routes: Route<string>[];
|
51 | descriptors: StackDescriptorMap;
|
52 | scenes: Scene[];
|
53 | gestures: GestureValues;
|
54 | layout: Layout;
|
55 | headerHeights: Record<string, number>;
|
56 | };
|
57 | export default class CardStack extends React.Component<Props, State> {
|
58 | static getDerivedStateFromProps(props: Props, state: State): Partial<State> | null;
|
59 | constructor(props: Props);
|
60 | private handleLayout;
|
61 | private handleHeaderLayout;
|
62 | private getFocusedRoute;
|
63 | private getPreviousScene;
|
64 | render(): JSX.Element;
|
65 | }
|
66 | export {};
|