Skip to content

MonkeyAroundComponentRegisterFunctionPatchParams<$Object, FunctionName>

Parameters passed to MonkeyAroundComponent#registerFunctionPatch.

Import:

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

Signature:

export interface MonkeyAroundComponentRegisterFunctionPatchParams<$Object extends object, FunctionName extends FunctionKeys<$Object>>

Properties

PropertyTypeDescription
$object$ObjectThe object to patch.
functionNameFunctionNameThe function name 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)$Object[FunctionName]Patch handler function that takes the original value and returns the patched value.