UNPKG

email-domain-check

Version:

Comprehensive email domain validation library with DNS, MX, SMTP, DKIM, DMARC and MTA-STS support.

36 lines (35 loc) 1.85 kB
import type { MxRecord } from 'node:dns'; import { type Socket } from 'node:net'; import { type Target } from './address.js'; import { DNSResolver } from './resolver.js'; import type { CustomKVRecord, CustomRecord, DKIM1Record, DMARC1Record, SPF1Record, STSv1Record } from './txt-record.js'; import { TXTResult } from './txt-record.js'; import type { DomainCheckerOptions, ResolveOptions } from './types/options.js'; export type { MxRecord, Socket, DomainCheckerOptions, ResolveOptions }; export declare class DomainChecker { private options; private resolver; private failoverResolvers; constructor(options?: DomainCheckerOptions); private getParentDomain; getNsResolver(target: Target): Promise<DNSResolver>; hasMxRecord(target: Target): Promise<boolean>; private cleanMxRecord; getMxRecord(resolveOptions: ResolveOptions): Promise<MxRecord[]>; private resolveMxWithFailover; getNameServers(target: Target): Promise<string[]>; getSmtpConnection(target: Target): Promise<Socket | null>; private connectToSmtp; getCustomRecords(resolveOptions: ResolveOptions): Promise<CustomRecord[] | null>; getCustomKVRecord(resolveOptions: ResolveOptions, key: string): Promise<CustomKVRecord | null>; getAllKVRecords(resolveOptions: ResolveOptions): Promise<CustomKVRecord[] | null>; getSpfRecord(resolveOptions: ResolveOptions): Promise<SPF1Record | null>; private get_dkim_addr; getDkimRecord(resolveOptions: ResolveOptions): Promise<DKIM1Record | null>; private get_dmarc_addr; getDmarcRecord(resolveOptions: ResolveOptions): Promise<DMARC1Record | null>; private get_sts_addr; getStsRecord(resolveOptions: ResolveOptions): Promise<STSv1Record | null>; getTxtRecord(resolveOptions: ResolveOptions): Promise<TXTResult | null>; private getTxtRecordWithFailover; }