UNPKG

findmailx

Version:

FindMailX API client

58 lines (54 loc) 1.58 kB
type VerifierStatus = "safe" | "risky" | "invalid"; type FinderStatus = "found" | "not_found"; interface VerificationResult { status: VerifierStatus; email?: string; score: number; disposable: boolean; webmail: boolean; } interface FinderResult { status: FinderStatus; email?: string; name?: string; domain?: string; verification?: VerificationResult; } interface FinderResponse { status: "success"; result?: FinderResult; } interface VerifierResponse { status: "success"; result?: VerificationResult; } interface FinderOptions { domain: string; fullName?: string; firstName?: string; lastName?: string; } interface ClientOptions { apiKey: string; baseUrl?: string; } declare class FindMailXClient { private readonly apiKey; private readonly baseUrl; constructor(options: ClientOptions); findEmail(options: FinderOptions): Promise<FinderResponse>; verifyEmail(email: string): Promise<VerifierResponse>; } declare class FindMailXError extends Error { constructor(message: string); } declare class AuthenticationError extends FindMailXError { constructor(); } declare class RateLimitError extends FindMailXError { constructor(); } declare class NoCreditsError extends FindMailXError { constructor(); } export { AuthenticationError, type ClientOptions, FindMailXClient, FindMailXError, type FinderOptions, type FinderResponse, type FinderResult, type FinderStatus, NoCreditsError, RateLimitError, type VerificationResult, type VerifierResponse, type VerifierStatus };