2016-10-27 08:58:02 +00:00
|
|
|
declare module 'react-native-keychain' {
|
|
|
|
|
|
|
|
export interface UserCredentials {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
2017-01-10 22:07:11 +00:00
|
|
|
export interface SharedWebCredentials {
|
|
|
|
server: string;
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
2018-05-31 20:03:46 +00:00
|
|
|
export enum SecAccessible {
|
|
|
|
WHEN_UNLOCKED = "AccessibleWhenUnlocked",
|
|
|
|
AFTER_FIRST_UNLOCK = "AccessibleAfterFirstUnlock",
|
|
|
|
ALWAYS = "AccessibleAlways",
|
|
|
|
WHEN_PASSCODE_SET_THIS_DEVICE_ONLY = "AccessibleWhenPasscodeSetThisDeviceOnly",
|
|
|
|
WHEN_UNLOCKED_THIS_DEVICE_ONLY = "AccessibleWhenUnlockedThisDeviceOnly",
|
|
|
|
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY = "AccessibleAfterFirstUnlockThisDeviceOnly",
|
|
|
|
ALWAYS_THIS_DEVICE_ONLY = "AccessibleAlwaysThisDeviceOnly"
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum SecAccessControl {
|
|
|
|
USER_PRESENCE = "UserPresence",
|
|
|
|
BIOMETRY_ANY = "BiometryAny",
|
|
|
|
BIOMETRY_CURRENT_SET = "BiometryCurrentSet",
|
|
|
|
DEVICE_PASSCODE = "DevicePasscode",
|
|
|
|
APPLICATION_PASSWORD = "ApplicationPassword",
|
|
|
|
BIOMETRY_ANY_OR_DEVICE_PASSCODE = "BiometryAnyOrDevicePasscode",
|
|
|
|
BIOMETRY_CURRENT_SET_OR_DEVICE_PASSCODE = "BiometryCurrentSetOrDevicePasscode"
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum LAPolicy {
|
|
|
|
DEVICE_PASSCODE_OR_BIOMETRICS = "AuthenticationWithBiometricsDevicePasscode",
|
|
|
|
BIOMETRICS = "AuthenticationWithBiometrics"
|
|
|
|
}
|
|
|
|
|
2018-02-26 11:31:06 +00:00
|
|
|
export interface Options {
|
2018-05-31 20:03:46 +00:00
|
|
|
accessControl?: SecAccessControl;
|
2018-02-25 22:53:42 +00:00
|
|
|
accessGroup?: string;
|
2018-05-31 20:03:46 +00:00
|
|
|
accessible?: SecAccessible;
|
2018-02-25 22:42:15 +00:00
|
|
|
authenticationPrompt?: string;
|
2018-05-31 20:03:46 +00:00
|
|
|
authenticationType?: LAPolicy;
|
2018-02-25 22:53:42 +00:00
|
|
|
service?: string;
|
2018-02-25 14:55:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function canImplyAuthentication(
|
2018-02-26 11:31:06 +00:00
|
|
|
options?: Options
|
2018-02-25 14:55:17 +00:00
|
|
|
): Promise<boolean>;
|
|
|
|
|
2018-02-25 18:23:36 +00:00
|
|
|
function getSupportedBiometryType(
|
|
|
|
): Promise<string>;
|
|
|
|
|
2016-10-27 08:58:02 +00:00
|
|
|
function setInternetCredentials(
|
|
|
|
server: string,
|
|
|
|
username: string,
|
2018-02-26 11:31:06 +00:00
|
|
|
password: string,
|
|
|
|
options?: Options
|
2016-10-27 08:58:02 +00:00
|
|
|
): Promise<void>;
|
|
|
|
|
|
|
|
function getInternetCredentials(
|
2017-01-10 22:07:11 +00:00
|
|
|
server: string
|
2016-10-27 08:58:02 +00:00
|
|
|
): Promise<UserCredentials>;
|
|
|
|
|
|
|
|
function resetInternetCredentials(
|
2017-01-10 22:07:11 +00:00
|
|
|
server: string
|
2016-10-27 08:58:02 +00:00
|
|
|
): Promise<void>;
|
|
|
|
|
|
|
|
function setGenericPassword(
|
|
|
|
username: string,
|
|
|
|
password: string,
|
2018-02-26 11:31:06 +00:00
|
|
|
options?: Options
|
2017-03-17 19:59:35 +00:00
|
|
|
): Promise<boolean>;
|
2016-10-27 08:58:02 +00:00
|
|
|
|
2017-01-10 22:07:11 +00:00
|
|
|
function getGenericPassword(
|
2018-02-26 11:31:06 +00:00
|
|
|
options?: Options
|
2017-03-17 19:59:35 +00:00
|
|
|
): Promise<boolean | {service: string, username: string, password: string}>;
|
|
|
|
|
|
|
|
function resetGenericPassword(
|
2018-02-26 11:31:06 +00:00
|
|
|
options?: Options
|
2017-03-17 19:59:35 +00:00
|
|
|
): Promise<boolean>
|
2016-10-27 08:58:02 +00:00
|
|
|
|
2017-01-10 22:07:11 +00:00
|
|
|
function requestSharedWebCredentials (
|
|
|
|
): Promise<SharedWebCredentials>;
|
2016-10-27 08:58:02 +00:00
|
|
|
|
2017-01-10 22:07:11 +00:00
|
|
|
function setSharedWebCredentials(
|
|
|
|
server: string,
|
|
|
|
username: string,
|
|
|
|
password: string
|
|
|
|
): Promise<void>;
|
2016-10-27 08:58:02 +00:00
|
|
|
|
|
|
|
}
|