From 161917a82a844502caeac3687db37f4c1701959b Mon Sep 17 00:00:00 2001 From: Queenie Ma Date: Tue, 5 Mar 2019 15:00:24 -0800 Subject: [PATCH] Update keytar typings for v4.4.1 --- types/keytar/index.d.ts | 20 ++++++++++++++++---- types/keytar/keytar-tests.ts | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/types/keytar/index.d.ts b/types/keytar/index.d.ts index cf6a16e4f7..f5e8e7367a 100644 --- a/types/keytar/index.d.ts +++ b/types/keytar/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for keytar 4.0.2 +// Type definitions for keytar 4.4.1 // Project: http://atom.github.io/node-keytar/ -// Definitions by: Milan Burda , Brendan Forster , Hari Juturu +// Definitions by: Milan Burda +// Brendan Forster +// Hari Juturu +// Queenie Ma // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,7 +18,7 @@ export declare function getPassword(service: string, account: string): Promise; /** - * Add the password for the service and account to the keychain. + * Save the password for the service and account to the keychain. Adds a new entry if necessary, or updates an existing entry if one exists. * * @param service The string service name. * @param account The string account name. @@ -36,7 +39,16 @@ export declare function setPassword(service: string, account: string, password: export declare function deletePassword(service: string, account: string): Promise; /** - * Find a password for the service in the keychain. + * Find all accounts and password for the service in the keychain. + * + * @param service The string service name. + * + * @returns A promise for the credentials array. + */ +export declare function findCredentials(service: string): Promise>; + +/** + * Find a password for the service in the keychain. This is ideal for scenarios where an account is not required. * * @param service The string service name. * diff --git a/types/keytar/keytar-tests.ts b/types/keytar/keytar-tests.ts index f6873838c2..18a7423450 100644 --- a/types/keytar/keytar-tests.ts +++ b/types/keytar/keytar-tests.ts @@ -8,6 +8,8 @@ let success: Promise; success = keytar.deletePassword('keytar-tests', 'username'); let password: Promise; - password = keytar.findPassword('keytar-tests'); password = keytar.getPassword('keytar-tests', 'username'); + +let credentials: Promise>; +credentials = keytar.findCredentials('keytar-tests');