import { BiometryTokenUpdateStatus, BiometryAuthRequestStatus } from '@telegram-apps/bridge'; import { AbortablePromise } from 'better-promises'; import { AuthenticateOptions, RequestAccessOptions, UpdateTokenOptions } from './types.js'; /** * @returns True if the biometry manager is supported. */ export declare const isSupported: import('@telegram-apps/signals').Computed; /** * Mounts the Biometry component. * @since Mini Apps v7.2 * @throws {FunctionNotAvailableError} The environment is unknown * @throws {FunctionNotAvailableError} The SDK is not initialized * @throws {FunctionNotAvailableError} The function is not supported * @example * if (mount.isAvailable()) { * await mount(); * } */ export declare const mount: import('../../wrappers/wrapSafe.js').SafeWrapped<(abortSignal: any) => AbortablePromise, true, never>; export declare const mountPromise: import('@telegram-apps/signals').Computed | undefined>, isMounting: import('@telegram-apps/signals').Computed; export declare const mountError: import('@telegram-apps/signals').Computed; export declare const _isMounted: import('@telegram-apps/signals').Signal, isMounted: import('@telegram-apps/signals').Computed; /** * Attempts to authenticate a user using biometrics and fetch a previously stored secure token. * @param options - method options. * @since Mini Apps v7.2 * @returns Token from the local secure storage saved previously or undefined. * @throws {FunctionNotAvailableError} The environment is unknown * @throws {FunctionNotAvailableError} The SDK is not initialized * @throws {FunctionNotAvailableError} The function is not supported * @throws {FunctionNotAvailableError} The parent component is not mounted * @throws {ConcurrentCallError} Biometry authentication is already in progress * @throws {NotAvailableError} Biometry is not available * @example * if (authenticate.isAvailable()) { * const { status, token } = await authenticate({ * reason: 'Authenticate to open wallet', * }); * } */ export declare const authenticate: import('../../wrappers/wrapSafe.js').SafeWrapped<(options?: AuthenticateOptions) => AbortablePromise<{ /** * Authentication status. */ status: BiometryAuthRequestStatus; /** * Token from the local secure storage saved previously. */ token?: string; }>, true, never>; export declare const authPromise: import('@telegram-apps/signals').Computed | undefined>, isAuthenticating: import('@telegram-apps/signals').Computed; export declare const authError: import('@telegram-apps/signals').Computed; /** * Opens the biometric access settings for bots. Useful when you need to request biometrics * access to users who haven't granted it yet. * * _Note that this method can be called only in response to user interaction with the Mini App * interface (e.g. a click inside the Mini App or on the main button)_. * @since Mini Apps v7.2 * @throws {FunctionNotAvailableError} The environment is unknown * @throws {FunctionNotAvailableError} The SDK is not initialized * @throws {FunctionNotAvailableError} The function is not supported * @example * if (openSettings.isAvailable()) { * openSettings(); * } */ export declare const openSettings: import('../../wrappers/wrapSafe.js').SafeWrapped<() => void, true, never>; /** * Requests permission to use biometrics. * @since Mini Apps v7.2 * @returns Promise with true, if access was granted. * @throws {FunctionNotAvailableError} The environment is unknown * @throws {FunctionNotAvailableError} The SDK is not initialized * @throws {FunctionNotAvailableError} The function is not supported * @throws {FunctionNotAvailableError} The parent component is not mounted * @throws {ConcurrentCallError} Biometry access request is already in progress * @throws {NotAvailableError} Biometry is not available * @example * if (requestAccess.isAvailable()) { * const accessGranted = await requestAccess({ * reason: 'Authenticate to open wallet', * }); * } */ export declare const requestAccess: import('../../wrappers/wrapSafe.js').SafeWrapped<(options?: RequestAccessOptions) => AbortablePromise, true, never>; export declare const requestAccessPromise: import('@telegram-apps/signals').Computed | undefined>, isRequestingAccess: import('@telegram-apps/signals').Computed; export declare const requestAccessError: import('@telegram-apps/signals').Computed; /** * Unmounts the component. */ export declare function unmount(): void; /** * Updates the biometric token in a secure storage on the device. * @since Mini Apps v7.2 * @returns Promise with `true`, if token was updated. * @throws {FunctionNotAvailableError} The environment is unknown * @throws {FunctionNotAvailableError} The SDK is not initialized * @throws {FunctionNotAvailableError} The function is not supported * @throws {FunctionNotAvailableError} The parent component is not mounted * @example Setting a new token * if (updateToken.isAvailable()) { * updateToken({ * token: 'abcdef', * }) * } * @example Deleting the token * if (updateToken.isAvailable()) { * updateToken(); * } */ export declare const updateToken: import('../../wrappers/wrapSafe.js').SafeWrapped<(options?: UpdateTokenOptions) => AbortablePromise, true, never>;