1import NativeModulesProxy from './NativeModulesProxy';
2/**
3 * Imports the native module registered with given name. In the first place it tries to load
4 * the module installed through the JSI host object and then falls back to the bridge proxy module.
5 * Notice that the modules loaded from the proxy may not support some features like synchronous functions.
6 *
7 * @param moduleName Name of the requested native module.
8 * @returns Object representing the native module.
9 * @throws Error when there is no native module with given name.
10 */
11export function requireNativeModule(moduleName) {
12    const nativeModule = global.ExpoModules?.[moduleName] ?? NativeModulesProxy[moduleName];
13    if (!nativeModule) {
14        throw new Error(`Cannot find native module '${moduleName}'`);
15    }
16    return nativeModule;
17}
18//# sourceMappingURL=requireNativeModule.js.map