Interface IDictionary<T>

Базовый контейнер для хранения ключ/значения.

interface IDictionary<T = unknown> {
    "[toStringTag]": string;
    collectionChanged: EventHandler<
        DictionaryChangedEventArgs<T>,
        IDictionary<T>,
    >;
    ignoreCase: boolean;
    mapEnhancer: null | IMapEnhancer<T, unknown>;
    observable: boolean;
    size: number;
    "[iterator]"(): MapIterator<[string, T]>;
    clear(): void;
    clone(): IDictionary;
    delete(key: string): boolean;
    dispose(): void;
    entries(): MapIterator<[string, T]>;
    forEach(
        callbackfn: (value: T, key: string, map: Map<string, T>) => void,
        thisArg?: any,
    ): void;
    get(key: string): undefined | T;
    getVersionRef(): unknown;
    has(key: string): boolean;
    keys(): MapIterator<string>;
    remove(key: string): boolean;
    replaceWith(items: Iterable<readonly [string, T]>): void;
    set(key: string, value: T): this;
    tryGet(key: string): undefined | T;
    tryGet<T>(key: string): undefined | T;
    values(): MapIterator<T>;
}

Type Parameters

  • T = unknown

Hierarchy (View Summary, Expand)

Implemented by

Properties

"[toStringTag]": string

Событие, вызываемое при добавлении/удалении объектов в хранилище.

ignoreCase: boolean

Флаг, указывающий на то, что для доступа к элементам регистр ключа игнорируется.

mapEnhancer: null | IMapEnhancer<T, unknown>

Объект, позволяющий обрабатывать значения, добавляемые в объект-хранилище.

observable: boolean

Флаг, включающий уведомления об изменении объектов.

size: number

the number of elements in the Map.

Methods

  • Returns an iterable of entries in the map.

    Returns MapIterator<[string, T]>

  • Returns void

  • Создает новый объект, который является копией текущего экземпляра.

    Returns IDictionary

  • Parameters

    • key: string

    Returns boolean

    true if an element in the Map existed and has been removed, or false if the element does not exist.

  • Вызывает функции очистки всех внутренних ресурсов конейтенера.

    Returns void

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns MapIterator<[string, T]>

  • Executes a provided function once per each key/value pair in the Map, in insertion order.

    Parameters

    • callbackfn: (value: T, key: string, map: Map<string, T>) => void
    • OptionalthisArg: any

    Returns void

  • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

    Parameters

    • key: string

    Returns undefined | T

    Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

  • Parameters

    • key: string

    Returns boolean

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

  • Returns an iterable of keys in the map

    Returns MapIterator<string>

  • Удаляет значение из хранилища по ключу.

    Parameters

    • key: string

      Ключ, по которому требуется удалить значение.

    Returns boolean

    true, если значение было найдено и удалено из хранилища; false, если значение не удалось найти.

    Аналогичен методу StorageMap.delete.

  • Заменяет все значения в контейнере на новые.

    Parameters

    • items: Iterable<readonly [string, T]>

      Значения, которые будут добавлены в контейнер.

    Returns void

  • Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

    Parameters

    • key: string
    • value: T

    Returns this

  • Возвращает значение, полученное по ключу key, или undefined, если значение отсутствует.

    Parameters

    • key: string

      Ключ, по которому требуется найти значение.

    Returns undefined | T

    Значение, полученное по ключу key, или undefined, если значение отсутствует.

  • Type Parameters

    • T

    Parameters

    • key: string

    Returns undefined | T

  • Returns an iterable of values in the map

    Returns MapIterator<T>

MMNEPVFCICPMFPCPTTAAATR