Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HandlerParam

Handler's parameter.

Hierarchy

  • HandlerParam

Index

Properties

arg

arg: any[]

Array of arguments that were passed to the wrapping function.

arg0

arg0: any

Value of arg[0].

byCall

byCall: boolean

Whether wrapping function is called as object's method or as usual function (by a call operation).

byGet

byGet: boolean

Whether wrapping function is called to get field's value (by get operation, as field's getter).

bySet

bySet: boolean

Whether wrapping function is called to set field's value (by set operation, as field's setter).

byUnwrap

byUnwrap: boolean

Whether wrapping function (and handler) is called during unwrapping.

context

context: any

Context (this) with which wrapping function is called.

data

data: any

Value of settings.data option.

field

field: string | undefined

Name of the field or method that was wrapped.

fieldWrap

fieldWrap: boolean

Whether field's get and/or set operation was wrapped.

funcWrap

funcWrap: boolean

Whether standalone function (not object's field/method) was wrapped.

get

get: FieldGetter | undefined

Function that returns field's current value if field was wrapped.

method

method: string | undefined

Name of the method or function that was wrapped.

methodWrap

methodWrap: boolean

Whether method was wrapped.

number

number: number

Number of handler's call (starting from 1).

Optional result

result: any

Result of original function/method when it is called before handler.

run

Method that calls original function/method or field's getter/setter; by default values from arg will be used as arguments; but you may pass arguments to run and they will be used instead of the original arguments.

runApply

runApply: (paramSet?: any | any[]) => any

Similar to run but accepts an array of new arguments, e.g. runApply([1, 2, 3]) is equivalent to run(1, 2, 3); if the first argument of runApply is not an array it will be wrapped into array (i.e. [arguments[0]]); only the first argument of runApply is used.

Type declaration

    • (paramSet?: any | any[]): any
    • Parameters

      • Optional paramSet: any | any[]

      Returns any

save

An object that can be used to preserve some values between handler calls.

set

set: FieldSetter | undefined

Function that changes field's current value if field was wrapped.

settings

settings: WrapSettings

Value of settings parameter; except for settings.bind and settings.context, it is possible to change any setting to alter following execution; so be careful when you change a field's value of settings object.

target

target: TargetFunction | string

Original function or method that was wrapped, or name of wrapped field.

targetObj

targetObj: TargetObject | null

An object whose field/method was wrapped and replaced.

value

value: unknown

Previous value returned by wrapping function.

Generated using TypeDoc