mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
037e346197
Summary: This diff runs the codemod to add type annotations to function parameters in preparation for Flow's local type inference (LTI) project. I ran the codemod over xplat/js and reverted any files that had flow errors in them. See the list of commands run to see the regeneration of various files. Changelog: [Internal][Changed] - Added type annotations Reviewed By: yungsters Differential Revision: D32075270 fbshipit-source-id: 6a9cd85aab120b4d9e690bac142a415525dbf298
60 lines
2.0 KiB
JavaScript
60 lines
2.0 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
let registerModule;
|
|
if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
|
|
registerModule = global.RN$registerCallableModule;
|
|
} else {
|
|
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
|
|
registerModule = (
|
|
moduleName:
|
|
| $TEMPORARY$string<'GlobalPerformanceLogger'>
|
|
| $TEMPORARY$string<'HMRClient'>
|
|
| $TEMPORARY$string<'HeapCapture'>
|
|
| $TEMPORARY$string<'JSDevSupportModule'>
|
|
| $TEMPORARY$string<'JSTimers'>
|
|
| $TEMPORARY$string<'RCTDeviceEventEmitter'>
|
|
| $TEMPORARY$string<'RCTLog'>
|
|
| $TEMPORARY$string<'RCTNativeAppEventEmitter'>
|
|
| $TEMPORARY$string<'SamplingProfiler'>
|
|
| $TEMPORARY$string<'Systrace'>,
|
|
factory,
|
|
) => BatchedBridge.registerLazyCallableModule(moduleName, factory);
|
|
}
|
|
|
|
registerModule('Systrace', () => require('../Performance/Systrace'));
|
|
registerModule('JSTimers', () => require('./Timers/JSTimers'));
|
|
registerModule('HeapCapture', () => require('../HeapCapture/HeapCapture'));
|
|
registerModule('SamplingProfiler', () =>
|
|
require('../Performance/SamplingProfiler'),
|
|
);
|
|
registerModule('RCTLog', () => require('../Utilities/RCTLog'));
|
|
registerModule(
|
|
'RCTDeviceEventEmitter',
|
|
() => require('../EventEmitter/RCTDeviceEventEmitter').default,
|
|
);
|
|
registerModule('RCTNativeAppEventEmitter', () =>
|
|
require('../EventEmitter/RCTNativeAppEventEmitter'),
|
|
);
|
|
registerModule('GlobalPerformanceLogger', () =>
|
|
require('../Utilities/GlobalPerformanceLogger'),
|
|
);
|
|
registerModule('JSDevSupportModule', () =>
|
|
require('../Utilities/JSDevSupportModule'),
|
|
);
|
|
|
|
if (__DEV__ && !global.__RCTProfileIsProfiling) {
|
|
registerModule('HMRClient', () => require('../Utilities/HMRClient'));
|
|
} else {
|
|
registerModule('HMRClient', () => require('../Utilities/HMRClientProdShim'));
|
|
}
|