import { TurboModuleRegistry, type TurboModule } from 'react-native';

// verify 方法的返回结果
export interface VerifyResult {
  code: number;
  subCode: string;
  message: string;
}

export interface Spec extends TurboModule {
  // 返回 Promise 的 verify 方法
  verify(certifyId: string, extParams: Object): Promise<VerifyResult>;

  // 其他方法
  getMetaInfo(): Promise<string>;
  install(): Promise<void>;
  installWithOptions(options: Object): Promise<void>;
  setCustomUIConfig(param: string): Promise<string>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('IdvLibrary');
