-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathTabsHostAndroidNativeComponent.ts
More file actions
69 lines (55 loc) · 1.89 KB
/
TabsHostAndroidNativeComponent.ts
File metadata and controls
69 lines (55 loc) · 1.89 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
'use client';
import { codegenNativeComponent } from 'react-native';
import type { CodegenTypes as CT, ColorValue, ViewProps } from 'react-native';
// #region General helpers
type TabSelectedEvent = {
selectedScreenKey: string;
provenance: CT.Int32;
isRepeated: boolean;
hasTriggeredSpecialEffect: boolean;
actionOrigin: 'user' | 'programmatic-js' | 'programmatic-native' | 'implicit';
};
type NavigationStateRequest = {
selectedScreenKey: string;
baseProvenance: CT.Int32;
};
type TabSelectionRejectedEvent = Readonly<{
selectedScreenKey: string;
provenance: CT.Int32;
rejectedScreenKey: string;
rejectedProvenance: CT.Int32;
rejectionReason: 'stale' | 'repeated';
}>;
type TabSelectionPreventedEvent = Readonly<{
selectedScreenKey: string;
provenance: CT.Int32;
preventedScreenKey: string;
}>;
type TabsHostColorScheme = 'inherit' | 'light' | 'dark';
// #endregion General helpers
// #region Android-specific helpers
// No helpers specified so far, but marking the place where these should land.
// #endregion Android-specific helpers
export interface NativeProps extends ViewProps {
// Control
navStateRequest: NavigationStateRequest;
rejectStaleNavStateUpdates?: CT.WithDefault<boolean, false>;
// Events
onTabSelected?: CT.DirectEventHandler<TabSelectedEvent> | undefined;
onTabSelectionRejected?:
| CT.DirectEventHandler<TabSelectionRejectedEvent>
| undefined;
onTabSelectionPrevented?:
| CT.DirectEventHandler<TabSelectionPreventedEvent>
| undefined;
// General
tabBarHidden?: CT.WithDefault<boolean, false>;
nativeContainerBackgroundColor?: ColorValue | undefined;
colorScheme?: CT.WithDefault<TabsHostColorScheme, 'inherit'>;
// Android-specific props
tabBarRespectsIMEInsets?: CT.WithDefault<boolean, false>;
}
export default codegenNativeComponent<NativeProps>('RNSTabsHostAndroid', {
interfaceOnly: true,
excludedPlatforms: ['iOS'],
});