Plugins - Settings: Plugins page is now semi-functional - No Track: Added new plugin - Developer Settings: Clean up properly - Logging: Log in preInit stage - Staff Settings: Add ReloadRequired flags when late-running @revenge-mod/init - Moved to the top-level src/index.ts instead @revenge-mod/modules - Switch `exports` and `id` parameters in finders APIs - Lookups now return an array of exports and ID instead of just exports - Lookup ID APIs have been removed - Add `finders.get` helper, a new alternative for `finders.find` - Corrected documentation for subscription APIs @revenge-mod/plugins - Added new APIs for plugins to allow running during pre-init stages - Added `unscoped.modules.finders.get*` - Added `unscoped.react.native` @revenge-mod/react - native: Added `onRunApplication` and `onRunApplicationFinished` @revenge-mod/utils - callbacks: Add `noopFalse` - promises: Fix `allSettled` - promises: Add `sleep`
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { byProps } from '@revenge-mod/modules/finders/filters'
|
|
import { waitForModules } from '@revenge-mod/modules/finders/wait'
|
|
|
|
import type { Metro } from '@revenge-mod/modules/types'
|
|
|
|
export let ReactModuleId: Metro.ModuleID
|
|
export let ReactNativeModuleId: Metro.ModuleID
|
|
export let ReactJsxRuntimeModuleId: Metro.ModuleID
|
|
|
|
export let React: typeof import('react')
|
|
export let ReactNative: typeof import('react-native')
|
|
export let ReactJsxRuntime: typeof import('react/jsx-runtime')
|
|
|
|
let RtCount = 0
|
|
|
|
const unsubRt = waitForModules(byProps<typeof React>('useState'), (exports, id) => {
|
|
if (RtCount++ === 2) return unsubRt()
|
|
|
|
ReactModuleId = id
|
|
React = exports
|
|
})
|
|
|
|
const unsubRN = waitForModules(byProps<typeof ReactNative>('AppRegistry'), (exports, id) => {
|
|
unsubRN()
|
|
|
|
ReactNativeModuleId = id
|
|
ReactNative = exports
|
|
})
|
|
|
|
let RJsxRCount = 0
|
|
|
|
const unsubRJsxR = waitForModules(byProps<typeof ReactJsxRuntime>('jsxs'), (exports, id) => {
|
|
if (RJsxRCount++ === 2) return unsubRJsxR()
|
|
|
|
ReactJsxRuntimeModuleId = id
|
|
ReactJsxRuntime = exports
|
|
})
|