|
1 | 1 | 'use client'; |
2 | 2 |
|
3 | | -// eslint-disable-next-line @react-native/no-deep-imports |
4 | | -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; |
5 | | -import type { ViewProps, ColorValue } from 'react-native'; |
6 | | -import type { |
7 | | - DirectEventHandler, |
8 | | - WithDefault, |
9 | | - Int32, |
10 | | - Float, |
11 | | - Double, |
12 | | -} from 'react-native/Libraries/Types/CodegenTypes'; |
| 3 | +import { codegenNativeComponent } from 'react-native'; |
| 4 | +import type { CodegenTypes as CT, ViewProps, ColorValue } from 'react-native'; |
13 | 5 |
|
14 | 6 | // eslint-disable-next-line @typescript-eslint/ban-types |
15 | 7 | type ScreenEvent = Readonly<{}>; |
16 | 8 |
|
17 | 9 | type ScreenDismissedEvent = Readonly<{ |
18 | | - dismissCount: Int32; |
| 10 | + dismissCount: CT.Int32; |
19 | 11 | }>; |
20 | 12 |
|
21 | 13 | type TransitionProgressEvent = Readonly<{ |
22 | | - progress: Double; |
23 | | - closing: Int32; |
24 | | - goingForward: Int32; |
| 14 | + progress: CT.Double; |
| 15 | + closing: CT.Int32; |
| 16 | + goingForward: CT.Int32; |
25 | 17 | }>; |
26 | 18 |
|
27 | 19 | type HeaderHeightChangeEvent = Readonly<{ |
28 | | - headerHeight: Double; |
| 20 | + headerHeight: CT.Double; |
29 | 21 | }>; |
30 | 22 |
|
31 | 23 | type SheetDetentChangedEvent = Readonly<{ |
32 | | - index: Int32; |
| 24 | + index: CT.Int32; |
33 | 25 | isStable: boolean; |
34 | 26 | }>; |
35 | 27 |
|
36 | 28 | type GestureResponseDistanceType = Readonly<{ |
37 | | - start: Float; |
38 | | - end: Float; |
39 | | - top: Float; |
40 | | - bottom: Float; |
| 29 | + start: CT.Float; |
| 30 | + end: CT.Float; |
| 31 | + top: CT.Float; |
| 32 | + bottom: CT.Float; |
41 | 33 | }>; |
42 | 34 |
|
43 | 35 | type StackPresentation = |
@@ -72,56 +64,56 @@ type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden'; |
72 | 64 | type OptionalBoolean = 'undefined' | 'false' | 'true'; |
73 | 65 |
|
74 | 66 | export interface NativeProps extends ViewProps { |
75 | | - onAppear?: DirectEventHandler<ScreenEvent>; |
76 | | - onDisappear?: DirectEventHandler<ScreenEvent>; |
77 | | - onDismissed?: DirectEventHandler<ScreenDismissedEvent>; |
78 | | - onNativeDismissCancelled?: DirectEventHandler<ScreenDismissedEvent>; |
79 | | - onWillAppear?: DirectEventHandler<ScreenEvent>; |
80 | | - onWillDisappear?: DirectEventHandler<ScreenEvent>; |
81 | | - onHeaderHeightChange?: DirectEventHandler<HeaderHeightChangeEvent>; |
82 | | - onTransitionProgress?: DirectEventHandler<TransitionProgressEvent>; |
83 | | - onGestureCancel?: DirectEventHandler<ScreenEvent>; |
84 | | - onHeaderBackButtonClicked?: DirectEventHandler<ScreenEvent>; |
85 | | - onSheetDetentChanged?: DirectEventHandler<SheetDetentChangedEvent>; |
86 | | - screenId?: WithDefault<string, ''>; |
| 67 | + onAppear?: CT.DirectEventHandler<ScreenEvent>; |
| 68 | + onDisappear?: CT.DirectEventHandler<ScreenEvent>; |
| 69 | + onDismissed?: CT.DirectEventHandler<ScreenDismissedEvent>; |
| 70 | + onNativeDismissCancelled?: CT.DirectEventHandler<ScreenDismissedEvent>; |
| 71 | + onWillAppear?: CT.DirectEventHandler<ScreenEvent>; |
| 72 | + onWillDisappear?: CT.DirectEventHandler<ScreenEvent>; |
| 73 | + onHeaderHeightChange?: CT.DirectEventHandler<HeaderHeightChangeEvent>; |
| 74 | + onTransitionProgress?: CT.DirectEventHandler<TransitionProgressEvent>; |
| 75 | + onGestureCancel?: CT.DirectEventHandler<ScreenEvent>; |
| 76 | + onHeaderBackButtonClicked?: CT.DirectEventHandler<ScreenEvent>; |
| 77 | + onSheetDetentChanged?: CT.DirectEventHandler<SheetDetentChangedEvent>; |
| 78 | + screenId?: CT.WithDefault<string, ''>; |
87 | 79 | sheetAllowedDetents?: number[]; |
88 | | - sheetLargestUndimmedDetent?: WithDefault<Int32, -1>; |
89 | | - sheetGrabberVisible?: WithDefault<boolean, false>; |
90 | | - sheetCornerRadius?: WithDefault<Float, -1.0>; |
91 | | - sheetExpandsWhenScrolledToEdge?: WithDefault<boolean, false>; |
92 | | - sheetInitialDetent?: WithDefault<Int32, 0>; |
93 | | - sheetElevation?: WithDefault<Int32, 24>; |
94 | | - sheetShouldOverflowTopInset?: WithDefault<boolean, false>; |
| 80 | + sheetLargestUndimmedDetent?: CT.WithDefault<CT.Int32, -1>; |
| 81 | + sheetGrabberVisible?: CT.WithDefault<boolean, false>; |
| 82 | + sheetCornerRadius?: CT.WithDefault<CT.Float, -1.0>; |
| 83 | + sheetExpandsWhenScrolledToEdge?: CT.WithDefault<boolean, false>; |
| 84 | + sheetInitialDetent?: CT.WithDefault<CT.Int32, 0>; |
| 85 | + sheetElevation?: CT.WithDefault<CT.Int32, 24>; |
| 86 | + sheetShouldOverflowTopInset?: CT.WithDefault<boolean, false>; |
95 | 87 | customAnimationOnSwipe?: boolean; |
96 | | - fullScreenSwipeEnabled?: WithDefault<OptionalBoolean, 'undefined'>; |
97 | | - fullScreenSwipeShadowEnabled?: WithDefault<boolean, true>; |
| 88 | + fullScreenSwipeEnabled?: CT.WithDefault<OptionalBoolean, 'undefined'>; |
| 89 | + fullScreenSwipeShadowEnabled?: CT.WithDefault<boolean, true>; |
98 | 90 | homeIndicatorHidden?: boolean; |
99 | 91 | preventNativeDismiss?: boolean; |
100 | | - gestureEnabled?: WithDefault<boolean, true>; |
| 92 | + gestureEnabled?: CT.WithDefault<boolean, true>; |
101 | 93 | statusBarColor?: ColorValue; |
102 | 94 | statusBarHidden?: boolean; |
103 | 95 | screenOrientation?: string; |
104 | 96 | statusBarAnimation?: string; |
105 | 97 | statusBarStyle?: string; |
106 | 98 | statusBarTranslucent?: boolean; |
107 | 99 | gestureResponseDistance?: GestureResponseDistanceType; |
108 | | - stackPresentation?: WithDefault<StackPresentation, 'push'>; |
109 | | - stackAnimation?: WithDefault<StackAnimation, 'default'>; |
110 | | - transitionDuration?: WithDefault<Int32, 500>; |
111 | | - replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>; |
112 | | - swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>; |
| 100 | + stackPresentation?: CT.WithDefault<StackPresentation, 'push'>; |
| 101 | + stackAnimation?: CT.WithDefault<StackAnimation, 'default'>; |
| 102 | + transitionDuration?: CT.WithDefault<CT.Int32, 500>; |
| 103 | + replaceAnimation?: CT.WithDefault<ReplaceAnimation, 'pop'>; |
| 104 | + swipeDirection?: CT.WithDefault<SwipeDirection, 'horizontal'>; |
113 | 105 | hideKeyboardOnSwipe?: boolean; |
114 | | - activityState?: WithDefault<Float, -1.0>; |
| 106 | + activityState?: CT.WithDefault<CT.Float, -1.0>; |
115 | 107 | navigationBarColor?: ColorValue; |
116 | 108 | navigationBarTranslucent?: boolean; |
117 | 109 | navigationBarHidden?: boolean; |
118 | 110 | nativeBackButtonDismissalEnabled?: boolean; |
119 | | - bottomScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'automatic'>; |
120 | | - leftScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'automatic'>; |
121 | | - rightScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'automatic'>; |
122 | | - topScrollEdgeEffect?: WithDefault<ScrollEdgeEffect, 'automatic'>; |
123 | | - synchronousShadowStateUpdatesEnabled?: WithDefault<boolean, false>; |
124 | | - androidResetScreenShadowStateOnOrientationChangeEnabled?: WithDefault< |
| 111 | + bottomScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>; |
| 112 | + leftScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>; |
| 113 | + rightScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>; |
| 114 | + topScrollEdgeEffect?: CT.WithDefault<ScrollEdgeEffect, 'automatic'>; |
| 115 | + synchronousShadowStateUpdatesEnabled?: CT.WithDefault<boolean, false>; |
| 116 | + androidResetScreenShadowStateOnOrientationChangeEnabled?: CT.WithDefault< |
125 | 117 | boolean, |
126 | 118 | true |
127 | 119 | >; |
|
0 commit comments