UNPKG

1.59 kBTypeScriptView Raw
1import { Event } from '../common/event';
2import { KeytarService } from '../common/keytar-protocol';
3export interface CredentialsProvider {
4 getPassword(service: string, account: string): Promise<string | undefined>;
5 setPassword(service: string, account: string, password: string): Promise<void>;
6 deletePassword(service: string, account: string): Promise<boolean>;
7 findPassword(service: string): Promise<string | undefined>;
8 findCredentials(service: string): Promise<Array<{
9 account: string;
10 password: string;
11 }>>;
12}
13export declare const CredentialsService: unique symbol;
14export interface CredentialsService extends CredentialsProvider {
15 readonly onDidChangePassword: Event<CredentialsChangeEvent>;
16}
17export interface CredentialsChangeEvent {
18 service: string;
19 account: string;
20}
21export declare class CredentialsServiceImpl implements CredentialsService {
22 private readonly keytarService;
23 private onDidChangePasswordEmitter;
24 readonly onDidChangePassword: Event<CredentialsChangeEvent>;
25 private credentialsProvider;
26 constructor(keytarService: KeytarService);
27 getPassword(service: string, account: string): Promise<string | undefined>;
28 setPassword(service: string, account: string, password: string): Promise<void>;
29 deletePassword(service: string, account: string): Promise<boolean>;
30 findPassword(service: string): Promise<string | undefined>;
31 findCredentials(service: string): Promise<Array<{
32 account: string;
33 password: string;
34 }>>;
35}
36//# sourceMappingURL=credentials-service.d.ts.map
\No newline at end of file