Interface ProxyHandler<T>

Interface defining handlers for proxy operations

interface ProxyHandler<T> {
    apply(target: T, ...args: any[]): any;
    get(target: T, key: string): any;
    set(target: T, key: string, value: any): void;
}

Type Parameters

  • T

    The type of object being proxied

Methods

Methods

  • Intercepts function calls (when target is callable)

    Parameters

    • target: T

      The original function

    • ...args: any[]

      Arguments passed to the function

    Returns any

    The function result

  • Intercepts property access

    Parameters

    • target: T

      The original object

    • key: string

      Property being accessed

    Returns any

    The property value

  • Intercepts property assignment

    Parameters

    • target: T

      The original object

    • key: string

      Property being set

    • value: any

      New value being assigned

    Returns void