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.expo?.modules?.[moduleName] ??
13        global.ExpoModules?.[moduleName] ??
14        NativeModulesProxy[moduleName];
15    if (!nativeModule) {
16        throw new Error(`Cannot find native module '${moduleName}'`);
17    }
18    return nativeModule;
19}
20//# sourceMappingURL=requireNativeModule.js.map