import { PermissionFunctionName } from './nativeModules'; export type PermissionStatus = 'notDetermined' | 'denied' | 'allowed'; export type PermissionAccess = 'read' | 'write' | 'access'; export type PermissionName = 'clipboard' | 'contacts' | 'photos' | 'geolocation' | 'camera' | 'microphone'; export interface PermissionErrorConstructorParams { methodName: PermissionFunctionName; message: string; } export interface PermissionErrorType extends Error { name: string; message: string; } export interface CreatePermissionFunctionOptions any> { handler: T; permission: { name: PermissionName; access: PermissionAccess; }; error: new () => PermissionErrorType; } export type RequestPermissionFunction = (permission: { name: PermissionName; access: PermissionAccess; }) => Promise>; export type InternalPermissionDialogFunction = (permission: { name: PermissionName; access: PermissionAccess; }) => Promise>; export type InternalGetPermissionFunction = (permission: { name: PermissionName; access: PermissionAccess; }) => Promise; export type PermissionDialogFunction = () => Promise>; export type GetPermissionFunction = () => Promise; export type PermissionFunctionWithDialog any> = T & { getPermission: GetPermissionFunction; openPermissionDialog: PermissionDialogFunction; };