/** * zynor/native — same API surface as `'zynor'`, but the `native` * provider routes through the bundled hickory-dns Rust binding instead * of Node's c-ares-backed `dns/promises` path. Drop-in replacement for * users who want the Rust DNS engine without any public config knob: * choosing the import path IS the choice. * * @author Olajide Mathew Ogundare * @company Yuniq Solutions Tech * @license MIT */ import { Zynor as BaseZynor } from './resolver.js'; import { EmailValidator as BaseEmailValidator } from './email/index.js'; import type { IResolver } from './interfaces/overloading.js'; import type { EmailEachOptions, EmailResponse, EmailResponseWithMx, ValidationConfig } from './email/index.js'; import type { ZynorConfig } from './types.js'; declare class Zynor extends BaseZynor { private readonly nativeEntryBrand; /** * Returns the Rust-backed {@link EmailValidator} (its `createDns` builds * a Rust {@link Zynor}). The inherited base static builds a Node-backed * validator, so without this override `validate`/`each` from * `'zynor/native'` would silently run through `node:dns/promises`. */ static createEmailValidator(config?: { options?: ValidationConfig; dns?: ZynorConfig; }): EmailValidator; /** Kept consistent with {@link createEmailValidator} so `Zynor.emailValidator` * (used by the static `validateBulk`/`each`) also resolves to the * Rust-backed singleton on this entry. */ static get emailValidator(): EmailValidator; } /** * Identical to {@link BaseEmailValidator} except the internal DNS * resolver is a {@link Zynor} — every DNS call zynor makes during * validation routes through the Rust binding. */ declare class EmailValidator extends BaseEmailValidator { static create(config?: { options?: ValidationConfig; dns?: ZynorConfig; }): EmailValidator; /** * Page-based streaming override of {@link BaseEmailValidator.each}. * * The default Node-backed `each` does one DNS lookup per email — millions of * native (napi) crossings for a large list, which can exhaust the host * runtime. This native variant processes a page at a time: it resolves * every unique domain in the page through a bounded batched FFI call when * the page fits current provider capacity, or through sequential bounded * chunks otherwise. It then validates the page from the warm resolver MX * cache (zero FFI per email) and emits the completed page. Awaiting * `onBatch` before the next page is natural backpressure — memory stays * bounded to a single page. * * Same surface and semantics as the base: `perPage`/`concurrency` * defaults, per-email errors become error-shaped results (never abort the * run), an `onBatch` throw aborts and rejects, and an aborted signal stops * cleanly without emitting a partial page. */ each(emails: string[], options: EmailEachOptions & { includeMx: true; }, onBatch: (batch: EmailResponseWithMx[]) => void | Promise): Promise; each(emails: string[], options: EmailEachOptions | undefined, onBatch: (batch: EmailResponse[]) => void | Promise): Promise; } export { Zynor, EmailValidator }; export type { ZynorConfig, ProviderConfig, ProviderName, ProviderSelectionOptions, RecordType, AnyRecord, RecordWithTtl, CaaRecord, MxRecord, NaptrRecord, SoaRecord, SrvRecord, TlsaRecord, ResolveOptions, ResolveWithTtlOptions, AbortOptions, } from './types.js'; export { LruCache } from './cache.js'; export type { CacheConfig } from './cache.js'; export { NoEnabledProvidersError, InvalidHostnameError, ProviderNotEnabledError, InvalidProviderError, } from './types.js'; export type { EmailBulkValidationOptions, EmailEachOptions, EmailResponse, EmailResponseWithMx, EmailValidationOptions, ValidationConfig, ValidateCacheEntry, } from './email/index.js'; export declare const resetDefaultResolver: () => void; export declare const setDefaultResolver: (resolver: Zynor) => void; export declare const resolve4: IResolver['resolve4']; export declare const resolve6: IResolver['resolve6']; export declare const resolveAny: IResolver['resolveAny']; export declare const resolveCaa: IResolver['resolveCaa']; export declare const resolveCname: IResolver['resolveCname']; export declare const resolveMx: IResolver['resolveMx']; export declare const resolveNaptr: IResolver['resolveNaptr']; export declare const resolveNs: IResolver['resolveNs']; export declare const resolvePtr: IResolver['resolvePtr']; export declare const resolveSoa: IResolver['resolveSoa']; export declare const resolveSrv: IResolver['resolveSrv']; export declare const resolveTlsa: IResolver['resolveTlsa']; export declare const resolveTxt: IResolver['resolveTxt']; export declare const reverse: IResolver['reverse']; export declare const resolve: IResolver['resolve']; export default Zynor;