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:
Dawid Małecki
2025-01-21 07:02:21 -08:00
committed by Facebook GitHub Bot
parent 9eeef22a67
commit 44d84f2af6
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -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,
};
"
`;