• Emulates writing to a private instance field.

    Type Parameters

    • T extends object
    • V

    Parameters

    • receiver: T

      The instance on which to set a private field value.

    • state: {
          has(o): boolean;
          set(o, value): unknown;
      }

      A WeakMap used to store the private field value for an instance.

      • has:function
        • Parameters

          Returns boolean

      • set:function
        • Parameters

          • o: T
          • value: V

          Returns unknown

    • value: V

      The value to store in the private field.

    • Optional kind: "f"

      Either "f" for a field, "a" for an accessor, or "m" for a method.

    Returns V

    Throws

    If state doesn't have an entry for receiver.

  • Emulates writing to a private static field.

    Type Parameters

    • T extends (new (...args) => unknown)
    • V

    Parameters

    • receiver: T

      The object on which to set the private static field.

    • state: T

      The class constructor containing the definition of the private static field.

    • value: V

      The value to store in the private field.

    • kind: "f"

      Either "f" for a field, "a" for an accessor, or "m" for a method.

    • f: {
          value: V;
      }

      The descriptor that holds the static field value.

      • value: V

    Returns V

    Throws

    If receiver is not state.

  • Emulates writing to a private instance "set" accessor.

    Type Parameters

    • T extends object
    • V

    Parameters

    • receiver: T

      The instance on which to evaluate the private instance "set" accessor.

    • state: {
          has(o): boolean;
      }

      A WeakSet used to verify an instance supports the private "set" accessor.

      • has:function
        • Parameters

          Returns boolean

    • value: V

      The value to store in the private accessor.

    • kind: "a"

      Either "f" for a field, "a" for an accessor, or "m" for a method.

    • f: ((v) => void)

      The "set" accessor function to evaluate.

        • (v): void
        • Parameters

          Returns void

    Returns V

    Throws

    If state doesn't have an entry for receiver.

  • Emulates writing to a private static "set" accessor.

    Type Parameters

    • T extends (new (...args) => unknown)
    • V

    Parameters

    • receiver: T

      The object on which to evaluate the private static "set" accessor.

    • state: T

      The class constructor containing the definition of the static "set" accessor.

    • value: V

      The value to store in the private field.

    • kind: "a"

      Either "f" for a field, "a" for an accessor, or "m" for a method.

    • f: ((v) => void)

      The "set" accessor function to evaluate.

        • (v): void
        • Parameters

          Returns void

    Returns V

    Throws

    If receiver is not state.

Generated using TypeDoc