decova-dotnet
Version:
This package provides fundumentals that a .net developer may miss while working with Typescript, whether they are missing functinalities or funcionalities provided in a non-elegant design in javascript. Bad naming, bad design of optional parameters, non-c
27 lines • 1.04 kB
TypeScript
import { List } from "../Array/List";
export declare class KeyValuePair<TKey, TValue> {
Key: TKey;
Value: TValue;
constructor(key: TKey, value: TValue);
}
declare type actionOnKeyValue<TKey, TValue> = (kv: KeyValuePair<TKey, TValue>) => void;
export declare class Dictionary<TKey, TValue> {
_map: Map<TKey, TValue>;
constructor(map?: Map<TKey, TValue>);
Add(key: TKey, value: TValue): void;
Ensure(key: TKey, value: TValue, overwriteIfExising?: boolean): TValue;
Get(key: TKey): TValue | undefined;
Set(key: TKey, value: TValue): void;
UpdateOnlyIfAny(key: TKey, value: TValue): boolean;
Remove(key: TKey): void;
EnsureRemoved(key: TKey): boolean;
get Keys(): List<TKey>;
get Values(): List<TValue>;
Clear(): void;
Foreach(func: actionOnKeyValue<TKey, TValue>): void;
Contains(key: TKey): boolean;
get Count(): number;
static FromObjectProps(obj: object): Dictionary<string, unknown>;
}
export {};
//# sourceMappingURL=Dictionary.d.ts.map