import { NativeModules } from 'react-native';

type AliyunOnePassType = {
  init(secret: string): Promise<string>;
  checkEnvAvailable(): void;
  preLogin(): void;
  setAuthUIConfig(config: Object): Promise<string>;
  login(): Promise<string>;
  cancelLoading(): Promise<string>;
  quit(): Promise<string>;
  ON_VERIFY_RESULT: string;
  SUCCESS: string;
  ENTER_COMPLETE: string;
  ENTER_ERROR: string;
  AVAILABLE: string;
  NO_NET: string;
  TIMEOUT: string;
  GET_CODE_FAILED: string;
  CANCEL: string;
  SWITCH: string;
  LOGIN: string;
  CHECK: string;
  PRIVACY: string;
};

const { AliyunOnePass } = NativeModules;

export { AliyunOnePass };

export default AliyunOnePass as AliyunOnePassType;
