2025-03-21 19:59:16 +07:00
|
|
|
// All of these typings are exported, be careful what you export here!
|
|
|
|
|
|
2025-05-05 21:17:42 +07:00
|
|
|
import type { Metro } from '@revenge-mod/modules/types'
|
2025-03-21 19:59:16 +07:00
|
|
|
|
|
|
|
|
/// HERMES
|
|
|
|
|
|
|
|
|
|
declare global {
|
2025-06-03 16:24:58 +07:00
|
|
|
function setTimeout(
|
|
|
|
|
cb: (...args: unknown[]) => unknown,
|
|
|
|
|
timeout?: number,
|
|
|
|
|
): number
|
2025-03-21 19:59:16 +07:00
|
|
|
/**
|
|
|
|
|
* Calls the garbage collector
|
|
|
|
|
*/
|
2025-05-08 18:52:57 +07:00
|
|
|
function gc(): void
|
2025-03-21 19:59:16 +07:00
|
|
|
|
|
|
|
|
interface HermesInternalObject {
|
|
|
|
|
getRuntimeProperties(): Record<string, string>
|
|
|
|
|
// biome-ignore lint/complexity/noBannedTypes: You can pass any function here
|
|
|
|
|
getFunctionLocation(fn: Function): {
|
|
|
|
|
fileName: string
|
|
|
|
|
lineNumber: number
|
|
|
|
|
columnNumber: number
|
|
|
|
|
segmentID: number
|
|
|
|
|
virtualOffset: number
|
|
|
|
|
isNative: boolean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// HERMES PROMISES
|
|
|
|
|
|
|
|
|
|
declare global {
|
2025-06-03 16:24:58 +07:00
|
|
|
// biome-ignore lint/correctness/noUnusedVariables: Type parameter names must match
|
2025-05-08 18:52:57 +07:00
|
|
|
interface Promise<T> {
|
2025-03-21 19:59:16 +07:00
|
|
|
/// PROMISE POLYFILLS FROM: https://github.com/then/promise
|
|
|
|
|
/// AND: https://github.com/facebook/hermes/blob/main/lib/InternalBytecode/01-Promise.js
|
|
|
|
|
_h: 0 | 1 | 2
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 16:24:58 +07:00
|
|
|
type HermesPromiseRejectionHandler = (
|
|
|
|
|
promise: Promise<any>,
|
|
|
|
|
error: any,
|
|
|
|
|
) => void
|
2025-03-21 19:59:16 +07:00
|
|
|
|
|
|
|
|
interface PromiseConstructor {
|
|
|
|
|
_m: HermesPromiseRejectionHandler
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// REACT DEVTOOLS
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
var __REACT_DEVTOOLS_GLOBAL_HOOK__: unknown | undefined
|
2025-05-05 19:13:01 +07:00
|
|
|
var __REACT_DEVTOOLS__:
|
2025-03-21 19:59:16 +07:00
|
|
|
| {
|
|
|
|
|
version: string
|
|
|
|
|
exports: {
|
|
|
|
|
connectToDevTools(opts: {
|
|
|
|
|
host?: string
|
|
|
|
|
port?: number
|
|
|
|
|
websocket?: WebSocket
|
|
|
|
|
}): void
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
| undefined
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// METRO
|
|
|
|
|
|
|
|
|
|
declare global {
|
2025-07-07 19:32:58 +07:00
|
|
|
var __METRO_GLOBAL_PREFIX__: ''
|
|
|
|
|
|
2025-04-11 18:35:54 +07:00
|
|
|
var __d: Metro.DefineFn
|
2025-07-07 19:32:58 +07:00
|
|
|
var __r: Metro.RequireFn & {
|
|
|
|
|
importDefault: Metro.ImportDefaultFn
|
|
|
|
|
importAll: Metro.ImportAllFn
|
|
|
|
|
}
|
|
|
|
|
var __c: Metro.ClearFn
|
2025-03-21 19:59:16 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// REACT NATIVE
|
|
|
|
|
|
|
|
|
|
declare global {
|
2025-07-02 21:46:13 +07:00
|
|
|
var nativeModuleProxy: Record<string, unknown>
|
|
|
|
|
function __turboModuleProxy(name: string): unknown
|
2025-05-08 18:52:57 +07:00
|
|
|
function nativeLoggingHook(str: string, level: number): void
|
|
|
|
|
function alert(message: unknown): void
|
2025-03-21 19:59:16 +07:00
|
|
|
|
|
|
|
|
var nativePerformanceNow: typeof performance.now
|
|
|
|
|
var performance: {
|
|
|
|
|
now(): number
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var globalEvalWithSourceUrl: (code: string, sourceURL: string) => any
|
|
|
|
|
}
|