@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface SecretAccessor<T>

    A typed secret scoped to one key.

    The structured flavour of SecretStorage: values are JSON-serialized, and when a schema is declared they are validated against it in both directions — before a write is serialized, and after a read is parsed.

    interface SecretAccessor<T> {
        delete(): Promise<void>;
        dispose(): void;
        onDidChange(listener: () => void): { dispose(): void };
        read(): Promise<T | undefined>;
        write(value: T): Promise<void>;
    }

    Type Parameters

    • T
    Index
    • Fires when this key's value changes.

      Parameters

      • listener: () => void

      Returns { dispose(): void }

    • The value, or undefined when unset. Rejects on malformed/invalid data or adapter failure; failure details never contain the stored value.

      Returns Promise<T | undefined>

    • Writes the value. With a schema, the value is validated first and an invalid one rejects with SECRET_INVALID before anything reaches the platform's store. Structured values are then JSON-serialized, so values unsupported by JSON can throw before the asynchronous store call.

      Parameters

      • value: T

      Returns Promise<void>