UNPKG

10.3 kBTypeScriptView Raw
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 */
9
10// Definitions by: Eloy Durán <https://github.com/alloy>
11// HuHuanming <https://github.com/huhuanming>
12// Kyle Roach <https://github.com/iRoachie>
13// Tim Wang <https://github.com/timwangdev>
14// Kamal Mahyuddin <https://github.com/kamal>
15// Alex Dunne <https://github.com/alexdunne>
16// Manuel Alabor <https://github.com/swissmanu>
17// Michele Bombardi <https://github.com/bm-software>
18// Martin van Dam <https://github.com/mvdam>
19// Kacper Wiszczuk <https://github.com/esemesek>
20// Ryan Nickel <https://github.com/mrnickel>
21// Souvik Ghosh <https://github.com/souvik-ghosh>
22// Cheng Gibson <https://github.com/nossbigg>
23// Saransh Kataria <https://github.com/saranshkataria>
24// Wojciech Tyczynski <https://github.com/tykus160>
25// Jake Bloom <https://github.com/jakebloom>
26// Ceyhun Ozugur <https://github.com/ceyhun>
27// Mike Martin <https://github.com/mcmar>
28// Theo Henry de Villeneuve <https://github.com/theohdv>
29// Romain Faust <https://github.com/romain-faust>
30// Be Birchall <https://github.com/bebebebebe>
31// Jesse Katsumata <https://github.com/Naturalclar>
32// Xianming Zhong <https://github.com/chinesedfan>
33// Valentyn Tolochko <https://github.com/vtolochk>
34// Sergey Sychev <https://github.com/SychevSP>
35// Kelvin Chu <https://github.com/RageBill>
36// Daiki Ihara <https://github.com/sasurau4>
37// Abe Dolinger <https://github.com/256hz>
38// Dominique Richard <https://github.com/doumart>
39// Mohamed Shaban <https://github.com/drmas>
40// Jérémy Barbet <https://github.com/jeremybarbet>
41// David Sheldrick <https://github.com/ds300>
42// Natsathorn Yuthakovit <https://github.com/natsathorn>
43// ConnectDotz <https://github.com/connectdotz>
44// Alexey Molchan <https://github.com/alexeymolchan>
45// Alex Brazier <https://github.com/alexbrazier>
46// Arafat Zahan <https://github.com/kuasha420>
47// Pedro Hernández <https://github.com/phvillegas>
48// Sebastian Silbermann <https://github.com/eps1lon>
49// Zihan Chen <https://github.com/ZihanChen-MSFT>
50// Lorenzo Sciandra <https://github.com/kelset>
51// Mateusz Wit <https://github.com/MateWW>
52// Saad Najmi <https://github.com/saadnajmi>
53// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
54// Minimum TypeScript Version: 4.8
55
56///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
57//
58// USING: these definitions are meant to be used with the TSC compiler target set to at least ES2015.
59//
60// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer
61//
62// CONTRIBUTING: please open pull requests
63//
64// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie
65//
66///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
67
68/// <reference path="modules/BatchedBridge.d.ts" />
69/// <reference path="modules/Codegen.d.ts" />
70/// <reference path="modules/Devtools.d.ts" />
71/// <reference path="modules/globals.d.ts" />
72/// <reference path="modules/LaunchScreen.d.ts" />
73
74export * from '../Libraries/ActionSheetIOS/ActionSheetIOS';
75export * from '../Libraries/Alert/Alert';
76export * from '../Libraries/Animated/Animated';
77export * from '../Libraries/Animated/Easing';
78export * from '../Libraries/Animated/useAnimatedValue';
79export * from '../Libraries/AppState/AppState';
80export * from '../Libraries/BatchedBridge/NativeModules';
81export * from '../Libraries/Components/AccessibilityInfo/AccessibilityInfo';
82export * from '../Libraries/Components/ActivityIndicator/ActivityIndicator';
83export * from '../Libraries/Components/Clipboard/Clipboard';
84export * from '../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
85export * from '../Libraries/Components/Keyboard/Keyboard';
86export * from '../Libraries/Components/Keyboard/KeyboardAvoidingView';
87export * from '../Libraries/Components/LayoutConformance/LayoutConformance';
88export * from '../Libraries/Components/Pressable/Pressable';
89export * from '../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
90export * from '../Libraries/Components/RefreshControl/RefreshControl';
91export * from '../Libraries/Components/SafeAreaView/SafeAreaView';
92export * from '../Libraries/Components/ScrollView/ScrollView';
93export * from '../Libraries/Components/StatusBar/StatusBar';
94export * from '../Libraries/Components/Switch/Switch';
95export * from '../Libraries/Components/TextInput/InputAccessoryView';
96export * from '../Libraries/Components/TextInput/TextInput';
97export * from '../Libraries/Components/ToastAndroid/ToastAndroid';
98export * from '../Libraries/Components/Touchable/Touchable';
99export * from '../Libraries/Components/Touchable/TouchableHighlight';
100export * from '../Libraries/Components/Touchable/TouchableNativeFeedback';
101export * from '../Libraries/Components/Touchable/TouchableOpacity';
102export * from '../Libraries/Components/Touchable/TouchableWithoutFeedback';
103export * from '../Libraries/Components/View/View';
104export * from '../Libraries/Components/View/ViewAccessibility';
105export * from '../Libraries/Components/View/ViewPropTypes';
106export * from '../Libraries/Components/Button';
107export * from '../Libraries/Core/registerCallableModule';
108export * from '../Libraries/EventEmitter/NativeEventEmitter';
109export * from '../Libraries/EventEmitter/RCTDeviceEventEmitter';
110export * from '../Libraries/EventEmitter/RCTNativeAppEventEmitter';
111export * from '../Libraries/Image/Image';
112export * from '../Libraries/Image/ImageResizeMode';
113export * from '../Libraries/Image/ImageSource';
114export * from '../Libraries/Interaction/InteractionManager';
115export * from '../Libraries/Interaction/PanResponder';
116export * from '../Libraries/LayoutAnimation/LayoutAnimation';
117export * from '../Libraries/Linking/Linking';
118export * from '../Libraries/Lists/FlatList';
119export * from '../Libraries/Lists/SectionList';
120export * from '@react-native/virtualized-lists';
121export * from '../Libraries/LogBox/LogBox';
122export * from '../Libraries/Modal/Modal';
123export * as Systrace from '../Libraries/Performance/Systrace';
124export * from '../Libraries/PermissionsAndroid/PermissionsAndroid';
125export * from '../Libraries/PushNotificationIOS/PushNotificationIOS';
126export * from '../Libraries/ReactNative/AppRegistry';
127export * from '../Libraries/ReactNative/I18nManager';
128export * from '../Libraries/ReactNative/RendererProxy';
129export * from '../Libraries/ReactNative/RootTag';
130export * from '../Libraries/ReactNative/UIManager';
131export * from '../Libraries/ReactNative/requireNativeComponent';
132export * from '../Libraries/Settings/Settings';
133export * from '../Libraries/Share/Share';
134export * from '../Libraries/StyleSheet/PlatformColorValueTypesIOS';
135export * from '../Libraries/StyleSheet/PlatformColorValueTypes';
136export * from '../Libraries/StyleSheet/StyleSheet';
137export * from '../Libraries/StyleSheet/StyleSheetTypes';
138export * from '../Libraries/StyleSheet/processColor';
139export * from '../Libraries/Text/Text';
140export * from '../Libraries/TurboModule/RCTExport';
141export * as TurboModuleRegistry from '../Libraries/TurboModule/TurboModuleRegistry';
142export * from '../Libraries/Types/CoreEventTypes';
143export * from '../Libraries/Utilities/Appearance';
144export * from '../Libraries/Utilities/BackHandler';
145export * from '../src/private/devmenu/DevMenu';
146export * from '../Libraries/Utilities/DevSettings';
147export * from '../Libraries/Utilities/Dimensions';
148export * from '../Libraries/Utilities/PixelRatio';
149export * from '../Libraries/Utilities/Platform';
150export * from '../Libraries/Vibration/Vibration';
151export * from '../Libraries/YellowBox/YellowBoxDeprecated';
152export * from '../Libraries/vendor/core/ErrorUtils';
153export {
154 EmitterSubscription,
155 EventSubscription,
156} from '../Libraries/vendor/emitter/EventEmitter';
157
158export * from './public/DeprecatedPropertiesAlias';
159export * from './public/Insets';
160export * from './public/ReactNativeRenderer';
161export * from './public/ReactNativeTypes';
162
163import type {ErrorUtils} from '../Libraries/vendor/core/ErrorUtils';
164
165declare global {
166 interface NodeRequire {
167 (id: string): any;
168 }
169
170 var require: NodeRequire;
171
172 /**
173 * Console polyfill
174 * @see https://reactnative.dev/docs/javascript-environment#polyfills
175 */
176 interface Console {
177 error(message?: any, ...optionalParams: any[]): void;
178 info(message?: any, ...optionalParams: any[]): void;
179 log(message?: any, ...optionalParams: any[]): void;
180 warn(message?: any, ...optionalParams: any[]): void;
181 trace(message?: any, ...optionalParams: any[]): void;
182 debug(message?: any, ...optionalParams: any[]): void;
183 table(...data: any[]): void;
184 groupCollapsed(label?: string): void;
185 groupEnd(): void;
186 group(label?: string): void;
187 /**
188 * @deprecated Use LogBox.ignoreLogs(patterns) instead
189 */
190 ignoredYellowBox: string[];
191 }
192
193 var console: Console;
194
195 /**
196 * This contains the non-native `XMLHttpRequest` object, which you can use if you want to route network requests
197 * through DevTools (to trace them):
198 *
199 * global.XMLHttpRequest = global.originalXMLHttpRequest;
200 *
201 * @see https://github.com/facebook/react-native/issues/934
202 */
203 const originalXMLHttpRequest: any;
204
205 const __BUNDLE_START_TIME__: number;
206 const ErrorUtils: ErrorUtils;
207
208 /**
209 * This variable is set to true when react-native is running in Dev mode
210 * @example
211 * if (__DEV__) console.log('Running in dev mode')
212 */
213 const __DEV__: boolean;
214
215 const HermesInternal: null | {};
216}