Interface IDictionary<TKey, TValue>

Represents a generic collection of key/value pairs.

interface IDictionary<TKey, TValue> {
    constructor: any;
    Item: PropertyGet<TKey | JsType<TKey>, JsType<TValue>> & PropertySet<TKey | JsType<TKey>, TValue | JsType<TValue>>;
    get Count(): number;
    get IsReadOnly(): boolean;
    get Keys(): System.Collections.Generic.ICollection<TKey>;
    get Values(): System.Collections.Generic.ICollection<TValue>;
    Add(item: KeyValuePair<TKey, TValue>): void;
    Add(key: TKey | JsType<TKey>, value: TValue | JsType<TValue>): void;
    Cast<T1, T2>(this: T2, type: TypeRef<T1>): T1;
    Clear(): void;
    Contains(item: KeyValuePair<TKey, TValue>): boolean;
    ContainsKey(key: TKey | JsType<TKey>): boolean;
    Remove(item: KeyValuePair<TKey, TValue>): boolean;
    Remove(key: TKey | JsType<TKey>): boolean;
    TryCast<T1, T2>(this: T2, type: TypeRef<T1>): null | T1;
    [iterator](): Iterator<KeyValuePair<TKey, TValue>, any, undefined>;
}

Type Parameters

  • TKey
  • TValue

Hierarchy (view full)

Constructors

constructor

Properties

Gets or sets the element with the specified key.

The key of the element to get or set.

The element with the specified key.

Accessors

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1