神岛 API 文档 - ArenaPro版
    Preparing search index...

    Interface WeakMap<K, V>

    interface WeakMap<K extends WeakKey, V> {
        "[toStringTag]": string;
        delete(key: K): boolean;
        delete(key: K): boolean;
        get(key: K): V;
        get(key: K): V;
        has(key: K): boolean;
        has(key: K): boolean;
        set(key: K, value: V): this;
        set(key: K, value: V): this;
    }

    Type Parameters

    • K extends WeakKey
    • V
    Index

    Properties

    Methods

    Properties

    "[toStringTag]": string

    Methods

    • Removes the specified element from the WeakMap.

      Parameters

      • key: K

      Returns boolean

      true if the element was successfully removed, or false if it was not present.

    • Parameters

      • key: K

      Returns boolean

    • Parameters

      • key: K

      Returns V

      a specified element.

    • Parameters

      • key: K

      Returns V

    • Parameters

      • key: K

      Returns boolean

      a boolean indicating whether an element with the specified key exists or not.

    • Parameters

      • key: K

      Returns boolean

    • Adds a new element with a specified key and value.

      Parameters

      • key: K

        Must be an object or symbol.

      • value: V

      Returns this

    • Parameters

      • key: K
      • value: V

      Returns this