// ============================================================================
// TOMBA TYPES
// Browser-safe type definitions for the Tomba email discovery API (v1)
// ============================================================================

// ---------------------------------------------------------------------------
// emailFinder - GET /v1/email-finder?domain=&first_name=&last_name=
// ---------------------------------------------------------------------------

export interface EmailFinderParams {
  domain: string
  firstName: string
  lastName: string
}

export interface EmailFinderResult {
  email: string
  firstName: string
  lastName: string
  fullName: string
  position: string
  company: string
  country: string
  score: number
  verificationDate: string
  verificationStatus: string
  sources: Array<{
    uri: string
    extractedOn: string
    lastSeenOn: string
    stillOnPage: boolean
  }>
  [key: string]: unknown
}

// ---------------------------------------------------------------------------
// domainSearch - GET /v1/domain-search?domain=
// ---------------------------------------------------------------------------

export interface DomainSearchParams {
  domain: string
  limit?: number
  department?: string
  type?: 'personal' | 'generic'
}

export interface DomainSearchEmail {
  email: string
  firstName: string
  lastName: string
  fullName: string
  position: string
  department: string
  verificationDate: string
  verificationStatus: string
  sources: Array<{
    uri: string
    extractedOn: string
    lastSeenOn: string
    stillOnPage: boolean
  }>
}

export interface DomainSearchResult {
  organizationName: string
  domain: string
  emails: DomainSearchEmail[]
  [key: string]: unknown
}

// ---------------------------------------------------------------------------
// emailVerifier - GET /v1/email-verifier?email=
// ---------------------------------------------------------------------------

export interface EmailVerifierParams {
  email: string
}

export interface EmailVerifierResult {
  email: string
  result: string
  status: string
  score: number
  mxRecords: boolean
  smtpServer: boolean
  smtpCheck: boolean
  acceptAll: boolean
  block: boolean
  gibberish: boolean
  disposable: boolean
  webmail: boolean
  regex: boolean
  [key: string]: unknown
}
