@aurigma/design-atoms-model
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
52 lines (51 loc) • 1.82 kB
TypeScript
export interface IEquatable<T> {
equals(other: T): boolean;
}
/**
* Represents a dictionary which key supports comparison through equals() method
*/
export declare class EquatableKeyDictionary<TKey extends IEquatable<TKey>, TValue> {
private readonly _dictionary;
constructor(entries?: Iterable<[TKey, TValue]>);
/**
* Indicates whether an element with the key equal to given {@link keyValue} exists or not.
*/
hasEqual(keyValue: TKey): boolean;
/**
* Tries to find a key in the dictionary that is equal to given {@link keyValue}.
*
* Returns:
*
* hasKey - indicates whether such a key was found in the dictionary;
*
* key - contains key that is equal to {@link keyValue} or null if such key was not found.
*/
tryGetKeyEqualTo(keyValue: TKey): {
hasKey: boolean;
key?: TKey;
};
/**
* Tries to find a value in the dictionary corresponding to the key equal to given {@link keyValue}.
*
* Returns:
*
* hasValue - indicates whether the value with such key was found;
*
* value - contains value with the key equal to {@link keyValue} or null if such key was not found.
*/
tryGetValueOf(keyValue: TKey): {
hasValue: boolean;
value: TValue;
};
clear(): void;
delete(key: TKey): boolean;
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: any): void;
get(key: TKey): TValue;
has(key: TKey): boolean;
set(key: TKey, value: TValue): this;
get size(): number;
entries(): IterableIterator<[TKey, TValue]>;
keys(): IterableIterator<TKey>;
values(): IterableIterator<TValue>;
[Symbol.iterator](): IterableIterator<[TKey, TValue]>;
}