A memento represents a storage utility. It can store and retrieve values.

interface Memento {
    get<T>(key): undefined | T;
    get<T>(key, defaultValue): T;
    keys(): readonly string[];
    update(key, value): Thenable<void>;
}

Implemented by

Methods

Methods

  • Return a value.

    Type Parameters

    • T

    Parameters

    • key: string

      A string.

    Returns undefined | T

    The stored value or undefined.

  • Return a value.

    Type Parameters

    • T

    Parameters

    • key: string

      A string.

    • defaultValue: T

      A value that should be returned when there is no value (undefined) with the given key.

    Returns T

    The stored value or the defaultValue.