@omnia/fx-models
Version: 
Provide Omnia Fx Models Stuffs.
29 lines (28 loc) • 940 B
TypeScript
export interface IDictionary<TValue> {
    /**
    * Returns the value of the key, or null if it does not exist.
    * */
    getValue: (key: string) => TValue;
    /**
     * Get the value of the specified key if the value does not exists, it uses the supplied factory to create and set the value
     * */
    getOrSetInitialValue: (key: string, initialValueFactory: () => TValue) => TValue;
    /**
    * Changes the value of the key
    * */
    setValue: (key: string, value: TValue) => void;
    /**
     * All keys
     * */
    readonly keys: Array<string>;
}
export declare class Dictionary<TValue> implements IDictionary<TValue> {
    private _bagData;
    constructor(_bagData: {
        [key: string]: TValue;
    });
    getValue: (key: string) => TValue;
    setValue: (key: string, value: TValue) => void;
    getOrSetInitialValue: (key: string, initialValueFactory: () => TValue) => TValue;
    get keys(): Array<string>;
}