mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add type for export object in AssetRegistry (#48734)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48734 Changelog: [General][Changed] - Added type for exported object in AssetRegistry Reviewed By: cortinico Differential Revision: D68272679 fbshipit-source-id: 1202009f886b2d35528009a3ac58aab24af9ef82
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9eeef22a67
commit
44d84f2af6
+6
-1
@@ -10,4 +10,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = require('@react-native/assets-registry/registry');
|
||||
import type {PackagerAsset} from '@react-native/assets-registry/registry';
|
||||
|
||||
module.exports = require('@react-native/assets-registry/registry') as {
|
||||
registerAsset: (asset: PackagerAsset) => number,
|
||||
getAssetByID: (assetId: number) => PackagerAsset,
|
||||
};
|
||||
|
||||
@@ -4721,7 +4721,10 @@ declare export default typeof EventPolyfill;
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Image/AssetRegistry.js 1`] = `
|
||||
"declare module.exports: $FlowFixMe;
|
||||
"declare module.exports: {
|
||||
registerAsset: (asset: PackagerAsset) => number,
|
||||
getAssetByID: (assetId: number) => PackagerAsset,
|
||||
};
|
||||
"
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user