Skip to content

MonkeyAroundComponentRegisterFunctionPatchParams<Obj, FunctionName>

Parameters passed to MonkeyAroundComponent#registerFunctionPatch.

Import:

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

Signature:

export interface MonkeyAroundComponentRegisterFunctionPatchParams<Obj extends object, FunctionName extends FunctionKeys<Obj>>

Properties

PropertyTypeDescription
functionNameFunctionNameThe function name to patch.
objObjThe object to patch.
once?booleanWhen true, the patch uninstalls itself the first time the patched function is invoked (by unloading this component), restoring the original — so the interception happens exactly once. Intended for a component dedicated to this single patch. Existing callers that omit it are unaffected.

Methods

MethodReturnsDescription
patchHandler(originalValue)Obj[FunctionName]Patch handler function that takes the original value and returns the patched value.