File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
packages/host/src/react-native Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " react-native-node-api " : patch
3+ ---
4+
5+ Fix requireNodeAddon return type
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import native from "./NativeNodeApiHost " ;
1+ import { type TurboModule , TurboModuleRegistry } from "react-native " ;
22
3- export const requireNodeAddon = native . requireNodeAddon . bind ( native ) ;
3+ export interface Spec extends TurboModule {
4+ requireNodeAddon < T = unknown > ( libraryName : string ) : T ;
5+ }
6+
7+ const native = TurboModuleRegistry . getEnforcing < Spec > ( "NodeApiHost" ) ;
8+
9+ /**
10+ * Loads a native Node-API addon by filename.
11+ */
12+ export function requireNodeAddon < T = unknown > ( libraryName : string ) : T {
13+ return native . requireNodeAddon < T > ( libraryName ) ;
14+ }
You can’t perform that action at this time.
0 commit comments