Type Alias DisabledMemberHandler<Properties, Target>

DisabledMemberHandler<Properties, Target>: ((target: Target, p: PropertyKey, receiver: any, ...args: any[]) => any)

Handler function for a disabled controlled proxy object member.

Type Parameters

  • Properties extends PropertyKey

    Union representing property keys of the controlled properties.

  • Target extends ControlledPartial<Properties>

    The target object type. Must have all keys in Properties.

Type declaration

    • (target, p, receiver, ...args): any
    • Parameters

      • target: Target

        The target object.

      • p: PropertyKey

        The property key.

      • receiver: any

        The proxy object.

      • Rest...args: any[]

        The arguments passed to the function.

      Returns any

      The result of the handler function.

The handler function is called when a disabled controlled member of target is accessed (i.e. an internal get operation).

Type parameters will be inferred from the function definition. It should not be necessary to provide them explicitly.

Params target, p, and receiver provide runtime context and are the same as the get method of a ProxyHandler.

When not provided, this function defaults to () => undefined.

If the underlying member is a function, the handler fuction will be called with appropriate target, p, and receiver values, along with any provided args.

If the underlying member is not a function, the handler function will be called with appropriate target, p, and receiver values, and no args and its result returned.