feat(lib/modules): export common
This commit is contained in:
parent
c4fbbb61d8
commit
0ff9c83f5b
2 changed files with 15 additions and 0 deletions
|
|
@ -3,6 +3,9 @@
|
|||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./common": {
|
||||
"default": "./src/common.ts"
|
||||
},
|
||||
"./finders": {
|
||||
"default": "./src/finders/index.ts"
|
||||
},
|
||||
|
|
|
|||
12
lib/modules/src/common.ts
Normal file
12
lib/modules/src/common.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { yielded } from '@revenge-mod/utils/generators'
|
||||
|
||||
import { lookupModuleId, lookupModuleIds } from './finders'
|
||||
import { byProps } from './finders/filters'
|
||||
|
||||
export const ReactModuleId = yielded(lookupModuleIds(byProps<typeof import('react')>('useState')), 1)!
|
||||
export const ReactNativeModuleId = lookupModuleId(byProps<typeof import('react-native')>('AppRegistry'))!
|
||||
export const ReactJSXRuntimeModuleId = yielded(lookupModuleIds(byProps<typeof import('react/jsx-runtime')>('jsx'))!, 1)
|
||||
|
||||
export const React = __r(ReactModuleId) as typeof import('react')
|
||||
export const ReactNative = __r(ReactNativeModuleId) as typeof import('react-native')
|
||||
export const ReactJSXRuntime = __r(ReactJSXRuntimeModuleId) as typeof import('react/jsx-runtime')
|
||||
Loading…
Add table
Reference in a new issue