Skip to content

PatchHandlerParams<$Object, MethodName>

Parameters passed to a PatchHandlerFunction callback.

Import:

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

Signature:

export interface PatchHandlerParams<$Object extends object, MethodName extends MethodKeys<$Object>>

Properties

PropertyTypeDescription
originalArgumentsParameters<ExtractFunction<$Object, MethodName>>The original arguments of the intercepted call, as a tuple.
originalMethodExtractFunction<$Object, MethodName>The original (unpatched) method. Call via originalFn.call(originalThis, ...originalArgs).
originalMethodBoundOmitThisParameter<ExtractFunction<$Object, MethodName>>The original method, but with the this context already bound to the original object. Call via originalMethodBound(...originalArgs).
originalThis$ObjectThe original this context of the intercepted call.

Methods

MethodReturnsDescription
fallback(this)ReturnType<ExtractFunction<$Object, MethodName>>Invokes the original method with the original this and arguments.

Links to this page: