VS Code API
    Preparing search index...

    Interface Memento

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

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

    Methods

    Methods

    • Return a value.

      Type Parameters

      • T

      Parameters

      • key: string

        A string.

      Returns T | undefined

      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.

    • Returns the stored keys.

      Returns readonly string[]

      The stored keys.

    • Store a value. The value must be JSON-stringifyable.

      Note that using undefined as value removes the key from the underlying storage.

      Parameters

      • key: string

        A string.

      • value: any

        A value. MUST not contain cyclic references.

      Returns Thenable<void>