-
-
Notifications
You must be signed in to change notification settings - Fork 644
Expand file tree
/
Copy pathScreenNativeComponent.ts
More file actions
134 lines (119 loc) · 4.57 KB
/
ScreenNativeComponent.ts
File metadata and controls
134 lines (119 loc) · 4.57 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
'use client';
import { codegenNativeComponent } from 'react-native';
import type { CodegenTypes as CT, ViewProps, ColorValue } from 'react-native';
// eslint-disable-next-line @typescript-eslint/ban-types
type ScreenEvent = Readonly<{}>;
type ScreenDismissedEvent = Readonly<{
dismissCount: CT.Int32;
}>;
type TransitionProgressEvent = Readonly<{
progress: CT.Double;
closing: CT.Int32;
goingForward: CT.Int32;
}>;
type HeaderHeightChangeEvent = Readonly<{
headerHeight: CT.Double;
}>;
type SheetDetentChangedEvent = Readonly<{
index: CT.Int32;
isStable: boolean;
}>;
type GestureResponseDistanceType = Readonly<{
start: CT.Float;
end: CT.Float;
top: CT.Float;
bottom: CT.Float;
}>;
type StackPresentation =
| 'push'
| 'modal'
| 'transparentModal'
| 'fullScreenModal'
| 'formSheet'
| 'pageSheet'
| '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';
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
type OptionalBoolean = 'undefined' | 'false' | 'true';
export interface NativeProps extends ViewProps {
onAppear?: CT.DirectEventHandler<ScreenEvent> | undefined;
onDisappear?: CT.DirectEventHandler<ScreenEvent> | undefined;
onDismissed?: CT.DirectEventHandler<ScreenDismissedEvent> | undefined;
onNativeDismissCancelled?:
| CT.DirectEventHandler<ScreenDismissedEvent>
| undefined;
onWillAppear?: CT.DirectEventHandler<ScreenEvent> | undefined;
onWillDisappear?: CT.DirectEventHandler<ScreenEvent> | undefined;
onHeaderHeightChange?:
| CT.DirectEventHandler<HeaderHeightChangeEvent>
| undefined;
onTransitionProgress?:
| CT.DirectEventHandler<TransitionProgressEvent>
| undefined;
onGestureCancel?: CT.DirectEventHandler<ScreenEvent> | undefined;
onHeaderBackButtonClicked?: CT.DirectEventHandler<ScreenEvent> | undefined;
onSheetDetentChanged?:
| CT.DirectEventHandler<SheetDetentChangedEvent>
| undefined;
screenId?: CT.WithDefault<string, ''>;
sheetAllowedDetents?: number[] | undefined;
sheetLargestUndimmedDetent?: CT.WithDefault<CT.Int32, -1>;
sheetGrabberVisible?: CT.WithDefault<boolean, false>;
sheetCornerRadius?: CT.WithDefault<CT.Float, -1.0>;
sheetExpandsWhenScrolledToEdge?: CT.WithDefault<boolean, false>;
sheetInitialDetent?: CT.WithDefault<CT.Int32, 0>;
sheetElevation?: CT.WithDefault<CT.Int32, 24>;
sheetShouldOverflowTopInset?: CT.WithDefault<boolean, false>;
sheetDefaultResizeAnimationEnabled?: CT.WithDefault<boolean, true>;
customAnimationOnSwipe?: boolean | undefined;
fullScreenSwipeEnabled?: CT.WithDefault<OptionalBoolean, 'undefined'>;
fullScreenSwipeShadowEnabled?: CT.WithDefault<boolean, true>;
homeIndicatorHidden?: boolean | undefined;
preventNativeDismiss?: boolean | undefined;
gestureEnabled?: CT.WithDefault<boolean, true>;
statusBarColor?: ColorValue | undefined;
statusBarHidden?: boolean | undefined;
screenOrientation?: string | undefined;
statusBarAnimation?: string | undefined;
statusBarStyle?: string | undefined;
statusBarTranslucent?: boolean | undefined;
gestureResponseDistance?: GestureResponseDistanceType | undefined;
stackPresentation?: CT.WithDefault<StackPresentation, 'push'>;
stackAnimation?: CT.WithDefault<StackAnimation, 'default'>;
transitionDuration?: CT.WithDefault<CT.Int32, 500>;
replaceAnimation?: CT.WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: CT.WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean | undefined;
activityState?: CT.WithDefault<CT.Float, -1.0>;
navigationBarColor?: ColorValue | undefined;
navigationBarTranslucent?: boolean | undefined;
navigationBarHidden?: boolean | undefined;
nativeBackButtonDismissalEnabled?: boolean | undefined;
bottomScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>;
leftScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>;
rightScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>;
topScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>;
synchronousShadowStateUpdatesEnabled?: CT.WithDefault<boolean, true>;
androidResetScreenShadowStateOnOrientationChangeEnabled?: CT.WithDefault<
boolean,
true
>;
ios26AllowInteractionsDuringTransition?: CT.WithDefault<boolean, true>;
}
export default codegenNativeComponent<NativeProps>('RNSScreen', {
interfaceOnly: true,
});