Skip to content

MonkeyAroundComponentRegisterFunctionPatchParams<$Object, FunctionName>

Parameters passed to MonkeyAroundComponent#registerFunctionPatch.

Import:

import type { MonkeyAroundComponentRegisterFunctionPatchParams } from '@mnaoumov/obsidian-lib/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.
patchHandler(originalValue: $Object[FunctionName]) => $Object[FunctionName]Patch handler function that takes the original value and returns the patched value.