-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
46 lines (37 loc) · 1.1 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import type React from 'react'
import type { Animated } from 'react-native'
export type AnimationHandler = (state: State, done: () => void, reverse?: boolean) => (() => void) | null
export type Animation = {
backdrop?: boolean
animation: AnimationHandler
}
export enum Transition {
regular = 'regular',
slow = 'slow',
fast = 'fast',
none = 'none',
opacity = 'opacity',
modal = 'modal',
peek = 'peek',
}
export type TransitionString = 'regular' | 'slow' | 'fast' | 'none' | 'opacity' | 'modal' | 'peek'
export type TransitionInput = Transition | TransitionString | Animation
export type Screen = {
name: string
Component: React.JSX.Element
transition: TransitionInput
background: string
props?: Object
}
export type ScreenProps = { backPossible: boolean; title: string }
export type Props = ScreenProps & { [key: string]: any }
export type State = {
top: Animated.Value
left: Animated.Value
opacity: Animated.Value
backdrop?: boolean
Top: Screen
Bottom?: Screen
reverse?: boolean
renderedScreens: { [key: string]: { screen: Screen; props: Props; view?: React.JSX.Element } }
}