import type { Handle, OnfidoApi as OnfidoBaseApi } from './Onfido'
import type { SdkParameters } from './shared/Public.types'

export type LoaderParameter = {
  /**
   * The version of the sdk to be loaded, by default v14 is used, which
   * is always fresh. Valid examples are 14 (default), 14.x (which pins the version to a minor version
   * and still accepts hotfixes or 14.x.y which pins it to exactly this version
   */
  version?: string
}

export type OnfidoApi = Omit<OnfidoBaseApi, 'init'> & {
  init: (parameter: SdkParameters & LoaderParameter) => Handle
  environment?: 'INSECURE'
}

export declare const Onfido: OnfidoApi
