Skip to content

MonkeyAroundComponentRegisterMethodPatchParams<Obj, MethodName>

Parameters passed to MonkeyAroundComponent#registerMethodPatch.

Import:

import type { MonkeyAroundComponentRegisterMethodPatchParams } from 'obsidian-dev-utils/obsidian/components/monkey-around-component';

Signature:

export interface MonkeyAroundComponentRegisterMethodPatchParams<Obj extends object, MethodName extends MethodKeys<Obj>>

Properties

PropertyTypeDescription
methodNameMethodNameThe method name to patch.
objObjThe object to patch.
once?booleanWhen true, the patch uninstalls itself the first time the patched method is invoked, restoring the original — so the interception happens exactly once. Existing callers that omit it are unaffected.
patchHandlerPatchHandlerFn<Obj, MethodName>The patch handler function.
patchToken?symbolAn optional token to identify the patch.
postPatchHandler?PostPatchHandlerFn<Obj, MethodName>An optional post-patch handler function that runs after the patch is applied.