react-native-keychain/typings/react-native-keychain.d.ts
Steff 172368f2fd Protect the data stored in keychain by TouchId or Passcode (#65)
* First draft of implementing secured storage support (TouchId or Passcode)

* minor improvements

* improving the implementation; Support for AppDelegate-notification

* minor changes and improvements

* provding requested constant as usability feature; added documentation to canImplyAuthentication

* updating .d.ts-file

* when fetching stored items using the traditional modality (not TouchId or Passcode protected) ignore any items that need authentication.
2018-02-25 15:55:17 +01:00

74 lines
1.7 KiB
TypeScript

declare module 'react-native-keychain' {
export interface UserCredentials {
username: string;
password: string;
}
export interface SharedWebCredentials {
server: string;
username: string;
password: string;
}
export interface SecureOptions {
customPrompt?: string;
authenticationType?: string;
accessControl?: string;
}
function canImplyAuthentication(
options?: SecureOptions
): Promise<boolean>;
function setSecurePassword(
service: string,
username: string,
password: string,
options?: SecureOptions
): Promise<boolean>;
function getSecurePassword(
service: string,
options?: SecureOptions
): Promise<boolean | {service: string, username: string, password: string}>;
function setInternetCredentials(
server: string,
username: string,
password: string
): Promise<void>;
function getInternetCredentials(
server: string
): Promise<UserCredentials>;
function resetInternetCredentials(
server: string
): Promise<void>;
function setGenericPassword(
username: string,
password: string,
service?: string
): Promise<boolean>;
function getGenericPassword(
service?: string
): Promise<boolean | {service: string, username: string, password: string}>;
function resetGenericPassword(
service?: string
): Promise<boolean>
function requestSharedWebCredentials (
): Promise<SharedWebCredentials>;
function setSharedWebCredentials(
server: string,
username: string,
password: string
): Promise<void>;
}