forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keytar.d.ts
60 lines (55 loc) · 2.02 KB
/
keytar.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Type definitions for keytar 3.0.0
// Project: http://atom.github.io/node-keytar/
// Definitions by: Milan Burda <https://github.com/miniak/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'keytar' {
/**
* Get the stored password for the service and account.
*
* @param service The string service name.
* @param account The string account name.
*
* @returns the string password or null on failures.
*/
export function getPassword(service: string, account: string): string;
/**
* Add the password for the service and account to the keychain.
*
* @param service The string service name.
* @param account The string account name.
* @param password The string password.
*
* @returns true on success, false on failure.
*/
export function addPassword(service: string, account: string, password: string): boolean;
/**
* Delete the stored password for the service and account.
*
* @param service The string service name.
* @param account The string account name.
*
* @returns the string password or null on failures.
*/
export function deletePassword(service: string, account: string): string;
/**
* Replace the password for the service and account in the keychain.
*
* This is a simple convenience function that internally calls deletePassword(service, account)
* followed by addPassword(service, account, password).
*
* @param service The string service name.
* @param account The string account name.
* @param password The string password.
*
* @returns true on success, false on failure.
*/
export function replacePassword(service: string, account: string, password: string): boolean;
/**
* Find a password for the service in the keychain.
*
* @param service The string service name.
*
* @returns the string password or null on failures.
*/
export function findPassword(service: string): string;
}