15
16
type = 'in-memory' as const;
18
>
async get(key: string): Promise<string | undefined> {
19
return this._storage.get(key);
20
}
22
>
async set(key: string, value: string): Promise<void> {
23
this._storage.set(key, value);
24
this._onDidChangeSecretEmitter.fire(key);
25
}
27
>
async delete(key: string): Promise<void> {
28
this._storage.delete(key);
29
this._onDidChangeSecretEmitter.fire(key);
30
}
32
>
async keys(): Promise<string[]> {
33
return Array.from(this._storage.keys());
34
}
36
>
// Helper method for tests to clear all secrets
37
>
clear(): void {
38
this._storage.clear();
39
}
41
>
dispose(): void {
42
this._onDidChangeSecretEmitter.dispose();
43
this._storage.clear();
44
}