T
NativeHookContext
What an Objective-C hook handler receives for one call of the hooked method.
type NativeHookContext<Receiver extends boolean = true> = { … }Members
args
unknown[]The method's explicit arguments, without self and _cmd, borrowed until the handler returns.
argumentIndexes
number[]The method argument index each entry of args came from, as trimmed by payload.arguments.
original
(...args: unknown[]) => NativeObjCResultRuns the original implementation; it works only synchronously on the hook's thread.
phase
"before" | "after" | "replace"Which handler is running.
selector
stringThe hooked selector's name.
self
Receiver extends true ? NativeObjectHandle : undefinedThe receiver, borrowed until the handler returns.
replaceObjectArgument
(index: number, value: NativeHandle | null): voidSwaps the object argument at an index of args before the original runs; only during a synchronous handler.