-
-
Notifications
You must be signed in to change notification settings - Fork 514
/
ScreenNativeComponent.ts
115 lines (102 loc) · 3.36 KB
/
ScreenNativeComponent.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
'use client';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
DirectEventHandler,
WithDefault,
Int32,
Float,
Double,
} from 'react-native/Libraries/Types/CodegenTypes';
// eslint-disable-next-line @typescript-eslint/ban-types
type ScreenEvent = Readonly<{}>;
type ScreenDismissedEvent = Readonly<{
dismissCount: Int32;
}>;
type TransitionProgressEvent = Readonly<{
progress: Double;
closing: Int32;
goingForward: Int32;
}>;
type HeaderHeightChangeEvent = Readonly<{
headerHeight: Double;
}>;
type SheetDetentChangedEvent = Readonly<{
index: Int32;
isStable: boolean;
}>;
type GestureResponseDistanceType = Readonly<{
start: Float;
end: Float;
top: Float;
bottom: Float;
}>;
type StackPresentation =
| 'push'
| 'modal'
| 'transparentModal'
| 'fullScreenModal'
| 'formSheet'
| 'containedModal'
| 'containedTransparentModal';
type StackAnimation =
| 'default'
| 'flip'
| 'simple_push'
| 'none'
| 'fade'
| 'slide_from_right'
| 'slide_from_left'
| 'slide_from_bottom'
| 'fade_from_bottom'
| 'ios_from_right'
| 'ios_from_left';
type SwipeDirection = 'vertical' | 'horizontal';
type ReplaceAnimation = 'pop' | 'push';
export interface NativeProps extends ViewProps {
onAppear?: DirectEventHandler<ScreenEvent>;
onDisappear?: DirectEventHandler<ScreenEvent>;
onDismissed?: DirectEventHandler<ScreenDismissedEvent>;
onNativeDismissCancelled?: DirectEventHandler<ScreenDismissedEvent>;
onWillAppear?: DirectEventHandler<ScreenEvent>;
onWillDisappear?: DirectEventHandler<ScreenEvent>;
onHeaderHeightChange?: DirectEventHandler<HeaderHeightChangeEvent>;
onTransitionProgress?: DirectEventHandler<TransitionProgressEvent>;
onGestureCancel?: DirectEventHandler<ScreenEvent>;
onHeaderBackButtonClicked?: DirectEventHandler<ScreenEvent>;
onSheetDetentChanged?: DirectEventHandler<SheetDetentChangedEvent>;
sheetAllowedDetents?: number[];
sheetLargestUndimmedDetent?: WithDefault<Int32, -1>;
sheetGrabberVisible?: WithDefault<boolean, false>;
sheetCornerRadius?: WithDefault<Float, -1.0>;
sheetExpandsWhenScrolledToEdge?: WithDefault<boolean, false>;
sheetInitialDetent?: WithDefault<Int32, 0>;
sheetElevation?: WithDefault<Int32, 24>;
customAnimationOnSwipe?: boolean;
fullScreenSwipeEnabled?: boolean;
fullScreenSwipeShadowEnabled?: boolean;
homeIndicatorHidden?: boolean;
preventNativeDismiss?: boolean;
gestureEnabled?: WithDefault<boolean, true>;
statusBarColor?: ColorValue;
statusBarHidden?: boolean;
screenOrientation?: string;
statusBarAnimation?: string;
statusBarStyle?: string;
statusBarTranslucent?: boolean;
gestureResponseDistance?: GestureResponseDistanceType;
stackPresentation?: WithDefault<StackPresentation, 'push'>;
stackAnimation?: WithDefault<StackAnimation, 'default'>;
transitionDuration?: WithDefault<Int32, 350>;
replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean;
activityState?: WithDefault<Float, -1.0>;
navigationBarColor?: ColorValue;
navigationBarTranslucent?: boolean;
navigationBarHidden?: boolean;
nativeBackButtonDismissalEnabled?: boolean;
}
export default codegenNativeComponent<NativeProps>('RNSScreen', {
interfaceOnly: true,
});