UNPKG

sussudio

Version:

An unofficial VS Code Internal API

42 lines (41 loc) 2.09 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Event } from "../../../base/common/event.mjs"; export declare const ICredentialsService: import("../../instantiation/common/instantiation.mjs").ServiceIdentifier<ICredentialsService>; export interface ICredentialsProvider { getPassword(service: string, account: string): Promise<string | null>; setPassword(service: string, account: string, password: string): Promise<void>; deletePassword(service: string, account: string): Promise<boolean>; findPassword(service: string): Promise<string | null>; findCredentials(service: string): Promise<Array<{ account: string; password: string; }>>; clear?(): Promise<void>; } export interface ICredentialsChangeEvent { service: string; account: string; } export interface ICredentialsService extends ICredentialsProvider { readonly _serviceBrand: undefined; readonly onDidChangePassword: Event<ICredentialsChangeEvent>; getSecretStoragePrefix(): Promise<string>; } export declare const ICredentialsMainService: import("../../instantiation/common/instantiation.mjs").ServiceIdentifier<ICredentialsMainService>; export interface ICredentialsMainService extends ICredentialsService { } export declare class InMemoryCredentialsProvider implements ICredentialsProvider { private secretVault; getPassword(service: string, account: string): Promise<string | null>; setPassword(service: string, account: string, password: string): Promise<void>; deletePassword(service: string, account: string): Promise<boolean>; findPassword(service: string): Promise<string | null>; findCredentials(service: string): Promise<Array<{ account: string; password: string; }>>; clear(): Promise<void>; }