zynor 0.0.82 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3770 @@
1
+ import { AnyARecord, AnyAaaaRecord, AnyCnameRecord, AnyMxRecord, AnyNaptrRecord, AnyNsRecord, AnyPtrRecord, AnySoaRecord, AnySrvRecord, AnyTlsaRecord, AnyTxtRecord, CaaRecord, MxRecord, NaptrRecord, RecordWithTtl, ResolveOptions, ResolveWithTtlOptions, SoaRecord, SrvRecord, TlsaRecord } from 'node:dns';
2
+
3
+ export interface CacheConfig {
4
+ /** Enable/disable caching. Default: true */
5
+ enabled?: boolean;
6
+ /** Max entries per cache namespace. Default: 100_000 */
7
+ maxSize?: number;
8
+ /** DNS result TTL in ms. Default: 1_440_000 (24 min) */
9
+ dnsTtl?: number;
10
+ }
11
+ /**
12
+ * In-memory LRU cache with TTL-based expiry and size-based eviction.
13
+ * Uses Map insertion order for O(1) LRU tracking.
14
+ */
15
+ export declare class LruCache<T = any> {
16
+ private cache;
17
+ private readonly maxSize;
18
+ constructor(maxSize?: number);
19
+ /** Get a value by key. Returns undefined if missing or expired. Promotes to MRU on hit. */
20
+ get(key: string): T | undefined;
21
+ /** Set a value with a TTL in milliseconds. Evicts LRU entry if at capacity. */
22
+ set(key: string, data: T, ttlMs: number): void;
23
+ /** Check if a key exists and is not expired. */
24
+ has(key: string): boolean;
25
+ /** Delete a specific key. Returns true if the key existed. */
26
+ delete(key: string): boolean;
27
+ /** Remove all entries. */
28
+ clear(): void;
29
+ /** Number of entries (including potentially expired ones not yet evicted). */
30
+ get size(): number;
31
+ /** Iterate all non-expired keys. Lazily evicts expired entries. */
32
+ keys(): IterableIterator<string>;
33
+ /** Iterate all non-expired values. Lazily evicts expired entries. */
34
+ values(): IterableIterator<T>;
35
+ /** Iterate all non-expired [key, value] pairs. Lazily evicts expired entries. */
36
+ entries(): IterableIterator<[
37
+ string,
38
+ T
39
+ ]>;
40
+ /** Purge all expired entries. Returns number of entries removed. */
41
+ prune(): number;
42
+ /** Peek at a value without promoting it in the LRU order. */
43
+ peek(key: string): T | undefined;
44
+ /** Get remaining TTL in ms for a key. Returns 0 if missing or expired. */
45
+ ttl(key: string): number;
46
+ }
47
+ /**
48
+ * Configuration for a DNS provider's concurrency and rate limiting.
49
+ */
50
+ export interface ProviderConfig {
51
+ /**
52
+ * Concurrency and rate limiting configuration.
53
+ * Can be either a simple concurrency limit or include interval-based rate limiting.
54
+ */
55
+ limit?: {
56
+ /** Maximum number of concurrent requests */
57
+ concurrency: number;
58
+ /** Time interval in milliseconds for rate limiting */
59
+ interval?: number;
60
+ /** Maximum number of requests per interval */
61
+ intervalCap?: number;
62
+ /**
63
+ * Whether to carry over the concurrency count from the previous interval.
64
+ * @default false
65
+ */
66
+ carryoverConcurrencyCount?: boolean;
67
+ };
68
+ /**
69
+ * Whether this provider is enabled.
70
+ * @default true
71
+ */
72
+ enabled?: boolean;
73
+ }
74
+ /**
75
+ * Configuration for all DNS providers.
76
+ */
77
+ export interface ZynorConfig {
78
+ /** Configuration for the native Node.js DNS resolver */
79
+ native?: ProviderConfig;
80
+ /** Configuration for Google DNS-over-HTTPS */
81
+ google?: ProviderConfig;
82
+ /** Configuration for Cloudflare DNS-over-HTTPS */
83
+ cloudflare?: ProviderConfig;
84
+ /** Configuration for Quad9 DNS-over-HTTPS */
85
+ quad9?: ProviderConfig;
86
+ /** Configuration for DNS result caching */
87
+ cache?: CacheConfig;
88
+ }
89
+ /**
90
+ * Union type of all possible DNS record types returned by ANY queries.
91
+ */
92
+ export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTlsaRecord | AnyTxtRecord;
93
+ /**
94
+ * Available DNS provider names.
95
+ */
96
+ export type ProviderName = "native" | "google" | "cloudflare" | "quad9";
97
+ /**
98
+ * DNS record types supported by the resolver.
99
+ */
100
+ export type RecordType = "A" | "AAAA" | "ANY" | "CAA" | "CNAME" | "MX" | "NAPTR" | "NS" | "PTR" | "SOA" | "SRV" | "TLSA" | "TXT";
101
+ /**
102
+ * Error thrown when no providers are enabled.
103
+ */
104
+ export declare class NoEnabledProvidersError extends Error {
105
+ constructor();
106
+ }
107
+ /**
108
+ * Error thrown when an invalid hostname is provided.
109
+ */
110
+ export declare class InvalidHostnameError extends Error {
111
+ constructor(hostname: string);
112
+ }
113
+ /**
114
+ * Error thrown when a provider is not enabled.
115
+ */
116
+ export declare class ProviderNotEnabledError extends Error {
117
+ constructor(provider: string);
118
+ }
119
+ /**
120
+ * Error thrown when an invalid provider name is specified.
121
+ */
122
+ export declare class InvalidProviderError extends Error {
123
+ constructor(provider: string);
124
+ }
125
+ /**
126
+ * Options for aborting/timing out DNS operations.
127
+ */
128
+ export interface AbortOptions {
129
+ /** AbortSignal to cancel the operation (queue wait + fetch). */
130
+ signal?: AbortSignal;
131
+ /** Timeout in milliseconds for the entire operation (queue wait + fetch). */
132
+ timeout?: number;
133
+ }
134
+ export interface IResolver {
135
+ /**
136
+ * Resolves DNS records for a hostname without specifying record type (defaults to A records)
137
+ * @param hostname - The hostname to resolve
138
+ * @returns Promise resolving to an array of IPv4 addresses
139
+ */
140
+ resolve(hostname: string): Promise<string[]>;
141
+ /**
142
+ * Resolves DNS records for a hostname without specifying record type but with a specific provider
143
+ * @param hostname - The hostname to resolve
144
+ * @param provider - The DNS provider to use
145
+ * @returns Promise resolving to an array of IPv4 addresses
146
+ */
147
+ resolve(hostname: string, provider: ProviderName): Promise<string[]>;
148
+ /**
149
+ * Resolves A records for a hostname
150
+ * @param hostname - The hostname to resolve
151
+ * @param rrtype - DNS record type "A"
152
+ * @returns Promise resolving to an array of IPv4 addresses
153
+ */
154
+ resolve(hostname: string, rrtype: "A"): Promise<string[]>;
155
+ /**
156
+ * Resolves A records for a hostname with a specific provider
157
+ * @param hostname - The hostname to resolve
158
+ * @param rrtype - DNS record type "A"
159
+ * @param provider - The DNS provider to use
160
+ * @returns Promise resolving to an array of IPv4 addresses
161
+ */
162
+ resolve(hostname: string, rrtype: "A", provider: ProviderName): Promise<string[]>;
163
+ /**
164
+ * Resolves AAAA records for a hostname
165
+ * @param hostname - The hostname to resolve
166
+ * @param rrtype - DNS record type "AAAA"
167
+ * @returns Promise resolving to an array of IPv6 addresses
168
+ */
169
+ resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
170
+ /**
171
+ * Resolves AAAA records for a hostname with a specific provider
172
+ * @param hostname - The hostname to resolve
173
+ * @param rrtype - DNS record type "AAAA"
174
+ * @param provider - The DNS provider to use
175
+ * @returns Promise resolving to an array of IPv6 addresses
176
+ */
177
+ resolve(hostname: string, rrtype: "AAAA", provider: ProviderName): Promise<string[]>;
178
+ /**
179
+ * Resolves ANY records for a hostname
180
+ * @param hostname - The hostname to resolve
181
+ * @param rrtype - DNS record type "ANY"
182
+ * @returns Promise resolving to an array of any DNS records
183
+ */
184
+ resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
185
+ /**
186
+ * Resolves ANY records for a hostname with a specific provider
187
+ * @param hostname - The hostname to resolve
188
+ * @param rrtype - DNS record type "ANY"
189
+ * @param provider - The DNS provider to use
190
+ * @returns Promise resolving to an array of any DNS records
191
+ */
192
+ resolve(hostname: string, rrtype: "ANY", provider: ProviderName): Promise<AnyRecord[]>;
193
+ /**
194
+ * Resolves CAA records for a hostname
195
+ * @param hostname - The hostname to resolve
196
+ * @param rrtype - DNS record type "CAA"
197
+ * @returns Promise resolving to an array of CAA records
198
+ */
199
+ resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
200
+ /**
201
+ * Resolves CAA records for a hostname with a specific provider
202
+ * @param hostname - The hostname to resolve
203
+ * @param rrtype - DNS record type "CAA"
204
+ * @param provider - The DNS provider to use
205
+ * @returns Promise resolving to an array of CAA records
206
+ */
207
+ resolve(hostname: string, rrtype: "CAA", provider: ProviderName): Promise<CaaRecord[]>;
208
+ /**
209
+ * Resolves CNAME records for a hostname
210
+ * @param hostname - The hostname to resolve
211
+ * @param rrtype - DNS record type "CNAME"
212
+ * @returns Promise resolving to an array of canonical names
213
+ */
214
+ resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
215
+ /**
216
+ * Resolves CNAME records for a hostname with a specific provider
217
+ * @param hostname - The hostname to resolve
218
+ * @param rrtype - DNS record type "CNAME"
219
+ * @param provider - The DNS provider to use
220
+ * @returns Promise resolving to an array of canonical names
221
+ */
222
+ resolve(hostname: string, rrtype: "CNAME", provider: ProviderName): Promise<string[]>;
223
+ /**
224
+ * Resolves MX records for a hostname
225
+ * @param hostname - The hostname to resolve
226
+ * @param rrtype - DNS record type "MX"
227
+ * @returns Promise resolving to an array of mail exchange records
228
+ */
229
+ resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
230
+ /**
231
+ * Resolves MX records for a hostname with a specific provider
232
+ * @param hostname - The hostname to resolve
233
+ * @param rrtype - DNS record type "MX"
234
+ * @param provider - The DNS provider to use
235
+ * @returns Promise resolving to an array of mail exchange records
236
+ */
237
+ resolve(hostname: string, rrtype: "MX", provider: ProviderName): Promise<MxRecord[]>;
238
+ /**
239
+ * Resolves NAPTR records for a hostname
240
+ * @param hostname - The hostname to resolve
241
+ * @param rrtype - DNS record type "NAPTR"
242
+ * @returns Promise resolving to an array of NAPTR records
243
+ */
244
+ resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
245
+ /**
246
+ * Resolves NAPTR records for a hostname with a specific provider
247
+ * @param hostname - The hostname to resolve
248
+ * @param rrtype - DNS record type "NAPTR"
249
+ * @param provider - The DNS provider to use
250
+ * @returns Promise resolving to an array of NAPTR records
251
+ */
252
+ resolve(hostname: string, rrtype: "NAPTR", provider: ProviderName): Promise<NaptrRecord[]>;
253
+ /**
254
+ * Resolves NS records for a hostname
255
+ * @param hostname - The hostname to resolve
256
+ * @param rrtype - DNS record type "NS"
257
+ * @returns Promise resolving to an array of nameserver hostnames
258
+ */
259
+ resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
260
+ /**
261
+ * Resolves NS records for a hostname with a specific provider
262
+ * @param hostname - The hostname to resolve
263
+ * @param rrtype - DNS record type "NS"
264
+ * @param provider - The DNS provider to use
265
+ * @returns Promise resolving to an array of nameserver hostnames
266
+ */
267
+ resolve(hostname: string, rrtype: "NS", provider: ProviderName): Promise<string[]>;
268
+ /**
269
+ * Resolves PTR records for a hostname
270
+ * @param hostname - The hostname to resolve
271
+ * @param rrtype - DNS record type "PTR"
272
+ * @returns Promise resolving to an array of pointer records
273
+ */
274
+ resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
275
+ /**
276
+ * Resolves PTR records for a hostname with a specific provider
277
+ * @param hostname - The hostname to resolve
278
+ * @param rrtype - DNS record type "PTR"
279
+ * @param provider - The DNS provider to use
280
+ * @returns Promise resolving to an array of pointer records
281
+ */
282
+ resolve(hostname: string, rrtype: "PTR", provider: ProviderName): Promise<string[]>;
283
+ /**
284
+ * Resolves SOA record for a hostname
285
+ * @param hostname - The hostname to resolve
286
+ * @param rrtype - DNS record type "SOA"
287
+ * @returns Promise resolving to a start of authority record
288
+ */
289
+ resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
290
+ /**
291
+ * Resolves SOA record for a hostname with a specific provider
292
+ * @param hostname - The hostname to resolve
293
+ * @param rrtype - DNS record type "SOA"
294
+ * @param provider - The DNS provider to use
295
+ * @returns Promise resolving to a start of authority record
296
+ */
297
+ resolve(hostname: string, rrtype: "SOA", provider: ProviderName): Promise<SoaRecord>;
298
+ /**
299
+ * Resolves SRV records for a hostname
300
+ * @param hostname - The hostname to resolve
301
+ * @param rrtype - DNS record type "SRV"
302
+ * @returns Promise resolving to an array of service records
303
+ */
304
+ resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
305
+ /**
306
+ * Resolves SRV records for a hostname with a specific provider
307
+ * @param hostname - The hostname to resolve
308
+ * @param rrtype - DNS record type "SRV"
309
+ * @param provider - The DNS provider to use
310
+ * @returns Promise resolving to an array of service records
311
+ */
312
+ resolve(hostname: string, rrtype: "SRV", provider: ProviderName): Promise<SrvRecord[]>;
313
+ /**
314
+ * Resolves TLSA records for a hostname
315
+ * @param hostname - The hostname to resolve
316
+ * @param rrtype - DNS record type "TLSA"
317
+ * @returns Promise resolving to an array of TLSA records
318
+ */
319
+ resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
320
+ /**
321
+ * Resolves TLSA records for a hostname with a specific provider
322
+ * @param hostname - The hostname to resolve
323
+ * @param rrtype - DNS record type "TLSA"
324
+ * @param provider - The DNS provider to use
325
+ * @returns Promise resolving to an array of TLSA records
326
+ */
327
+ resolve(hostname: string, rrtype: "TLSA", provider: ProviderName): Promise<TlsaRecord[]>;
328
+ /**
329
+ * Resolves TXT records for a hostname
330
+ * @param hostname - The hostname to resolve
331
+ * @param rrtype - DNS record type "TXT"
332
+ * @returns Promise resolving to an array of text record arrays
333
+ */
334
+ resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
335
+ /**
336
+ * Resolves TXT records for a hostname with a specific provider
337
+ * @param hostname - The hostname to resolve
338
+ * @param rrtype - DNS record type "TXT"
339
+ * @param provider - The DNS provider to use
340
+ * @returns Promise resolving to an array of text record arrays
341
+ */
342
+ resolve(hostname: string, rrtype: "TXT", provider: ProviderName): Promise<string[][]>;
343
+ /**
344
+ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
345
+ * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
346
+ * @since v10.6.0
347
+ * @param hostname Host name to resolve.
348
+ */
349
+ resolve4(hostname: string): Promise<string[]>;
350
+ resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
351
+ resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
352
+ /**
353
+ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname` using a specific provider.
354
+ * @param hostname Host name to resolve.
355
+ * @param provider The DNS provider to use for resolution.
356
+ */
357
+ resolve4(hostname: string, provider: ProviderName): Promise<string[]>;
358
+ /**
359
+ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname` with TTL using a specific provider.
360
+ * @param hostname Host name to resolve.
361
+ * @param options Resolution options with TTL enabled.
362
+ * @param provider The DNS provider to use for resolution.
363
+ */
364
+ resolve4(hostname: string, options: ResolveWithTtlOptions, provider: ProviderName): Promise<RecordWithTtl[]>;
365
+ /**
366
+ * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname` with options using a specific provider.
367
+ * @param hostname Host name to resolve.
368
+ * @param options Resolution options.
369
+ * @param provider The DNS provider to use for resolution.
370
+ */
371
+ resolve4(hostname: string, options: ResolveOptions, provider: ProviderName): Promise<string[] | RecordWithTtl[]>;
372
+ resolve4(hostname: string, options: AbortOptions): Promise<string[]>;
373
+ resolve4(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
374
+ resolve4(hostname: string, options: ResolveOptions & AbortOptions): Promise<string[] | RecordWithTtl[]>;
375
+ resolve4(hostname: string, options: ResolveOptions & AbortOptions, provider: ProviderName): Promise<string[] | RecordWithTtl[]>;
376
+ /**
377
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6
378
+ * addresses.
379
+ * @since v10.6.0
380
+ * @param hostname Host name to resolve.
381
+ */
382
+ resolve6(hostname: string): Promise<string[]>;
383
+ resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
384
+ resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
385
+ /**
386
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname` using a specific provider.
387
+ * @param hostname Host name to resolve.
388
+ * @param provider The DNS provider to use for resolution.
389
+ */
390
+ resolve6(hostname: string, provider: ProviderName): Promise<string[]>;
391
+ /**
392
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname` with TTL using a specific provider.
393
+ * @param hostname Host name to resolve.
394
+ * @param options Resolution options with TTL enabled.
395
+ * @param provider The DNS provider to use for resolution.
396
+ */
397
+ resolve6(hostname: string, options: ResolveWithTtlOptions, provider: ProviderName): Promise<RecordWithTtl[]>;
398
+ /**
399
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname` with options using a specific provider.
400
+ * @param hostname Host name to resolve.
401
+ * @param options Resolution options.
402
+ * @param provider The DNS provider to use for resolution.
403
+ */
404
+ resolve6(hostname: string, options: ResolveOptions, provider: ProviderName): Promise<string[] | RecordWithTtl[]>;
405
+ resolve6(hostname: string, options: AbortOptions): Promise<string[]>;
406
+ resolve6(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
407
+ resolve6(hostname: string, options: ResolveOptions & AbortOptions): Promise<string[] | RecordWithTtl[]>;
408
+ resolve6(hostname: string, options: ResolveOptions & AbortOptions, provider: ProviderName): Promise<string[] | RecordWithTtl[]>;
409
+ /**
410
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
411
+ * On success, the `Promise` is resolved with an array containing various types of
412
+ * records. Each object has a property `type` that indicates the type of the
413
+ * current record. And depending on the `type`, additional properties will be
414
+ * present on the object:
415
+ *
416
+ * <omitted>
417
+ *
418
+ * Here is an example of the result object:
419
+ *
420
+ * ```js
421
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
422
+ * { type: 'CNAME', value: 'example.com' },
423
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
424
+ * { type: 'NS', value: 'ns1.example.com' },
425
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
426
+ * { type: 'SOA',
427
+ * nsname: 'ns1.example.com',
428
+ * hostmaster: 'admin.example.com',
429
+ * serial: 156696742,
430
+ * refresh: 900,
431
+ * retry: 900,
432
+ * expire: 1800,
433
+ * minttl: 60 } ]
434
+ * ```
435
+ * @since v10.6.0
436
+ */
437
+ resolveAny(hostname: string): Promise<AnyRecord[]>;
438
+ /**
439
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query) using a specific provider.
440
+ * @param hostname Host name to resolve.
441
+ * @param provider The DNS provider to use for resolution.
442
+ */
443
+ resolveAny(hostname: string, provider: ProviderName): Promise<AnyRecord[]>;
444
+ resolveAny(hostname: string, options: AbortOptions): Promise<AnyRecord[]>;
445
+ resolveAny(hostname: string, options: AbortOptions, provider: ProviderName): Promise<AnyRecord[]>;
446
+ /**
447
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
448
+ * the `Promise` is resolved with an array of objects containing available
449
+ * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
450
+ * @since v15.0.0, v14.17.0
451
+ */
452
+ resolveCaa(hostname: string): Promise<CaaRecord[]>;
453
+ /**
454
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname` using a specific provider.
455
+ * @param hostname Host name to resolve.
456
+ * @param provider The DNS provider to use for resolution.
457
+ */
458
+ resolveCaa(hostname: string, provider: ProviderName): Promise<CaaRecord[]>;
459
+ resolveCaa(hostname: string, options: AbortOptions): Promise<CaaRecord[]>;
460
+ resolveCaa(hostname: string, options: AbortOptions, provider: ProviderName): Promise<CaaRecord[]>;
461
+ /**
462
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
463
+ * the `Promise` is resolved with an array of canonical name records available for
464
+ * the `hostname` (e.g. `['bar.example.com']`).
465
+ * @since v10.6.0
466
+ */
467
+ resolveCname(hostname: string): Promise<string[]>;
468
+ /**
469
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname` using a specific provider.
470
+ * @param hostname Host name to resolve.
471
+ * @param provider The DNS provider to use for resolution.
472
+ */
473
+ resolveCname(hostname: string, provider: ProviderName): Promise<string[]>;
474
+ resolveCname(hostname: string, options: AbortOptions): Promise<string[]>;
475
+ resolveCname(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
476
+ /**
477
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects
478
+ * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
479
+ * @since v10.6.0
480
+ */
481
+ resolveMx(hostname: string): Promise<MxRecord[]>;
482
+ /**
483
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname` using a specific provider.
484
+ * @param hostname Host name to resolve.
485
+ * @param provider The DNS provider to use for resolution.
486
+ */
487
+ resolveMx(hostname: string, provider: ProviderName): Promise<MxRecord[]>;
488
+ resolveMx(hostname: string, options: AbortOptions): Promise<MxRecord[]>;
489
+ resolveMx(hostname: string, options: AbortOptions, provider: ProviderName): Promise<MxRecord[]>;
490
+ /**
491
+ * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array
492
+ * of objects with the following properties:
493
+ *
494
+ * * `flags`
495
+ * * `service`
496
+ * * `regexp`
497
+ * * `replacement`
498
+ * * `order`
499
+ * * `preference`
500
+ *
501
+ * ```js
502
+ * {
503
+ * flags: 's',
504
+ * service: 'SIP+D2U',
505
+ * regexp: '',
506
+ * replacement: '_sip._udp.example.com',
507
+ * order: 30,
508
+ * preference: 100
509
+ * }
510
+ * ```
511
+ * @since v10.6.0
512
+ */
513
+ resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
514
+ /**
515
+ * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname` using a specific provider.
516
+ * @param hostname Host name to resolve.
517
+ * @param provider The DNS provider to use for resolution.
518
+ */
519
+ resolveNaptr(hostname: string, provider: ProviderName): Promise<NaptrRecord[]>;
520
+ resolveNaptr(hostname: string, options: AbortOptions): Promise<NaptrRecord[]>;
521
+ resolveNaptr(hostname: string, options: AbortOptions, provider: ProviderName): Promise<NaptrRecord[]>;
522
+ /**
523
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server
524
+ * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
525
+ * @since v10.6.0
526
+ */
527
+ resolveNs(hostname: string): Promise<string[]>;
528
+ /**
529
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname` using a specific provider.
530
+ * @param hostname Host name to resolve.
531
+ * @param provider The DNS provider to use for resolution.
532
+ */
533
+ resolveNs(hostname: string, provider: ProviderName): Promise<string[]>;
534
+ resolveNs(hostname: string, options: AbortOptions): Promise<string[]>;
535
+ resolveNs(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
536
+ /**
537
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings
538
+ * containing the reply records.
539
+ * @since v10.6.0
540
+ */
541
+ resolvePtr(hostname: string): Promise<string[]>;
542
+ /**
543
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname` using a specific provider.
544
+ * @param hostname Host name to resolve.
545
+ * @param provider The DNS provider to use for resolution.
546
+ */
547
+ resolvePtr(hostname: string, provider: ProviderName): Promise<string[]>;
548
+ resolvePtr(hostname: string, options: AbortOptions): Promise<string[]>;
549
+ resolvePtr(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
550
+ /**
551
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
552
+ * the `hostname`. On success, the `Promise` is resolved with an object with the
553
+ * following properties:
554
+ *
555
+ * * `nsname`
556
+ * * `hostmaster`
557
+ * * `serial`
558
+ * * `refresh`
559
+ * * `retry`
560
+ * * `expire`
561
+ * * `minttl`
562
+ *
563
+ * ```js
564
+ * {
565
+ * nsname: 'ns.example.com',
566
+ * hostmaster: 'root.example.com',
567
+ * serial: 2013101809,
568
+ * refresh: 10000,
569
+ * retry: 2400,
570
+ * expire: 604800,
571
+ * minttl: 3600
572
+ * }
573
+ * ```
574
+ * @since v10.6.0
575
+ */
576
+ resolveSoa(hostname: string): Promise<SoaRecord>;
577
+ /**
578
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for the `hostname` using a specific provider.
579
+ * @param hostname Host name to resolve.
580
+ * @param provider The DNS provider to use for resolution.
581
+ */
582
+ resolveSoa(hostname: string, provider: ProviderName): Promise<SoaRecord>;
583
+ resolveSoa(hostname: string, options: AbortOptions): Promise<SoaRecord>;
584
+ resolveSoa(hostname: string, options: AbortOptions, provider: ProviderName): Promise<SoaRecord>;
585
+ /**
586
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with
587
+ * the following properties:
588
+ *
589
+ * * `priority`
590
+ * * `weight`
591
+ * * `port`
592
+ * * `name`
593
+ *
594
+ * ```js
595
+ * {
596
+ * priority: 10,
597
+ * weight: 5,
598
+ * port: 21223,
599
+ * name: 'service.example.com'
600
+ * }
601
+ * ```
602
+ * @since v10.6.0
603
+ */
604
+ resolveSrv(hostname: string): Promise<SrvRecord[]>;
605
+ /**
606
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname` using a specific provider.
607
+ * @param hostname Host name to resolve.
608
+ * @param provider The DNS provider to use for resolution.
609
+ */
610
+ resolveSrv(hostname: string, provider: ProviderName): Promise<SrvRecord[]>;
611
+ resolveSrv(hostname: string, options: AbortOptions): Promise<SrvRecord[]>;
612
+ resolveSrv(hostname: string, options: AbortOptions, provider: ProviderName): Promise<SrvRecord[]>;
613
+ /**
614
+ * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
615
+ * the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
616
+ * with these properties:
617
+ *
618
+ * * `certUsage`
619
+ * * `selector`
620
+ * * `match`
621
+ * * `data`
622
+ *
623
+ * ```js
624
+ * {
625
+ * certUsage: 3,
626
+ * selector: 1,
627
+ * match: 1,
628
+ * data: [ArrayBuffer]
629
+ * }
630
+ * ```
631
+ * @since v23.9.0, v22.15.0
632
+ */
633
+ resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
634
+ /**
635
+ * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for the `hostname` using a specific provider.
636
+ * @param hostname Host name to resolve.
637
+ * @param provider The DNS provider to use for resolution.
638
+ */
639
+ resolveTlsa(hostname: string, provider: ProviderName): Promise<TlsaRecord[]>;
640
+ resolveTlsa(hostname: string, options: AbortOptions): Promise<TlsaRecord[]>;
641
+ resolveTlsa(hostname: string, options: AbortOptions, provider: ProviderName): Promise<TlsaRecord[]>;
642
+ /**
643
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
644
+ * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
645
+ * one record. Depending on the use case, these could be either joined together or
646
+ * treated separately.
647
+ * @since v10.6.0
648
+ */
649
+ resolveTxt(hostname: string): Promise<string[][]>;
650
+ /**
651
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname` using a specific provider.
652
+ * @param hostname Host name to resolve.
653
+ * @param provider The DNS provider to use for resolution.
654
+ */
655
+ resolveTxt(hostname: string, provider: ProviderName): Promise<string[][]>;
656
+ resolveTxt(hostname: string, options: AbortOptions): Promise<string[][]>;
657
+ resolveTxt(hostname: string, options: AbortOptions, provider: ProviderName): Promise<string[][]>;
658
+ /**
659
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
660
+ * array of host names.
661
+ *
662
+ * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
663
+ * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
664
+ * @since v10.6.0
665
+ */
666
+ reverse(ip: string): Promise<string[]>;
667
+ /**
668
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of host names using a specific provider.
669
+ * @param ip IPv4 or IPv6 address to reverse resolve.
670
+ * @param provider The DNS provider to use for resolution.
671
+ */
672
+ reverse(ip: string, provider: ProviderName): Promise<string[]>;
673
+ reverse(ip: string, options: AbortOptions): Promise<string[]>;
674
+ reverse(ip: string, options: AbortOptions, provider: ProviderName): Promise<string[]>;
675
+ }
676
+ declare class NativeProvider {
677
+ private queue;
678
+ private config;
679
+ /** Injected hickory binding, or null for the libuv path. Provided by the
680
+ * `'zynor/native'` entry; never loaded here. */
681
+ private rustBinding;
682
+ /**
683
+ * Creates a new native DNS provider instance.
684
+ *
685
+ * @param config - Provider config (concurrency, rate limiting, enabled).
686
+ * @param runtime - Internal: `rust` is the hickory binding injected by the
687
+ * `'zynor/native'` entry. When present, MX/A/AAAA/etc. route through it;
688
+ * when absent, everything uses libuv. Not part of the public surface.
689
+ */
690
+ constructor(config?: ProviderConfig);
691
+ /**
692
+ * Updates the provider configuration.
693
+ */
694
+ updateConfig(config: ProviderConfig): void;
695
+ get enabled(): boolean;
696
+ get queueSize(): number;
697
+ get concurrency(): number;
698
+ get isFull(): boolean;
699
+ /** Returns the injected hickory binding, or null for the libuv path.
700
+ * No loading happens here — the `'zynor/native'` entry injects (or
701
+ * refuses to construct, if the binary is missing). */
702
+ private rust;
703
+ /**
704
+ * Executes a function through the queue with abort/timeout support.
705
+ */
706
+ private executeQueued;
707
+ /**
708
+ * @internal Bypasses PQueue and intervalCap. Reserved for the validator
709
+ * hot path. Dispatches to Rust when `useRust` is on (and binary loaded);
710
+ * otherwise to `dns.resolve`. Both paths remain abort-aware.
711
+ */
712
+ _resolveDirect<T>(hostname: string, type: RecordType, options?: AbortOptions): Promise<T>;
713
+ /**
714
+ * Resolves A records for a hostname. TTL-aware variants stay on libuv.
715
+ */
716
+ resolve4(hostname: string): Promise<string[]>;
717
+ resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
718
+ /** Resolves AAAA records for a hostname. TTL-aware variants stay on libuv. */
719
+ resolve6(hostname: string): Promise<string[]>;
720
+ resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
721
+ /** ANY records — Rust binding's shape doesn't mirror libuv's tagged union,
722
+ * so we always go through libuv. */
723
+ resolveAny(hostname: string, options?: AbortOptions): Promise<AnyRecord[]>;
724
+ resolveCaa(hostname: string, options?: AbortOptions): Promise<CaaRecord[]>;
725
+ resolveCname(hostname: string, options?: AbortOptions): Promise<string[]>;
726
+ resolveMx(hostname: string, options?: AbortOptions): Promise<MxRecord[]>;
727
+ resolveNaptr(hostname: string, options?: AbortOptions): Promise<NaptrRecord[]>;
728
+ resolveNs(hostname: string, options?: AbortOptions): Promise<string[]>;
729
+ resolvePtr(hostname: string, options?: AbortOptions): Promise<string[]>;
730
+ /** SOA. Rust returns `RustSoaRecord | null`; libuv throws on missing.
731
+ * Bridge: if Rust returns null, throw to match libuv contract. */
732
+ resolveSoa(hostname: string, options?: AbortOptions): Promise<SoaRecord>;
733
+ resolveSrv(hostname: string, options?: AbortOptions): Promise<SrvRecord[]>;
734
+ resolveTlsa(hostname: string, options?: AbortOptions): Promise<TlsaRecord[]>;
735
+ resolveTxt(hostname: string, options?: AbortOptions): Promise<string[][]>;
736
+ reverse(ip: string, options?: AbortOptions): Promise<string[]>;
737
+ /**
738
+ * Generic resolve method. Dispatches to the typed methods so that the
739
+ * Rust path is honored consistently — calling `resolve('gmail.com', 'MX')`
740
+ * with `useRust: true` goes through hickory just like `resolveMx` would.
741
+ */
742
+ resolve(hostname: string): Promise<string[]>;
743
+ resolve(hostname: string, rrtype: "A"): Promise<string[]>;
744
+ resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
745
+ resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
746
+ resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
747
+ resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
748
+ resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
749
+ resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
750
+ resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
751
+ resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
752
+ resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
753
+ resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
754
+ resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
755
+ resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
756
+ }
757
+ declare const EmailProviders: readonly [
758
+ {
759
+ readonly name: "Gmail";
760
+ readonly domains: readonly [
761
+ "@gmail.com",
762
+ "@googlemail.com"
763
+ ];
764
+ },
765
+ {
766
+ readonly name: "Outlook";
767
+ readonly domains: readonly [
768
+ "@outlook.com",
769
+ "@outlook.com.au",
770
+ "@outlook.com.br",
771
+ "@outlook.cl",
772
+ "@outlook.cz",
773
+ "@outlook.de",
774
+ "@outlook.dk",
775
+ "@outlook.es",
776
+ "@outlook.fr",
777
+ "@outlook.hu",
778
+ "@outlook.ie",
779
+ "@outlook.in",
780
+ "@outlook.it",
781
+ "@outlook.jp",
782
+ "@outlook.kr",
783
+ "@outlook.lv",
784
+ "@outlook.my",
785
+ "@outlook.ph",
786
+ "@outlook.pt",
787
+ "@outlook.sa",
788
+ "@outlook.sg",
789
+ "@outlook.sk",
790
+ "@outlook.co.id",
791
+ "@outlook.co.th",
792
+ "@hotmail.com",
793
+ "@hotmail.com.ar",
794
+ "@hotmail.com.au",
795
+ "@hotmail.com.br",
796
+ "@hotmail.co.uk",
797
+ "@hotmail.de",
798
+ "@hotmail.es",
799
+ "@hotmail.fr",
800
+ "@hotmail.gr",
801
+ "@hotmail.it",
802
+ "@hotmail.jp",
803
+ "@hotmail.nl",
804
+ "@hotmail.no",
805
+ "@hotmail.se",
806
+ "@live.com",
807
+ "@live.com.ar",
808
+ "@live.com.au",
809
+ "@live.com.mx",
810
+ "@live.co.uk",
811
+ "@live.ca",
812
+ "@live.cl",
813
+ "@live.cn",
814
+ "@live.de",
815
+ "@live.dk",
816
+ "@live.fr",
817
+ "@live.it",
818
+ "@live.jp",
819
+ "@live.nl",
820
+ "@live.no",
821
+ "@live.ru",
822
+ "@live.se",
823
+ "@msn.com"
824
+ ];
825
+ },
826
+ {
827
+ readonly name: "Yahoo";
828
+ readonly domains: readonly [
829
+ "@yahoo.com",
830
+ "@yahoo.co.uk",
831
+ "@yahoo.fr",
832
+ "@yahoo.com.br",
833
+ "@yahoo.co.in",
834
+ "@yahoo.es",
835
+ "@yahoo.it",
836
+ "@yahoo.de",
837
+ "@yahoo.in",
838
+ "@yahoo.ca",
839
+ "@yahoo.com.au",
840
+ "@yahoo.co.jp",
841
+ "@yahoo.com.ar",
842
+ "@yahoo.com.mx",
843
+ "@yahoo.co.id",
844
+ "@yahoo.com.sg",
845
+ "@ymail.com",
846
+ "@rocketmail.com",
847
+ "@yahoo.at",
848
+ "@yahoo.be",
849
+ "@yahoo.bg",
850
+ "@yahoo.cl",
851
+ "@yahoo.co.hu",
852
+ "@yahoo.co.kr",
853
+ "@yahoo.co.nz",
854
+ "@yahoo.co.th",
855
+ "@yahoo.co.za",
856
+ "@yahoo.com.hk",
857
+ "@yahoo.com.hr",
858
+ "@yahoo.com.my",
859
+ "@yahoo.com.pe",
860
+ "@yahoo.com.ph",
861
+ "@yahoo.com.tr",
862
+ "@yahoo.com.tw",
863
+ "@yahoo.com.ua",
864
+ "@yahoo.com.ve",
865
+ "@yahoo.com.vn",
866
+ "@yahoo.cz",
867
+ "@yahoo.dk",
868
+ "@yahoo.ee",
869
+ "@yahoo.fi",
870
+ "@yahoo.gr",
871
+ "@yahoo.hr",
872
+ "@yahoo.hu",
873
+ "@yahoo.ie",
874
+ "@yahoo.lt",
875
+ "@yahoo.lv",
876
+ "@yahoo.nl",
877
+ "@yahoo.no",
878
+ "@yahoo.pl",
879
+ "@yahoo.pt",
880
+ "@yahoo.ro",
881
+ "@yahoo.rs",
882
+ "@yahoo.se",
883
+ "@yahoo.si",
884
+ "@yahoo.sk"
885
+ ];
886
+ },
887
+ {
888
+ readonly name: "AOL";
889
+ readonly domains: readonly [
890
+ "@aol.com",
891
+ "@aim.com"
892
+ ];
893
+ },
894
+ {
895
+ readonly name: "iCloud";
896
+ readonly domains: readonly [
897
+ "@icloud.com",
898
+ "@me.com",
899
+ "@mac.com"
900
+ ];
901
+ },
902
+ {
903
+ readonly name: "ProtonMail";
904
+ readonly domains: readonly [
905
+ "@protonmail.com",
906
+ "@protonmail.ch",
907
+ "@pm.me",
908
+ "@proton.me"
909
+ ];
910
+ },
911
+ {
912
+ readonly name: "Zoho";
913
+ readonly domains: readonly [
914
+ "@zoho.com",
915
+ "@zohomail.com"
916
+ ];
917
+ },
918
+ {
919
+ readonly name: "Mail.ru";
920
+ readonly domains: readonly [
921
+ "@mail.ru",
922
+ "@bk.ru",
923
+ "@inbox.ru",
924
+ "@list.ru",
925
+ "@internet.ru",
926
+ "@corp.mail.ru",
927
+ "@ro.ru",
928
+ "@rbcmail.ru",
929
+ "@hotbox.ru",
930
+ "@mail15.com",
931
+ "@pochta.ru",
932
+ "@fromru.com",
933
+ "@front.ru",
934
+ "@krovatka.su",
935
+ "@land.ru",
936
+ "@newmail.ru",
937
+ "@nightmail.ru",
938
+ "@nm.ru",
939
+ "@pisem.net",
940
+ "@pochtamt.ru",
941
+ "@pop3.ru",
942
+ "@smtp.ru",
943
+ "@mail333.com",
944
+ "@mailru.com",
945
+ "@e-mail.ru",
946
+ "@email.ru",
947
+ "@emailru.com",
948
+ "@mail.ua",
949
+ "@bigmir.net",
950
+ "@ukr.net",
951
+ "@i.ua",
952
+ "@meta.ua",
953
+ "@online.ua",
954
+ "@yandex.ua",
955
+ "@yandex.by",
956
+ "@yandex.kz",
957
+ "@narod.ru",
958
+ "@lenta.ru",
959
+ "@autorambler.ru",
960
+ "@myrambler.ru",
961
+ "@r0.ru",
962
+ "@rambler.ua",
963
+ "@qip.ru",
964
+ "@mail.kz",
965
+ "@nursat.kz",
966
+ "@kazmail.kz",
967
+ "@mail.kg",
968
+ "@mail.tj",
969
+ "@mail.uz",
970
+ "@tut.by",
971
+ "@mail.by",
972
+ "@open.by",
973
+ "@rambler.by",
974
+ "@mail.md",
975
+ "@mail.am",
976
+ "@mail.ge",
977
+ "@mail.az",
978
+ "@mail.lv",
979
+ "@mail.lt",
980
+ "@mail.ee",
981
+ "@delfi.lv",
982
+ "@inbox.lv",
983
+ "@apollo.lv",
984
+ "@one.lv",
985
+ "@parks.lv"
986
+ ];
987
+ },
988
+ {
989
+ readonly name: "Yandex";
990
+ readonly domains: readonly [
991
+ "@yandex.ru",
992
+ "@yandex.com",
993
+ "@ya.ru"
994
+ ];
995
+ },
996
+ {
997
+ readonly name: "GMX";
998
+ readonly domains: readonly [
999
+ "@gmx.com",
1000
+ "@gmx.net",
1001
+ "@gmx.de",
1002
+ "@gmx.at",
1003
+ "@gmx.ch"
1004
+ ];
1005
+ },
1006
+ {
1007
+ readonly name: "Web.de";
1008
+ readonly domains: readonly [
1009
+ "@web.de"
1010
+ ];
1011
+ },
1012
+ {
1013
+ readonly name: "Mail.com";
1014
+ readonly domains: readonly [
1015
+ "@mail.com",
1016
+ "@email.com",
1017
+ "@usa.com",
1018
+ "@myself.com",
1019
+ "@consultant.com",
1020
+ "@post.com",
1021
+ "@europe.com",
1022
+ "@asia.com",
1023
+ "@iname.com",
1024
+ "@writeme.com",
1025
+ "@techie.com",
1026
+ "@accountant.com",
1027
+ "@activist.com",
1028
+ "@adexec.com",
1029
+ "@allergist.com",
1030
+ "@alumnidirector.com",
1031
+ "@angelic.com",
1032
+ "@appraiser.com",
1033
+ "@archaeologist.com",
1034
+ "@architect.com",
1035
+ "@artlover.com",
1036
+ "@asia-mail.com",
1037
+ "@auctioneer.com",
1038
+ "@bartender.com",
1039
+ "@bikerider.com",
1040
+ "@birdlover.com",
1041
+ "@brew-master.com",
1042
+ "@brew-meister.com",
1043
+ "@chef.net",
1044
+ "@chemist.com",
1045
+ "@clerk.com",
1046
+ "@clubmember.com",
1047
+ "@collector.com",
1048
+ "@columnist.com",
1049
+ "@comic.com",
1050
+ "@computer4u.com",
1051
+ "@contractor.com",
1052
+ "@coolsite.net",
1053
+ "@counsellor.com",
1054
+ "@count.com",
1055
+ "@cyber-wizard.com",
1056
+ "@cyberdude.com",
1057
+ "@cybergal.com",
1058
+ "@cyberservices.com",
1059
+ "@dallasmail.com",
1060
+ "@dbzmail.com",
1061
+ "@deliveryman.com",
1062
+ "@diplomats.com",
1063
+ "@doctor.com",
1064
+ "@dr.com",
1065
+ "@engineer.com",
1066
+ "@execs.com",
1067
+ "@fastservice.com",
1068
+ "@financialmail.com",
1069
+ "@fireman.net",
1070
+ "@gardener.com",
1071
+ "@geologist.com",
1072
+ "@graduate.org",
1073
+ "@graphic-designer.com",
1074
+ "@groupmail.com",
1075
+ "@hairdresser.net",
1076
+ "@homemail.com",
1077
+ "@hot-shot.com",
1078
+ "@humanoid.net",
1079
+ "@instructor.net",
1080
+ "@insurer.com",
1081
+ "@journalist.com",
1082
+ "@lawyer.com",
1083
+ "@legislator.com",
1084
+ "@lobbyist.com",
1085
+ "@mad.scientist.com",
1086
+ "@manager.com",
1087
+ "@mathematician.com",
1088
+ "@mechanic.com",
1089
+ "@minister.com",
1090
+ "@musician.org",
1091
+ "@optician.com",
1092
+ "@orthodontist.net",
1093
+ "@pediatrician.com",
1094
+ "@photographer.net",
1095
+ "@physicist.net",
1096
+ "@politician.com",
1097
+ "@presidency.com",
1098
+ "@priest.com",
1099
+ "@programmer.net",
1100
+ "@publicist.com",
1101
+ "@realtyagent.com",
1102
+ "@registrar.com",
1103
+ "@repairman.com",
1104
+ "@representative.com",
1105
+ "@rescueteam.com",
1106
+ "@salesperson.net",
1107
+ "@scientist.com",
1108
+ "@secretary.net",
1109
+ "@socialworker.net",
1110
+ "@sociologist.com",
1111
+ "@solution4u.com",
1112
+ "@songwriter.net",
1113
+ "@surgical.net",
1114
+ "@teacher.net",
1115
+ "@technologist.com",
1116
+ "@therapist.net",
1117
+ "@toothfairy.com",
1118
+ "@tvstar.com",
1119
+ "@umpire.com",
1120
+ "@webname.com",
1121
+ "@worker.com",
1122
+ "@workmail.com"
1123
+ ];
1124
+ },
1125
+ {
1126
+ readonly name: "Fastmail";
1127
+ readonly domains: readonly [
1128
+ "@fastmail.com",
1129
+ "@fastmail.fm"
1130
+ ];
1131
+ },
1132
+ {
1133
+ readonly name: "AT&T";
1134
+ readonly domains: readonly [
1135
+ "@att.net",
1136
+ "@sbcglobal.net",
1137
+ "@sbcglobal.com",
1138
+ "@ameritech.net",
1139
+ "@bellsouth.net",
1140
+ "@flash.net",
1141
+ "@prodigy.net",
1142
+ "@pacbell.net",
1143
+ "@nvbell.net",
1144
+ "@snet.net",
1145
+ "@swbell.net",
1146
+ "@wans.net",
1147
+ "@worldnet.att.net"
1148
+ ];
1149
+ },
1150
+ {
1151
+ readonly name: "Comcast";
1152
+ readonly domains: readonly [
1153
+ "@comcast.net"
1154
+ ];
1155
+ },
1156
+ {
1157
+ readonly name: "Verizon";
1158
+ readonly domains: readonly [
1159
+ "@verizon.net"
1160
+ ];
1161
+ },
1162
+ {
1163
+ readonly name: "Cox";
1164
+ readonly domains: readonly [
1165
+ "@cox.net"
1166
+ ];
1167
+ },
1168
+ {
1169
+ readonly name: "Charter";
1170
+ readonly domains: readonly [
1171
+ "@charter.net"
1172
+ ];
1173
+ },
1174
+ {
1175
+ readonly name: "Earthlink";
1176
+ readonly domains: readonly [
1177
+ "@earthlink.net"
1178
+ ];
1179
+ },
1180
+ {
1181
+ readonly name: "Frontier";
1182
+ readonly domains: readonly [
1183
+ "@frontier.com",
1184
+ "@frontiernet.net",
1185
+ "@myfrontiermail.com",
1186
+ "@frontiernet.com"
1187
+ ];
1188
+ },
1189
+ {
1190
+ readonly name: "Windstream";
1191
+ readonly domains: readonly [
1192
+ "@windstream.net"
1193
+ ];
1194
+ },
1195
+ {
1196
+ readonly name: "CenturyTel";
1197
+ readonly domains: readonly [
1198
+ "@centurytel.net"
1199
+ ];
1200
+ },
1201
+ {
1202
+ readonly name: "Juno";
1203
+ readonly domains: readonly [
1204
+ "@juno.com"
1205
+ ];
1206
+ },
1207
+ {
1208
+ readonly name: "Optonline";
1209
+ readonly domains: readonly [
1210
+ "@optonline.net"
1211
+ ];
1212
+ },
1213
+ {
1214
+ readonly name: "QQ";
1215
+ readonly domains: readonly [
1216
+ "@qq.com"
1217
+ ];
1218
+ },
1219
+ {
1220
+ readonly name: "163";
1221
+ readonly domains: readonly [
1222
+ "@163.com",
1223
+ "@126.com"
1224
+ ];
1225
+ },
1226
+ {
1227
+ readonly name: "139";
1228
+ readonly domains: readonly [
1229
+ "@139.com"
1230
+ ];
1231
+ },
1232
+ {
1233
+ readonly name: "21cn";
1234
+ readonly domains: readonly [
1235
+ "@21cn.com"
1236
+ ];
1237
+ },
1238
+ {
1239
+ readonly name: "Sina";
1240
+ readonly domains: readonly [
1241
+ "@sina.com",
1242
+ "@sina.cn",
1243
+ "@sina.com.cn"
1244
+ ];
1245
+ },
1246
+ {
1247
+ readonly name: "Sohu";
1248
+ readonly domains: readonly [
1249
+ "@sohu.com"
1250
+ ];
1251
+ },
1252
+ {
1253
+ readonly name: "Aliyun";
1254
+ readonly domains: readonly [
1255
+ "@aliyun.com",
1256
+ "@alibaba.com"
1257
+ ];
1258
+ },
1259
+ {
1260
+ readonly name: "Naver";
1261
+ readonly domains: readonly [
1262
+ "@naver.com"
1263
+ ];
1264
+ },
1265
+ {
1266
+ readonly name: "Daum";
1267
+ readonly domains: readonly [
1268
+ "@daum.net",
1269
+ "@hanmail.net"
1270
+ ];
1271
+ },
1272
+ {
1273
+ readonly name: "Nate";
1274
+ readonly domains: readonly [
1275
+ "@nate.com"
1276
+ ];
1277
+ },
1278
+ {
1279
+ readonly name: "Netvigator";
1280
+ readonly domains: readonly [
1281
+ "@netvigator.com"
1282
+ ];
1283
+ },
1284
+ {
1285
+ readonly name: "Ziggo";
1286
+ readonly domains: readonly [
1287
+ "@ziggo.nl"
1288
+ ];
1289
+ },
1290
+ {
1291
+ readonly name: "263.net";
1292
+ readonly domains: readonly [
1293
+ "@263.net"
1294
+ ];
1295
+ },
1296
+ {
1297
+ readonly name: "Aruba";
1298
+ readonly domains: readonly [
1299
+ "@aruba.it"
1300
+ ];
1301
+ },
1302
+ {
1303
+ readonly name: "Plala Webmail";
1304
+ readonly domains: readonly [
1305
+ "@plala.or.jp"
1306
+ ];
1307
+ },
1308
+ {
1309
+ readonly name: "Turbify";
1310
+ readonly domains: readonly [
1311
+ "@yahoo-inc.com"
1312
+ ];
1313
+ },
1314
+ {
1315
+ readonly name: "Godaddy";
1316
+ readonly domains: readonly [
1317
+ "@secureserver.net"
1318
+ ];
1319
+ },
1320
+ {
1321
+ readonly name: "Rackspace";
1322
+ readonly domains: readonly [
1323
+ "@emailsrvr.com"
1324
+ ];
1325
+ },
1326
+ {
1327
+ readonly name: "Mimecast";
1328
+ readonly domains: readonly [
1329
+ "@mimecast.com"
1330
+ ];
1331
+ },
1332
+ {
1333
+ readonly name: "Facebook";
1334
+ readonly domains: readonly [
1335
+ "@facebook.com"
1336
+ ];
1337
+ },
1338
+ {
1339
+ readonly name: "Amazon";
1340
+ readonly domains: readonly [
1341
+ "@amazon.com",
1342
+ "@amazonaws.com"
1343
+ ];
1344
+ },
1345
+ {
1346
+ readonly name: "Anazana";
1347
+ readonly domains: readonly [
1348
+ "@anazana.com"
1349
+ ];
1350
+ },
1351
+ {
1352
+ readonly name: "CoreMail";
1353
+ readonly domains: readonly [
1354
+ "@icoremail.net"
1355
+ ];
1356
+ },
1357
+ {
1358
+ readonly name: "Hinet";
1359
+ readonly domains: readonly [
1360
+ "@hinet.net"
1361
+ ];
1362
+ },
1363
+ {
1364
+ readonly name: "Iinet";
1365
+ readonly domains: readonly [
1366
+ "@iinet.net.au"
1367
+ ];
1368
+ },
1369
+ {
1370
+ readonly name: "Namecheap";
1371
+ readonly domains: readonly [
1372
+ "@registrar-servers.com"
1373
+ ];
1374
+ },
1375
+ {
1376
+ readonly name: "Network Solutions";
1377
+ readonly domains: readonly [
1378
+ "@myregisteredsite.com"
1379
+ ];
1380
+ },
1381
+ {
1382
+ readonly name: "Orange";
1383
+ readonly domains: readonly [
1384
+ "@orange.fr",
1385
+ "@wanadoo.fr"
1386
+ ];
1387
+ },
1388
+ {
1389
+ readonly name: "Synaq";
1390
+ readonly domains: readonly [
1391
+ "@synaq.com"
1392
+ ];
1393
+ },
1394
+ {
1395
+ readonly name: "Zmail";
1396
+ readonly domains: readonly [
1397
+ "@zmail.ru"
1398
+ ];
1399
+ },
1400
+ {
1401
+ readonly name: "Strato";
1402
+ readonly domains: readonly [
1403
+ "@strato.de"
1404
+ ];
1405
+ },
1406
+ {
1407
+ readonly name: "Apple";
1408
+ readonly domains: readonly [
1409
+ "@apple.com"
1410
+ ];
1411
+ },
1412
+ {
1413
+ readonly name: "Cox Webmail";
1414
+ readonly domains: readonly [
1415
+ "@cloudfilter.net"
1416
+ ];
1417
+ },
1418
+ {
1419
+ readonly name: "Mailgun";
1420
+ readonly domains: readonly [
1421
+ "@mailgun.org"
1422
+ ];
1423
+ },
1424
+ {
1425
+ readonly name: "Postmark";
1426
+ readonly domains: readonly [
1427
+ "@pmta.postmarkapp.com"
1428
+ ];
1429
+ },
1430
+ {
1431
+ readonly name: "SendGrid";
1432
+ readonly domains: readonly [
1433
+ "@sendgrid.net"
1434
+ ];
1435
+ },
1436
+ {
1437
+ readonly name: "Elastic Email";
1438
+ readonly domains: readonly [
1439
+ "@elasticemail.com"
1440
+ ];
1441
+ },
1442
+ {
1443
+ readonly name: "Zendesk";
1444
+ readonly domains: readonly [
1445
+ "@zendesk.com"
1446
+ ];
1447
+ },
1448
+ {
1449
+ readonly name: "Intermedia";
1450
+ readonly domains: readonly [
1451
+ "@intermedia.net"
1452
+ ];
1453
+ },
1454
+ {
1455
+ readonly name: "Mailjet";
1456
+ readonly domains: readonly [
1457
+ "@mailjet.com"
1458
+ ];
1459
+ },
1460
+ {
1461
+ readonly name: "Front";
1462
+ readonly domains: readonly [
1463
+ "@frontapp.com"
1464
+ ];
1465
+ },
1466
+ {
1467
+ readonly name: "Free.fr";
1468
+ readonly domains: readonly [
1469
+ "@free.fr"
1470
+ ];
1471
+ },
1472
+ {
1473
+ readonly name: "Libero";
1474
+ readonly domains: readonly [
1475
+ "@libero.it"
1476
+ ];
1477
+ },
1478
+ {
1479
+ readonly name: "UOL";
1480
+ readonly domains: readonly [
1481
+ "@uol.com.br"
1482
+ ];
1483
+ },
1484
+ {
1485
+ readonly name: "BOL";
1486
+ readonly domains: readonly [
1487
+ "@bol.com.br"
1488
+ ];
1489
+ },
1490
+ {
1491
+ readonly name: "SFR";
1492
+ readonly domains: readonly [
1493
+ "@sfr.fr"
1494
+ ];
1495
+ },
1496
+ {
1497
+ readonly name: "IG";
1498
+ readonly domains: readonly [
1499
+ "@ig.com.br"
1500
+ ];
1501
+ },
1502
+ {
1503
+ readonly name: "Bigpond";
1504
+ readonly domains: readonly [
1505
+ "@bigpond.com",
1506
+ "@bigpond.net.au"
1507
+ ];
1508
+ },
1509
+ {
1510
+ readonly name: "Terra";
1511
+ readonly domains: readonly [
1512
+ "@terra.com.br"
1513
+ ];
1514
+ },
1515
+ {
1516
+ readonly name: "Neuf";
1517
+ readonly domains: readonly [
1518
+ "@neuf.fr"
1519
+ ];
1520
+ },
1521
+ {
1522
+ readonly name: "Alice";
1523
+ readonly domains: readonly [
1524
+ "@alice.it",
1525
+ "@aliceadsl.fr"
1526
+ ];
1527
+ },
1528
+ {
1529
+ readonly name: "La Poste";
1530
+ readonly domains: readonly [
1531
+ "@laposte.net"
1532
+ ];
1533
+ },
1534
+ {
1535
+ readonly name: "Rambler";
1536
+ readonly domains: readonly [
1537
+ "@rambler.ru"
1538
+ ];
1539
+ },
1540
+ {
1541
+ readonly name: "Tiscali";
1542
+ readonly domains: readonly [
1543
+ "@tiscali.it",
1544
+ "@tiscali.co.uk"
1545
+ ];
1546
+ },
1547
+ {
1548
+ readonly name: "Shaw";
1549
+ readonly domains: readonly [
1550
+ "@shaw.ca"
1551
+ ];
1552
+ },
1553
+ {
1554
+ readonly name: "Sky";
1555
+ readonly domains: readonly [
1556
+ "@sky.com"
1557
+ ];
1558
+ },
1559
+ {
1560
+ readonly name: "Freenet";
1561
+ readonly domains: readonly [
1562
+ "@freenet.de"
1563
+ ];
1564
+ },
1565
+ {
1566
+ readonly name: "T-Online";
1567
+ readonly domains: readonly [
1568
+ "@t-online.de"
1569
+ ];
1570
+ },
1571
+ {
1572
+ readonly name: "Virgilio";
1573
+ readonly domains: readonly [
1574
+ "@virgilio.it"
1575
+ ];
1576
+ },
1577
+ {
1578
+ readonly name: "Home.nl";
1579
+ readonly domains: readonly [
1580
+ "@home.nl"
1581
+ ];
1582
+ },
1583
+ {
1584
+ readonly name: "Telenet";
1585
+ readonly domains: readonly [
1586
+ "@telenet.be"
1587
+ ];
1588
+ },
1589
+ {
1590
+ readonly name: "Voila";
1591
+ readonly domains: readonly [
1592
+ "@voila.fr"
1593
+ ];
1594
+ },
1595
+ {
1596
+ readonly name: "Planet.nl";
1597
+ readonly domains: readonly [
1598
+ "@planet.nl"
1599
+ ];
1600
+ },
1601
+ {
1602
+ readonly name: "Tin.it";
1603
+ readonly domains: readonly [
1604
+ "@tin.it"
1605
+ ];
1606
+ },
1607
+ {
1608
+ readonly name: "NTL World";
1609
+ readonly domains: readonly [
1610
+ "@ntlworld.com"
1611
+ ];
1612
+ },
1613
+ {
1614
+ readonly name: "Arcor";
1615
+ readonly domains: readonly [
1616
+ "@arcor.de"
1617
+ ];
1618
+ },
1619
+ {
1620
+ readonly name: "Hetnet";
1621
+ readonly domains: readonly [
1622
+ "@hetnet.nl"
1623
+ ];
1624
+ },
1625
+ {
1626
+ readonly name: "Zonnet";
1627
+ readonly domains: readonly [
1628
+ "@zonnet.nl"
1629
+ ];
1630
+ },
1631
+ {
1632
+ readonly name: "Club Internet";
1633
+ readonly domains: readonly [
1634
+ "@club-internet.fr"
1635
+ ];
1636
+ },
1637
+ {
1638
+ readonly name: "Optus";
1639
+ readonly domains: readonly [
1640
+ "@optusnet.com.au"
1641
+ ];
1642
+ },
1643
+ {
1644
+ readonly name: "Blueyonder";
1645
+ readonly domains: readonly [
1646
+ "@blueyonder.co.uk"
1647
+ ];
1648
+ },
1649
+ {
1650
+ readonly name: "Bluewin";
1651
+ readonly domains: readonly [
1652
+ "@bluewin.ch"
1653
+ ];
1654
+ },
1655
+ {
1656
+ readonly name: "Skynet";
1657
+ readonly domains: readonly [
1658
+ "@skynet.be"
1659
+ ];
1660
+ },
1661
+ {
1662
+ readonly name: "Sympatico";
1663
+ readonly domains: readonly [
1664
+ "@sympatico.ca"
1665
+ ];
1666
+ },
1667
+ {
1668
+ readonly name: "Chello";
1669
+ readonly domains: readonly [
1670
+ "@chello.nl"
1671
+ ];
1672
+ },
1673
+ {
1674
+ readonly name: "Hey";
1675
+ readonly domains: readonly [
1676
+ "@hey.com"
1677
+ ];
1678
+ },
1679
+ {
1680
+ readonly name: "Inbox";
1681
+ readonly domains: readonly [
1682
+ "@inbox.lv",
1683
+ "@inbox.eu"
1684
+ ];
1685
+ },
1686
+ {
1687
+ readonly name: "Kolab Now";
1688
+ readonly domains: readonly [
1689
+ "@kolabnow.com"
1690
+ ];
1691
+ },
1692
+ {
1693
+ readonly name: "Lycos";
1694
+ readonly domains: readonly [
1695
+ "@lycos.com"
1696
+ ];
1697
+ },
1698
+ {
1699
+ readonly name: "Mailbox.org";
1700
+ readonly domains: readonly [
1701
+ "@mailbox.org"
1702
+ ];
1703
+ },
1704
+ {
1705
+ readonly name: "Mailfence";
1706
+ readonly domains: readonly [
1707
+ "@mailfence.com"
1708
+ ];
1709
+ },
1710
+ {
1711
+ readonly name: "Posteo";
1712
+ readonly domains: readonly [
1713
+ "@posteo.de"
1714
+ ];
1715
+ },
1716
+ {
1717
+ readonly name: "Rediffmail";
1718
+ readonly domains: readonly [
1719
+ "@rediffmail.com"
1720
+ ];
1721
+ },
1722
+ {
1723
+ readonly name: "Skiff";
1724
+ readonly domains: readonly [
1725
+ "@skiff.com"
1726
+ ];
1727
+ },
1728
+ {
1729
+ readonly name: "Tutanota";
1730
+ readonly domains: readonly [
1731
+ "@tutanota.com",
1732
+ "@tutanota.de",
1733
+ "@tuta.io",
1734
+ "@tutamail.com",
1735
+ "@keemail.me"
1736
+ ];
1737
+ },
1738
+ {
1739
+ readonly name: "DuckDuckGo Email";
1740
+ readonly domains: readonly [
1741
+ "@duck.com"
1742
+ ];
1743
+ },
1744
+ {
1745
+ readonly name: "SimpleLogin";
1746
+ readonly domains: readonly [
1747
+ "@simplelogin.com",
1748
+ "@simplelogin.fr",
1749
+ "@simplelogin.co",
1750
+ "@simplelogin.io",
1751
+ "@aleeas.com",
1752
+ "@silomails.com",
1753
+ "@slmails.com",
1754
+ "@slmail.me"
1755
+ ];
1756
+ },
1757
+ {
1758
+ readonly name: "Addy.io";
1759
+ readonly domains: readonly [
1760
+ "@addy.io",
1761
+ "@anonaddy.com",
1762
+ "@anonaddy.me"
1763
+ ];
1764
+ },
1765
+ {
1766
+ readonly name: "Firefox Relay";
1767
+ readonly domains: readonly [
1768
+ "@mozmail.com"
1769
+ ];
1770
+ },
1771
+ {
1772
+ readonly name: "StartMail";
1773
+ readonly domains: readonly [
1774
+ "@startmail.com"
1775
+ ];
1776
+ },
1777
+ {
1778
+ readonly name: "Runbox";
1779
+ readonly domains: readonly [
1780
+ "@runbox.com"
1781
+ ];
1782
+ },
1783
+ {
1784
+ readonly name: "Disroot";
1785
+ readonly domains: readonly [
1786
+ "@disroot.org"
1787
+ ];
1788
+ },
1789
+ {
1790
+ readonly name: "Riseup";
1791
+ readonly domains: readonly [
1792
+ "@riseup.net"
1793
+ ];
1794
+ },
1795
+ {
1796
+ readonly name: "CounterMail";
1797
+ readonly domains: readonly [
1798
+ "@countermail.com"
1799
+ ];
1800
+ },
1801
+ {
1802
+ readonly name: "Soverin";
1803
+ readonly domains: readonly [
1804
+ "@soverin.net"
1805
+ ];
1806
+ },
1807
+ {
1808
+ readonly name: "WP";
1809
+ readonly domains: readonly [
1810
+ "@wp.pl",
1811
+ "@o2.pl",
1812
+ "@tlen.pl"
1813
+ ];
1814
+ },
1815
+ {
1816
+ readonly name: "Onet";
1817
+ readonly domains: readonly [
1818
+ "@onet.pl",
1819
+ "@op.pl",
1820
+ "@vp.pl",
1821
+ "@onet.eu"
1822
+ ];
1823
+ },
1824
+ {
1825
+ readonly name: "Interia";
1826
+ readonly domains: readonly [
1827
+ "@interia.pl",
1828
+ "@interia.eu",
1829
+ "@poczta.fm"
1830
+ ];
1831
+ },
1832
+ {
1833
+ readonly name: "Gazeta.pl";
1834
+ readonly domains: readonly [
1835
+ "@gazeta.pl"
1836
+ ];
1837
+ },
1838
+ {
1839
+ readonly name: "Seznam";
1840
+ readonly domains: readonly [
1841
+ "@seznam.cz",
1842
+ "@email.cz",
1843
+ "@post.cz"
1844
+ ];
1845
+ },
1846
+ {
1847
+ readonly name: "Centrum";
1848
+ readonly domains: readonly [
1849
+ "@centrum.cz",
1850
+ "@centrum.sk"
1851
+ ];
1852
+ },
1853
+ {
1854
+ readonly name: "Volny";
1855
+ readonly domains: readonly [
1856
+ "@volny.cz"
1857
+ ];
1858
+ },
1859
+ {
1860
+ readonly name: "Freemail HU";
1861
+ readonly domains: readonly [
1862
+ "@freemail.hu",
1863
+ "@citromail.hu"
1864
+ ];
1865
+ },
1866
+ {
1867
+ readonly name: "In.gr";
1868
+ readonly domains: readonly [
1869
+ "@in.gr"
1870
+ ];
1871
+ },
1872
+ {
1873
+ readonly name: "Sify";
1874
+ readonly domains: readonly [
1875
+ "@sifymail.com",
1876
+ "@sify.com"
1877
+ ];
1878
+ },
1879
+ {
1880
+ readonly name: "Indiatimes";
1881
+ readonly domains: readonly [
1882
+ "@indiatimes.com"
1883
+ ];
1884
+ },
1885
+ {
1886
+ readonly name: "BSNL";
1887
+ readonly domains: readonly [
1888
+ "@bsnl.in",
1889
+ "@dataone.in"
1890
+ ];
1891
+ },
1892
+ {
1893
+ readonly name: "Locaweb";
1894
+ readonly domains: readonly [
1895
+ "@lwmail.com.br"
1896
+ ];
1897
+ },
1898
+ {
1899
+ readonly name: "Movistar";
1900
+ readonly domains: readonly [
1901
+ "@telefonica.net",
1902
+ "@movistar.es"
1903
+ ];
1904
+ },
1905
+ {
1906
+ readonly name: "Telkom SA";
1907
+ readonly domains: readonly [
1908
+ "@telkomsa.net",
1909
+ "@vodamail.co.za",
1910
+ "@webmail.co.za"
1911
+ ];
1912
+ },
1913
+ {
1914
+ readonly name: "BIGLOBE";
1915
+ readonly domains: readonly [
1916
+ "@biglobe.ne.jp"
1917
+ ];
1918
+ },
1919
+ {
1920
+ readonly name: "@nifty";
1921
+ readonly domains: readonly [
1922
+ "@nifty.com",
1923
+ "@nifty.ne.jp"
1924
+ ];
1925
+ },
1926
+ {
1927
+ readonly name: "OCN";
1928
+ readonly domains: readonly [
1929
+ "@ocn.ne.jp"
1930
+ ];
1931
+ },
1932
+ {
1933
+ readonly name: "Rakuten";
1934
+ readonly domains: readonly [
1935
+ "@rakuten.co.jp",
1936
+ "@gol.com"
1937
+ ];
1938
+ },
1939
+ {
1940
+ readonly name: "Excite Japan";
1941
+ readonly domains: readonly [
1942
+ "@excite.co.jp"
1943
+ ];
1944
+ },
1945
+ {
1946
+ readonly name: "So-net";
1947
+ readonly domains: readonly [
1948
+ "@so-net.ne.jp"
1949
+ ];
1950
+ },
1951
+ {
1952
+ readonly name: "Xtra";
1953
+ readonly domains: readonly [
1954
+ "@xtra.co.nz"
1955
+ ];
1956
+ },
1957
+ {
1958
+ readonly name: "Spectrum";
1959
+ readonly domains: readonly [
1960
+ "@spectrum.net"
1961
+ ];
1962
+ },
1963
+ {
1964
+ readonly name: "RoadRunner";
1965
+ readonly domains: readonly [
1966
+ "@rr.com",
1967
+ "@twc.com",
1968
+ "@roadrunner.com",
1969
+ "@nc.rr.com",
1970
+ "@sc.rr.com",
1971
+ "@socal.rr.com",
1972
+ "@tampabay.rr.com",
1973
+ "@cinci.rr.com",
1974
+ "@nycap.rr.com",
1975
+ "@neo.rr.com"
1976
+ ];
1977
+ },
1978
+ {
1979
+ readonly name: "Mediacom";
1980
+ readonly domains: readonly [
1981
+ "@mediacombb.net",
1982
+ "@mchsi.com"
1983
+ ];
1984
+ },
1985
+ {
1986
+ readonly name: "Optimum";
1987
+ readonly domains: readonly [
1988
+ "@optimum.net"
1989
+ ];
1990
+ },
1991
+ {
1992
+ readonly name: "Suddenlink";
1993
+ readonly domains: readonly [
1994
+ "@suddenlink.net"
1995
+ ];
1996
+ },
1997
+ {
1998
+ readonly name: "RCN";
1999
+ readonly domains: readonly [
2000
+ "@rcn.com"
2001
+ ];
2002
+ },
2003
+ {
2004
+ readonly name: "Breezeline";
2005
+ readonly domains: readonly [
2006
+ "@atlanticbb.net",
2007
+ "@breezeline.com"
2008
+ ];
2009
+ },
2010
+ {
2011
+ readonly name: "BT Internet";
2012
+ readonly domains: readonly [
2013
+ "@btinternet.com",
2014
+ "@btopenworld.com",
2015
+ "@talk21.com"
2016
+ ];
2017
+ },
2018
+ {
2019
+ readonly name: "Virgin Media";
2020
+ readonly domains: readonly [
2021
+ "@virginmedia.com",
2022
+ "@virgin.net"
2023
+ ];
2024
+ },
2025
+ {
2026
+ readonly name: "TalkTalk";
2027
+ readonly domains: readonly [
2028
+ "@talktalk.net"
2029
+ ];
2030
+ },
2031
+ {
2032
+ readonly name: "Plusnet";
2033
+ readonly domains: readonly [
2034
+ "@plus.net",
2035
+ "@force9.co.uk",
2036
+ "@free-online.net"
2037
+ ];
2038
+ },
2039
+ {
2040
+ readonly name: "Rogers";
2041
+ readonly domains: readonly [
2042
+ "@rogers.com"
2043
+ ];
2044
+ },
2045
+ {
2046
+ readonly name: "Bell";
2047
+ readonly domains: readonly [
2048
+ "@bell.net"
2049
+ ];
2050
+ },
2051
+ {
2052
+ readonly name: "Telus";
2053
+ readonly domains: readonly [
2054
+ "@telus.net"
2055
+ ];
2056
+ },
2057
+ {
2058
+ readonly name: "Videotron";
2059
+ readonly domains: readonly [
2060
+ "@videotron.ca",
2061
+ "@videotron.qc.ca"
2062
+ ];
2063
+ },
2064
+ {
2065
+ readonly name: "Cogeco";
2066
+ readonly domains: readonly [
2067
+ "@cogeco.ca"
2068
+ ];
2069
+ }
2070
+ ];
2071
+ export type ProviderNames = typeof EmailProviders[number]["name"];
2072
+ declare const records: readonly [
2073
+ {
2074
+ readonly name: "Sohu";
2075
+ readonly mx: "a.sohu.com";
2076
+ },
2077
+ {
2078
+ readonly name: "Sohu";
2079
+ readonly mx: "sohu.com";
2080
+ },
2081
+ {
2082
+ readonly name: "Strato";
2083
+ readonly mx: ".rzone.de";
2084
+ },
2085
+ {
2086
+ readonly name: "Strato";
2087
+ readonly mx: ".strato.de";
2088
+ },
2089
+ {
2090
+ readonly name: "21cn";
2091
+ readonly mx: ".21cn.com";
2092
+ },
2093
+ {
2094
+ readonly name: "163";
2095
+ readonly mx: ".netease.com";
2096
+ },
2097
+ {
2098
+ readonly name: "Netvigator";
2099
+ readonly mx: ".netvigator.com";
2100
+ },
2101
+ {
2102
+ readonly name: "139";
2103
+ readonly mx: ".mail.139.com";
2104
+ },
2105
+ {
2106
+ readonly name: "Nate";
2107
+ readonly mx: ".nate.com";
2108
+ },
2109
+ {
2110
+ readonly name: "Naver";
2111
+ readonly mx: ".naver.com";
2112
+ },
2113
+ {
2114
+ readonly name: "Daum";
2115
+ readonly mx: ".daum.kgslb.com";
2116
+ },
2117
+ {
2118
+ readonly name: "Daum";
2119
+ readonly mx: ".hanmail.net";
2120
+ },
2121
+ {
2122
+ readonly name: "Ziggo";
2123
+ readonly mx: ".ziggo.nl";
2124
+ },
2125
+ {
2126
+ readonly name: "QQ";
2127
+ readonly mx: ".qq.com";
2128
+ },
2129
+ {
2130
+ readonly name: "263.net";
2131
+ readonly mx: "263.net";
2132
+ },
2133
+ {
2134
+ readonly name: "Sina";
2135
+ readonly mx: ".vip.sina.com";
2136
+ },
2137
+ {
2138
+ readonly name: "Sina";
2139
+ readonly mx: ".sina.com.cn";
2140
+ },
2141
+ {
2142
+ readonly name: "Aruba";
2143
+ readonly mx: ".aruba.it";
2144
+ },
2145
+ {
2146
+ readonly name: "Aliyun";
2147
+ readonly mx: ".mxhichina.com";
2148
+ },
2149
+ {
2150
+ readonly name: "Plala Webmail";
2151
+ readonly mx: ".plala.or.jp";
2152
+ },
2153
+ {
2154
+ readonly name: "AOL";
2155
+ readonly mx: "mx-aol.mail";
2156
+ },
2157
+ {
2158
+ readonly name: "Turbify";
2159
+ readonly mx: "mx-biz.mail.am0.yahoodns.net";
2160
+ },
2161
+ {
2162
+ readonly name: "Turbify";
2163
+ readonly mx: "mx-biz.mail.am.yahoodns.net";
2164
+ },
2165
+ {
2166
+ readonly name: "Turbify";
2167
+ readonly mx: "mx-biz.mail.am1.yahoodns.net";
2168
+ },
2169
+ {
2170
+ readonly name: "Turbify";
2171
+ readonly mx: "mx1.biz.mail.yahoo.com";
2172
+ },
2173
+ {
2174
+ readonly name: "Turbify";
2175
+ readonly mx: "mx5.biz.mail.yahoo.com";
2176
+ },
2177
+ {
2178
+ readonly name: "Turbify";
2179
+ readonly mx: ".biz.mail.yahoo.com";
2180
+ },
2181
+ {
2182
+ readonly name: "AT&T";
2183
+ readonly mx: ".prodigy.net";
2184
+ },
2185
+ {
2186
+ readonly name: "Yahoo";
2187
+ readonly mx: ".yahoo.";
2188
+ },
2189
+ {
2190
+ readonly name: "Yahoo";
2191
+ readonly mx: ".yahoodns.net";
2192
+ },
2193
+ {
2194
+ readonly name: "Zoho";
2195
+ readonly mx: ".zoho.com";
2196
+ },
2197
+ {
2198
+ readonly name: "Sitestar Webmail";
2199
+ readonly mx: ".sitestar.everyone.net";
2200
+ readonly webmail: "https://webmail.sitestar.net";
2201
+ },
2202
+ {
2203
+ readonly name: "Outlook Web App (OWA)";
2204
+ readonly mx: ".serverdata.net";
2205
+ readonly webmail: "https://owa.serverdata.net";
2206
+ },
2207
+ {
2208
+ readonly name: "1and1";
2209
+ readonly mx: ".1and1.";
2210
+ },
2211
+ {
2212
+ readonly name: "Outlook";
2213
+ readonly mx: "olc.protection.outlook.com";
2214
+ },
2215
+ {
2216
+ readonly name: "Outlook";
2217
+ readonly mx: ".mail.outlook.com";
2218
+ },
2219
+ {
2220
+ readonly name: "Outlook";
2221
+ readonly mx: ".hotmail.";
2222
+ },
2223
+ {
2224
+ readonly name: "Office 365";
2225
+ readonly mx: "mail.protection.outlook.com";
2226
+ },
2227
+ {
2228
+ readonly name: "Office 365";
2229
+ readonly mx: ".outlook.com";
2230
+ },
2231
+ {
2232
+ readonly name: "Office 365";
2233
+ readonly mx: ".office365.com";
2234
+ },
2235
+ {
2236
+ readonly name: "Gmail";
2237
+ readonly mx: ".google.com";
2238
+ },
2239
+ {
2240
+ readonly name: "Mail.ru";
2241
+ readonly mx: ".mail.ru";
2242
+ },
2243
+ {
2244
+ readonly name: "Mail.com";
2245
+ readonly mx: ".mail.com";
2246
+ },
2247
+ {
2248
+ readonly name: "Earthlink";
2249
+ readonly mx: ".earthlink.net";
2250
+ },
2251
+ {
2252
+ readonly name: "Earthlink";
2253
+ readonly mx: ".oxsus-vadesecure.net";
2254
+ },
2255
+ {
2256
+ readonly name: "Rackspace";
2257
+ readonly mx: ".emailsrvr.com";
2258
+ },
2259
+ {
2260
+ readonly name: "Mimecast";
2261
+ readonly mx: ".mimecast.com";
2262
+ },
2263
+ {
2264
+ readonly name: "Godaddy";
2265
+ readonly mx: ".secureserver.net";
2266
+ },
2267
+ {
2268
+ readonly name: "Comcast";
2269
+ readonly mx: ".comcast.net";
2270
+ },
2271
+ {
2272
+ readonly name: "Office 365";
2273
+ readonly mx: ".ppe-hosted.com";
2274
+ },
2275
+ {
2276
+ readonly name: "Office 365";
2277
+ readonly mx: ".gslb.pphosted.com";
2278
+ },
2279
+ {
2280
+ readonly name: "Office 365";
2281
+ readonly mx: ".arsmtp.com";
2282
+ },
2283
+ {
2284
+ readonly name: "Zoho";
2285
+ readonly mx: ".zoho.com";
2286
+ },
2287
+ {
2288
+ readonly name: "ProtonMail";
2289
+ readonly mx: "mail.protonmail.ch";
2290
+ },
2291
+ {
2292
+ readonly name: "Facebook";
2293
+ readonly mx: ".facebook.com";
2294
+ },
2295
+ {
2296
+ readonly name: "163";
2297
+ readonly mx: ".netease.com";
2298
+ },
2299
+ {
2300
+ readonly name: "163";
2301
+ readonly mx: ".163.com";
2302
+ },
2303
+ {
2304
+ readonly name: "263";
2305
+ readonly mx: ".263.net";
2306
+ },
2307
+ {
2308
+ readonly name: "Aliyun";
2309
+ readonly mx: ".alibaba.com";
2310
+ },
2311
+ {
2312
+ readonly name: "Aliyun";
2313
+ readonly mx: ".aliyun.com";
2314
+ },
2315
+ {
2316
+ readonly name: "Amazon";
2317
+ readonly mx: ".amazon.com";
2318
+ },
2319
+ {
2320
+ readonly name: "Amazon";
2321
+ readonly mx: ".amazonaws.com";
2322
+ },
2323
+ {
2324
+ readonly name: "Anazana";
2325
+ readonly mx: ".anazana.com";
2326
+ },
2327
+ {
2328
+ readonly name: "CoreMail";
2329
+ readonly mx: ".icoremail.net";
2330
+ },
2331
+ {
2332
+ readonly name: "GMX";
2333
+ readonly mx: ".gmx.net";
2334
+ },
2335
+ {
2336
+ readonly name: "GMX";
2337
+ readonly mx: ".gmx.com";
2338
+ },
2339
+ {
2340
+ readonly name: "Hinet";
2341
+ readonly mx: ".hinet.";
2342
+ },
2343
+ {
2344
+ readonly name: "iCloud";
2345
+ readonly mx: ".icloud.com";
2346
+ },
2347
+ {
2348
+ readonly name: "Iinet";
2349
+ readonly mx: ".iinet.net.au";
2350
+ },
2351
+ {
2352
+ readonly name: "Namecheap";
2353
+ readonly mx: ".registrar-servers.com";
2354
+ },
2355
+ {
2356
+ readonly name: "Network Solutions";
2357
+ readonly mx: ".myregisteredsite.com";
2358
+ },
2359
+ {
2360
+ readonly name: "Orange";
2361
+ readonly mx: ".orange.";
2362
+ },
2363
+ {
2364
+ readonly name: "QQ";
2365
+ readonly mx: ".qq.com";
2366
+ },
2367
+ {
2368
+ readonly name: "Synaq";
2369
+ readonly mx: ".synaq.";
2370
+ },
2371
+ {
2372
+ readonly name: "Web.de";
2373
+ readonly mx: ".web.de";
2374
+ },
2375
+ {
2376
+ readonly name: "Yandex";
2377
+ readonly mx: ".yandex.";
2378
+ },
2379
+ {
2380
+ readonly name: "Zmail";
2381
+ readonly mx: ".zmail.";
2382
+ },
2383
+ {
2384
+ readonly name: "Strato";
2385
+ readonly mx: ".strato.de";
2386
+ },
2387
+ {
2388
+ readonly name: "Apple";
2389
+ readonly mx: ".apple.com";
2390
+ },
2391
+ {
2392
+ readonly name: "Cox Webmail";
2393
+ readonly mx: ".cloudfilter.net";
2394
+ },
2395
+ {
2396
+ readonly name: "Fastmail";
2397
+ readonly mx: ".messagingengine.com";
2398
+ },
2399
+ {
2400
+ readonly name: "Mailgun";
2401
+ readonly mx: ".mailgun.org";
2402
+ },
2403
+ {
2404
+ readonly name: "Postmark";
2405
+ readonly mx: ".pmta.postmarkapp.com";
2406
+ },
2407
+ {
2408
+ readonly name: "SendGrid";
2409
+ readonly mx: ".sendgrid.net";
2410
+ },
2411
+ {
2412
+ readonly name: "Elastic Email";
2413
+ readonly mx: ".elasticemail.com";
2414
+ },
2415
+ {
2416
+ readonly name: "Zendesk";
2417
+ readonly mx: ".zendesk.com";
2418
+ },
2419
+ {
2420
+ readonly name: "Intermedia";
2421
+ readonly mx: ".intermedia.net";
2422
+ },
2423
+ {
2424
+ readonly name: "Mailjet";
2425
+ readonly mx: ".mailjet.com";
2426
+ },
2427
+ {
2428
+ readonly name: "Front";
2429
+ readonly mx: ".frontapp.com";
2430
+ },
2431
+ {
2432
+ readonly name: "Tutanota";
2433
+ readonly mx: ".tutanota.de";
2434
+ },
2435
+ {
2436
+ readonly name: "Tutanota";
2437
+ readonly mx: ".tutanota.com";
2438
+ },
2439
+ {
2440
+ readonly name: "Tutanota";
2441
+ readonly mx: ".tuta.io";
2442
+ },
2443
+ {
2444
+ readonly name: "Mailbox.org";
2445
+ readonly mx: ".mailbox.org";
2446
+ },
2447
+ {
2448
+ readonly name: "Posteo";
2449
+ readonly mx: ".posteo.de";
2450
+ },
2451
+ {
2452
+ readonly name: "Mailfence";
2453
+ readonly mx: ".mailfence.com";
2454
+ },
2455
+ {
2456
+ readonly name: "Rediffmail";
2457
+ readonly mx: ".rediffmail.com";
2458
+ },
2459
+ {
2460
+ readonly name: "Rediffmail";
2461
+ readonly mx: ".rediff.com";
2462
+ },
2463
+ {
2464
+ readonly name: "Lycos";
2465
+ readonly mx: ".lycos.com";
2466
+ },
2467
+ {
2468
+ readonly name: "Kolab Now";
2469
+ readonly mx: ".kolabnow.com";
2470
+ },
2471
+ {
2472
+ readonly name: "Hey";
2473
+ readonly mx: ".hey.com";
2474
+ },
2475
+ {
2476
+ readonly name: "Skiff";
2477
+ readonly mx: ".skiff.com";
2478
+ },
2479
+ {
2480
+ readonly name: "Inbox";
2481
+ readonly mx: ".inbox.lv";
2482
+ },
2483
+ {
2484
+ readonly name: "Inbox";
2485
+ readonly mx: ".inbox.eu";
2486
+ },
2487
+ {
2488
+ readonly name: "Unknown";
2489
+ readonly mx: "..................";
2490
+ },
2491
+ {
2492
+ readonly name: "Webmail";
2493
+ readonly mx: "..................";
2494
+ },
2495
+ {
2496
+ readonly name: "Zimbra";
2497
+ readonly mx: "..................";
2498
+ },
2499
+ {
2500
+ readonly name: "Others";
2501
+ readonly mx: "..................";
2502
+ },
2503
+ {
2504
+ readonly name: "Aruba";
2505
+ readonly mx: "..................";
2506
+ },
2507
+ {
2508
+ readonly name: "Alibaba";
2509
+ readonly mx: "..................";
2510
+ },
2511
+ {
2512
+ readonly name: "IBM";
2513
+ readonly mx: "..................";
2514
+ },
2515
+ {
2516
+ readonly name: "Digitalocean";
2517
+ readonly mx: "..................";
2518
+ },
2519
+ {
2520
+ readonly name: "AWS Partner";
2521
+ readonly mx: "..................";
2522
+ },
2523
+ {
2524
+ readonly name: "Microsoft Exchange";
2525
+ readonly mx: "..................";
2526
+ },
2527
+ {
2528
+ readonly name: "Oracle Cloud";
2529
+ readonly mx: "..................";
2530
+ },
2531
+ {
2532
+ readonly name: "Roundcube Webmail";
2533
+ readonly mx: "..................";
2534
+ },
2535
+ {
2536
+ readonly name: "cPanel Webmail";
2537
+ readonly mx: "..................";
2538
+ },
2539
+ {
2540
+ readonly name: "Yahoo (External Provider)";
2541
+ readonly mx: "..................";
2542
+ },
2543
+ {
2544
+ readonly name: "cPanel Webmail";
2545
+ readonly mx: "..................";
2546
+ },
2547
+ {
2548
+ readonly name: "Disposable";
2549
+ readonly mx: "..................";
2550
+ }
2551
+ ];
2552
+ export type EmailProviderName = typeof records[number]["name"] | ProviderNames;
2553
+ /**
2554
+ * Logger signature for debug output. Receives one preformatted line per event.
2555
+ */
2556
+ export type DebugLogger = (line: string) => void;
2557
+ /**
2558
+ * Verbosity level for debug logging.
2559
+ * - `info` — top-level checkpoints only: validate() enter/exit, MX result,
2560
+ * shallow/deep/Invalid outcome, deep-validation enter/exit,
2561
+ * validateBulk phase boundaries. Best for spotting *where* a hang
2562
+ * occurs without drowning in noise.
2563
+ * - `debug` — adds sub-operations: cache hits/misses, MX→record matches,
2564
+ * domain_check probes, dnsLookup per-IP iteration, IP-cascade
2565
+ * HTTP calls, per-EmailProviders match.
2566
+ * - `trace` — adds every event: inflight hit/cleared, per-mx loop iterations,
2567
+ * per-worker bulk progress, syntax/rejected/disposable early
2568
+ * returns. Use only when `debug` doesn't pinpoint the issue.
2569
+ */
2570
+ export type DebugLevel = "info" | "debug" | "trace";
2571
+ export interface ValidationConfig {
2572
+ /**
2573
+ * Structured debug logging for the validation flow. Off by default.
2574
+ *
2575
+ * - `false` / omitted — silent (no overhead)
2576
+ * - `true` — `info` level, logged to stderr via `console.error`
2577
+ * - `'info' | 'debug' | 'trace'` — that level on stderr
2578
+ * - `(line: string) => void` — `trace` level, each line passed to fn
2579
+ * - `{ level, log }` — both explicit
2580
+ *
2581
+ * Each line is `[zynor HH:MM:SS.mmm <LEVEL>] <scope>: <msg>`.
2582
+ *
2583
+ * @default false
2584
+ */
2585
+ debug?: boolean | DebugLevel | DebugLogger | {
2586
+ level?: DebugLevel;
2587
+ log?: DebugLogger;
2588
+ };
2589
+ /**
2590
+ * @description This will enable deep validation of the email. slower than normal email validator as it triggers multiple dns requests, or travel to the ip address to get the domain name.
2591
+ * This is per request option, passing true to the getProvider without turning this ON, it wont work and vice versa.
2592
+ * @default false
2593
+ */
2594
+ enableDeepValidation?: boolean;
2595
+ /**
2596
+ * @description This will enable the ipResolver for the email validator on deep validation.
2597
+ * @default undefined
2598
+ */
2599
+ ipResolver?: {
2600
+ /**
2601
+ * @description Get your free api keys from https://findip.net to use find-api as a fallback for ipApi if enabled
2602
+ * @default undefined
2603
+ */
2604
+ findip?: {
2605
+ enabled: boolean;
2606
+ apiKey: string[];
2607
+ };
2608
+ /**
2609
+ * @description This is 100% but might throagth that's why we have a fallback to findip.net
2610
+ * if you want to use this feature, change to true enable it
2611
+ * @default false
2612
+ */
2613
+ ipApi?: boolean;
2614
+ /**
2615
+ * @description This is 100% but might throagth that's why we have a fallback to findip.net
2616
+ * if you want to use this feature, change to true enable it
2617
+ * @default false
2618
+ */
2619
+ ipWhoIs?: boolean;
2620
+ };
2621
+ deepValidationOptions?: {
2622
+ /** Max total time (ms) for the entire deep validation phase. @default 3000 */
2623
+ maxTimeout?: number;
2624
+ http?: {
2625
+ timeout?: number;
2626
+ maxRetry?: number;
2627
+ };
2628
+ };
2629
+ }
2630
+ /**
2631
+ * Minimal domain-level cache entry.
2632
+ * Cheap fields (isFree, role, isDisposable) are recomputed on cache hit.
2633
+ */
2634
+ export interface ValidateCacheEntry {
2635
+ provider?: string;
2636
+ status: "valid" | "Invalid" | "Syntax" | "Error" | "Rejected" | "Disposable";
2637
+ message?: string;
2638
+ webmail?: string;
2639
+ /** Validation method — only set for Unknown/Others providers. */
2640
+ method?: "shallow" | "deep";
2641
+ }
2642
+ declare class EmailValidator {
2643
+ private findIpKeys;
2644
+ private roles;
2645
+ private records;
2646
+ private yahooList;
2647
+ private domain;
2648
+ private static instance;
2649
+ private dns;
2650
+ private validateCache;
2651
+ private ipCache;
2652
+ private inflight;
2653
+ private _logFn;
2654
+ /** 0=silent, 1=info, 2=debug, 3=trace */
2655
+ private _logLevel;
2656
+ private validationConfig;
2657
+ constructor(config?: {
2658
+ options?: ValidationConfig;
2659
+ dns?: Omit<ZynorConfig, "cache">;
2660
+ });
2661
+ /**
2662
+ * @internal Overridable factory for the internal DNS resolver. Base
2663
+ * implementation returns a libuv-backed {@link Zynor} (quad9 off,
2664
+ * cache off). The subclass exported from `'zynor/native'` overrides
2665
+ * this to return a hickory-Rust-backed Zynor instead, so users of
2666
+ * that subpath get the Rust DNS engine without any public config
2667
+ * knob.
2668
+ *
2669
+ * Called from the constructor; JS method dispatch goes through the
2670
+ * actual class of `this`, so subclass overrides fire correctly.
2671
+ */
2672
+ protected createDns(config?: Omit<ZynorConfig, "cache">): Zynor;
2673
+ /**
2674
+ * Creates or returns an existing instance of the EmailValidator (Singleton pattern)
2675
+ * @param config - Configuration object for the EmailValidator
2676
+ * @param config.options - Optional validation configuration settings
2677
+ * @param config.options.enableDeepValidation - Enable deep validation with additional DNS lookups
2678
+ * @param config.options.ipResolver - Configure IP resolution settings
2679
+ * @param config.options.ipResolver.findip - Settings for findip.net API
2680
+ * @param config.options.ipResolver.ipApi - Enable/disable ipApi service
2681
+ * @param config.options.ipResolver.ipWhoIs - Enable/disable ipWhoIs service
2682
+ * @param config.dns - Optional DNS configuration settings
2683
+ * @returns The singleton instance of EmailValidator
2684
+ * @example
2685
+ * // Create with default settings
2686
+ * const validator = EmailValidator.create();
2687
+ *
2688
+ * // Create with custom configuration
2689
+ * const validator = EmailValidator.create({
2690
+ * options: {
2691
+ * enableDeepValidation: true,
2692
+ * ipResolver: {
2693
+ * findip: {
2694
+ * enabled: true,
2695
+ * apiKey: ['your-api-key']
2696
+ * }
2697
+ * }
2698
+ * }
2699
+ * });
2700
+ */
2701
+ static create(config?: {
2702
+ options?: ValidationConfig;
2703
+ dns?: ZynorConfig;
2704
+ }): EmailValidator;
2705
+ private getMxRecords;
2706
+ /**
2707
+ * Validates an email address and determines its provider/service
2708
+ * @param email - The email address to validate and analyze
2709
+ * @returns Promise resolving to EmailResponse containing validation status and provider details
2710
+ * @throws Error if email validation fails
2711
+ * @example
2712
+ * const validator = EmailValidator.create();
2713
+ * const result = await validator.validate("user@gmail.com");
2714
+ */
2715
+ validate(email: string): Promise<EmailResponse>;
2716
+ /**
2717
+ * Validates an email address with deep validation and determines its provider/service
2718
+ * @param email - The email address to validate and analyze
2719
+ * @param deep - Set to true to enable deep validation with additional DNS lookups
2720
+ * @returns Promise resolving to EmailResponse containing validation status and provider details
2721
+ * @throws Error if email validation fails
2722
+ * @remarks Deep validation performs additional DNS lookups and domain checks which may be slower
2723
+ * @example
2724
+ * const validator = EmailValidator.create();
2725
+ * const result = await validator.getProvider("user@company.com", true);
2726
+ */
2727
+ validate(email: string, deep: true): Promise<EmailResponse>;
2728
+ /**
2729
+ * Validates an email address with abort/timeout support and optional deep validation
2730
+ * @param email - The email address to validate and analyze
2731
+ * @param options - Options including signal, timeout, and optional deep flag
2732
+ * @returns Promise resolving to EmailResponse containing validation status and provider details
2733
+ * @example
2734
+ * const validator = EmailValidator.create();
2735
+ * const result = await validator.validate("user@company.com", { timeout: 5000 });
2736
+ * const result2 = await validator.validate("user@company.com", { timeout: 5000, deep: true });
2737
+ */
2738
+ validate(email: string, options: AbortOptions & {
2739
+ deep?: boolean;
2740
+ logo?: boolean;
2741
+ }): Promise<EmailResponse>;
2742
+ /**
2743
+ * Emit a log line if its level is at or below the configured threshold.
2744
+ * Format: `[zynor HH:MM:SS.mmm <LVL>] <scope>: <msg>`. Zero formatting
2745
+ * cost when level is filtered out.
2746
+ *
2747
+ * Use the typed wrappers (`_info`/`_debug`/`_trace`) — they make every
2748
+ * call site self-document its expected verbosity.
2749
+ */
2750
+ private _emit;
2751
+ /** Top-level checkpoint (validate enter/exit, MX result, terminal outcome). */
2752
+ private _info;
2753
+ /** Sub-operation (cache hit/miss, network call start/end, sub-loop boundary). */
2754
+ private _debug;
2755
+ /** Fine-grained event (singleflight cleanup, per-iteration loop, early returns). */
2756
+ private _trace;
2757
+ /**
2758
+ * Belt-and-suspenders timeout for DNS calls. Races the underlying
2759
+ * operation against a `setTimeout`-based watchdog so a hung c-ares
2760
+ * query (or a broken AbortSignal propagation) cannot pin the inflight
2761
+ * Map indefinitely. The leaked DNS promise continues running in the
2762
+ * background — c-ares eventually abandons it on its own — but the
2763
+ * wrapper rejects on time and the inflight key is always cleared.
2764
+ *
2765
+ * Logged at INFO so the watchdog firing is visible at default
2766
+ * `debug: true`; the `WATCHDOG fired` line tells you which domain is
2767
+ * misbehaving.
2768
+ */
2769
+ private _withWatchdog;
2770
+ /**
2771
+ * Build a Valid response with `websiteTitle` and optional `loginUrl`
2772
+ * populated from the provider maps in ./provider-webmail.
2773
+ *
2774
+ * `webmail` (record-level override) and `loginUrl` (provider-level default)
2775
+ * coexist: both may be set, neither, or one. All optional fields use
2776
+ * conditional spread to satisfy `exactOptionalPropertyTypes`.
2777
+ */
2778
+ private _buildValidResponse;
2779
+ /**
2780
+ * Reconstruct full EmailResponse from a cache entry + cheap recomputed fields.
2781
+ */
2782
+ private _buildResponse;
2783
+ private _validateCore;
2784
+ /**
2785
+ * Validates multiple email addresses in parallel.
2786
+ * Concurrency is derived from enabled DNS provider limits unless explicitly provided.
2787
+ * Results are returned in the same order as the input array.
2788
+ * Each validation is independent — one failure does not abort others.
2789
+ *
2790
+ * @param emails - Array of email addresses to validate
2791
+ * @param options - Optional bulk validation options
2792
+ * @param options.concurrency - Max parallel validations (defaults to DNS totalConcurrency)
2793
+ * @param options.deep - Enable deep validation for all emails
2794
+ * @param options.signal - AbortSignal to cancel the entire batch
2795
+ * @param options.timeout - Timeout in ms forwarded to each validation
2796
+ * @returns A promise resolving to an array of EmailResponse in the same order as input
2797
+ *
2798
+ * @example
2799
+ * ```typescript
2800
+ * const validator = EmailValidator.create();
2801
+ * const results = await validator.validateBulk(
2802
+ * ['user@gmail.com', 'invalid@@', 'test@company.com'],
2803
+ * { deep: true }
2804
+ * );
2805
+ * // results[0].success === true, results[1].success === false, ...
2806
+ * ```
2807
+ */
2808
+ validateBulk(emails: string[], options?: {
2809
+ concurrency?: number;
2810
+ deep?: boolean;
2811
+ logo?: boolean;
2812
+ signal?: AbortSignal;
2813
+ timeout?: number;
2814
+ }): Promise<EmailResponse[]>;
2815
+ /**
2816
+ * Streams validation results as they complete, in completion order.
2817
+ *
2818
+ * Unlike {@link validateBulk}, which waits for every input before returning,
2819
+ * `each` invokes `onBatch` as soon as enough results have accumulated
2820
+ * (`returnBatch`, default 10) and continues until every input has been
2821
+ * processed. Designed for very large inputs (millions) where time-to-first
2822
+ * result matters and holding the entire result array in memory is wasteful.
2823
+ *
2824
+ * Concurrency is controlled here, not by the DNS layer: every validation
2825
+ * routes through the validator-internal direct path, which bypasses the
2826
+ * per-provider PQueue and rate limiter. DoH providers are load-balanced
2827
+ * round-robin per validation.
2828
+ *
2829
+ * Backpressure: `onBatch` is awaited serially. If the callback is slow and
2830
+ * the in-memory buffer reaches `10 * returnBatch`, workers pause picking
2831
+ * new emails until the buffer drains below the cap. This keeps memory
2832
+ * bounded for truly large inputs.
2833
+ *
2834
+ * Errors:
2835
+ * - Per-email errors become error-shaped {@link EmailResponse} entries in
2836
+ * the stream — they never abort the batch.
2837
+ * - An error thrown by `onBatch` aborts production: workers stop picking
2838
+ * new emails, in-flight work is awaited, and the returned promise
2839
+ * rejects with the first such error.
2840
+ *
2841
+ * Abort: when the supplied `signal` fires, workers stop picking new
2842
+ * emails, in-flight validations finish, the buffer is flushed via
2843
+ * `onBatch`, and the returned promise resolves cleanly.
2844
+ *
2845
+ * @param emails - The list of email addresses to validate
2846
+ * @param options - Streaming options
2847
+ * @param options.concurrency - Max parallel validations (default 500)
2848
+ * @param options.returnBatch - Min results buffered before invoking onBatch (default 10)
2849
+ * @param options.deep - Enable deep validation per email
2850
+ * @param options.logo - Fetch provider logo per email
2851
+ * @param options.signal - AbortSignal to cancel the batch
2852
+ * @param options.timeout - Per-validation timeout in ms
2853
+ * @param onBatch - Invoked with each completed batch; may return a Promise
2854
+ * @returns Resolves once every input has been processed and flushed
2855
+ *
2856
+ * @example
2857
+ * ```typescript
2858
+ * await validator.each(
2859
+ * emails, // could be millions
2860
+ * { concurrency: 500, returnBatch: 50, deep: true },
2861
+ * async (batch) => {
2862
+ * await db.insertMany(batch);
2863
+ * },
2864
+ * );
2865
+ * ```
2866
+ */
2867
+ each(emails: string[], options: {
2868
+ concurrency?: number;
2869
+ returnBatch?: number;
2870
+ deep?: boolean;
2871
+ logo?: boolean;
2872
+ signal?: AbortSignal;
2873
+ timeout?: number;
2874
+ } | undefined, onBatch: (batch: EmailResponse[]) => void | Promise<void>): Promise<void>;
2875
+ private is_wale4r_zimbra;
2876
+ private is_zimbra;
2877
+ private is_webmail;
2878
+ private is_owa;
2879
+ private is_cPanel;
2880
+ private toToken;
2881
+ private parseJSCpanel;
2882
+ private is_Roundcube;
2883
+ private probeUrl;
2884
+ protected domain_check(email?: string, direct?: boolean, _pattern?: number, abortOptions?: AbortOptions): Promise<{
2885
+ status: boolean;
2886
+ type: string;
2887
+ webmail?: string;
2888
+ }>;
2889
+ private resolveA;
2890
+ private getIpCache;
2891
+ private dnsLookup;
2892
+ private returnDNS;
2893
+ protected ipApi(ip: string, abortOptions?: AbortOptions): Promise<[
2894
+ string,
2895
+ string
2896
+ ] | null>;
2897
+ protected ipWhoIs(ip: string, abortOptions?: AbortOptions): Promise<[
2898
+ string,
2899
+ string
2900
+ ] | null>;
2901
+ protected findIp(ip: string, abortOptions?: AbortOptions): Promise<[
2902
+ string,
2903
+ string
2904
+ ] | null>;
2905
+ /**
2906
+ * Checks if the given string is a valid email address according to advanced validation rules.
2907
+ *
2908
+ * This function performs a multi-step validation of an email address. It first checks the general format,
2909
+ * then splits the address into local and domain parts, and applies several constraints:
2910
+ * - Local part must be at least 2 characters, domain part at least 5 characters.
2911
+ * - Local part cannot exceed certain length and may not contain too many hyphens or dots.
2912
+ * - Domain part may not contain too many dots or hyphens.
2913
+ * - Validates extension via this.domain.isDomainExtension.
2914
+ * - Total email length cannot be excessive.
2915
+ *
2916
+ * Validation rules:
2917
+ * - Maximum 35 characters for the local part
2918
+ * - Maximum 3 hyphens in the local part
2919
+ * - Maximum 3 dots in the local part
2920
+ * - Maximum 3 dots in the domain part
2921
+ * - Maximum 2 hyphens in the domain part
2922
+ * - Maximum 55 total characters in the email address
2923
+ * - Local part >= 2 chars; domain part >= 5 chars
2924
+ *
2925
+ * @param {string} email - The email address to validate.
2926
+ * @returns {boolean} True if the email passes all format and structural constraints, false otherwise.
2927
+ *
2928
+ * @example
2929
+ * validator.isEmail("john.doe@example.com"); // true
2930
+ * validator.isEmail("x@y.com"); // false (domain part < 5 chars)
2931
+ * validator.isEmail("toolong--name----more@long-domain-hyphen---.com"); // false
2932
+ */
2933
+ isEmail(email: string): boolean;
2934
+ /**
2935
+ * Checks if the given email or domain name belongs to a free (public/free-to-register) email provider.
2936
+ *
2937
+ * - If an email address is provided, this method extracts the domain part.
2938
+ * - If a domain is provided directly, it is checked as-is.
2939
+ * - Returns `true` if the domain is recognized as a free provider (such as Gmail, Yahoo, Outlook, etc.), otherwise `false`.
2940
+ *
2941
+ * @param {string} email_or_domain - The email address (e.g. "user@gmail.com") or domain name (e.g. "gmail.com") to check.
2942
+ * @returns {boolean} `true` if the domain is a known free email provider, `false` otherwise.
2943
+ *
2944
+ * @example
2945
+ * validator.isFreeDomain('person@yahoo.com'); // returns true
2946
+ * validator.isFreeDomain('gmail.com'); // returns true
2947
+ * validator.isFreeDomain('user@private-company.org'); // returns false
2948
+ * validator.isFreeDomain('private-company.org'); // returns false
2949
+ */
2950
+ isFreeDomain(email_or_domain: string): boolean;
2951
+ /**
2952
+ * Checks if the given email address is disposable.
2953
+ *
2954
+ * This method determines whether the provided email address is from a known disposable email provider.
2955
+ * Disposable email addresses are typically used for temporary or throwaway purposes, and are often associated
2956
+ * with domains that provide temporary inboxes.
2957
+ *
2958
+ * - Returns `true` if the email is found to be disposable using the internal provider list.
2959
+ * - Returns `false` for any non-disposable addresses, invalid addresses, or if the email is not recognized.
2960
+ *
2961
+ * @param {string} email - The email address to check for disposability (e.g., "user@mailinator.com").
2962
+ * @returns {boolean} `true` if the email is disposable, otherwise `false`.
2963
+ *
2964
+ * @example
2965
+ * validator.isDisposable('test@mailinator.com'); // returns true
2966
+ * validator.isDisposable('john.doe@gmail.com'); // returns false
2967
+ *
2968
+ * @see {@link https://github.com/yourrepo/zynor#email-validation}
2969
+ */
2970
+ isDisposable(email: string): boolean;
2971
+ /**
2972
+ * Detects the mail server / webmail provider for a domain by probing common webmail URLs.
2973
+ * This is the deep validation `domain_check` logic exposed as a standalone public method.
2974
+ *
2975
+ * @param domain - The domain name to check (e.g. "example.com")
2976
+ * @param abortOptions - Optional signal/timeout to cancel the operation
2977
+ * @returns An object with `status`, `type` (provider name), and optional `webmail` URL
2978
+ *
2979
+ * @example
2980
+ * const result = await validator.detectMailProvider('company.com');
2981
+ * // { status: true, type: 'Zimbra', webmail: 'https://mail.company.com' }
2982
+ *
2983
+ * @example
2984
+ * const result = await validator.detectMailProvider('unknown.io', { timeout: 2000 });
2985
+ * // { status: false, type: '' }
2986
+ */
2987
+ detectMailProvider(domain: string, abortOptions?: AbortOptions): Promise<{
2988
+ status: boolean;
2989
+ type: string;
2990
+ webmail?: string;
2991
+ }>;
2992
+ /**
2993
+ * Detects the hosting provider for a domain by resolving its A records and looking up IP info.
2994
+ * Identifies providers like AWS, Microsoft, DigitalOcean, Oracle, IBM, Alibaba, and Aruba.
2995
+ *
2996
+ * Works independently of `enableDeepValidation`. Only requires `ipResolver` config:
2997
+ * - `ipResolver.ipApi: true` for ip-api.com lookups
2998
+ * - `ipResolver.findip: { enabled: true, apiKey: [...] }` for findip.net fallback
2999
+ *
3000
+ * @param domain - The domain name to check (e.g. "mail.example.com")
3001
+ * @param abortOptions - Optional signal/timeout to cancel the operation
3002
+ * @returns An object with `status` and `type` (hosting provider name)
3003
+ *
3004
+ * @example
3005
+ * const validator = EmailValidator.create({
3006
+ * options: { ipResolver: { ipApi: true } }
3007
+ * });
3008
+ * const result = await validator.detectHostingProvider('mail.company.com');
3009
+ * // { status: true, type: 'AWS Partner' }
3010
+ */
3011
+ detectHostingProvider(domain: string, abortOptions?: AbortOptions): Promise<{
3012
+ status: boolean;
3013
+ type: string;
3014
+ webmail?: string;
3015
+ }>;
3016
+ private is_email;
3017
+ private isDomainOrUrl;
3018
+ /**
3019
+ * Checks if the input string is a valid JSON array of strings, where each string is a valid email address.
3020
+ *
3021
+ * - Attempts to parse the input string as JSON.
3022
+ * - Ensures the parsed value is an array of non-empty strings.
3023
+ * - Each element is also checked (using this.isEmail) to confirm it is a valid email address.
3024
+ * - If all conditions are met and the array has at least one valid email, returns the array.
3025
+ * - Otherwise, returns null.
3026
+ *
3027
+ * @param {string} input - The input string to validate.
3028
+ * @returns {string[] | null} The parsed array of valid email addresses if all conditions are met, otherwise null.
3029
+ *
3030
+ * @example
3031
+ * validator.isJson('["hello@site.com", "test@a.io"]'); // returns ["hello@site.com", "test@a.io"]
3032
+ * validator.isJson('["foo", 1, null]'); // returns null
3033
+ * validator.isJson('not json'); // returns null
3034
+ * validator.isJson('[]'); // returns null
3035
+ */
3036
+ isJson(input: string): string[] | null;
3037
+ /**
3038
+ * Extracts and returns an array of valid email addresses from various input formats.
3039
+ *
3040
+ * This method processes input strings that may contain:
3041
+ * - Plain email addresses
3042
+ * - Comma-separated email addresses
3043
+ * - URL-encoded strings (automatically decoded)
3044
+ * - JSON arrays containing email addresses
3045
+ *
3046
+ * The function will:
3047
+ * 1. URL-decode each input string
3048
+ * 2. Split comma-separated values
3049
+ * 3. Validate each token as an email address
3050
+ * 4. Parse JSON arrays and extract valid emails from them
3051
+ * 5. Return a flat array of all valid email addresses found
3052
+ *
3053
+ * Note: Domain/URL detection is currently disabled (commented out in the implementation).
3054
+ * Only valid email addresses are included in the result.
3055
+ *
3056
+ * @param {string[]} input - An array of strings that may contain email addresses in various formats.
3057
+ * Each string can be:
3058
+ * - A single email address
3059
+ * - Comma-separated email addresses
3060
+ * - URL-encoded email addresses
3061
+ * - A JSON array string containing email addresses
3062
+ * - Any combination of the above
3063
+ *
3064
+ * @returns {string[]} An array of valid email addresses extracted from the input.
3065
+ * Duplicate emails may be present if they appear multiple times in the input.
3066
+ * Returns an empty array if no valid emails are found.
3067
+ *
3068
+ * @example
3069
+ * // Single email
3070
+ * validator.extractEmailsFromArray(["user@example.com"]);
3071
+ * // Returns: ["user@example.com"]
3072
+ *
3073
+ * @example
3074
+ * // Comma-separated emails
3075
+ * validator.extractEmailsFromArray(["user1@example.com,user2@example.com"]);
3076
+ * // Returns: ["user1@example.com", "user2@example.com"]
3077
+ *
3078
+ * @example
3079
+ * // URL-encoded and comma-separated
3080
+ * validator.extractEmailsFromArray(["user%40example.com,test%40domain.com"]);
3081
+ * // Returns: ["user@example.com", "test@domain.com"]
3082
+ *
3083
+ * @example
3084
+ * // JSON array of emails
3085
+ * validator.extractEmailsFromArray(['["email1@test.com", "email2@test.com"]']);
3086
+ * // Returns: ["email1@test.com", "email2@test.com"]
3087
+ *
3088
+ * @example
3089
+ * // Mixed formats
3090
+ * validator.extractEmailsFromArray([
3091
+ * "user@example.com",
3092
+ * "test@domain.com,admin@site.com",
3093
+ * '["json@email.com"]'
3094
+ * ]);
3095
+ * // Returns: ["user@example.com", "test@domain.com", "admin@site.com", "json@email.com"]
3096
+ *
3097
+ * @example
3098
+ * // Invalid emails are filtered out
3099
+ * validator.extractEmailsFromArray(["valid@example.com", "invalid-email", "another@valid.com"]);
3100
+ * // Returns: ["valid@example.com", "another@valid.com"]
3101
+ */
3102
+ extractEmailsFromArray(input: string[]): string[];
3103
+ /**
3104
+ * Retrieves the webmail URL for a given email provider or domain/email address.
3105
+ *
3106
+ * This method returns the webmail login URL for known email providers (e.g., Gmail, Yahoo, Outlook).
3107
+ * It supports multiple calling patterns:
3108
+ * - By provider name only (returns the standard webmail URL for that provider)
3109
+ * - By provider name with domain/email (for providers that may have custom domains)
3110
+ * - By domain/email address directly (automatically detects if the string is a domain or email)
3111
+ *
3112
+ * The method first checks if the provider has a known webmail URL in the internal provider list.
3113
+ * If not found and a domain/email is provided, it attempts to resolve the webmail URL from the domain.
3114
+ *
3115
+ * Supported providers include major global providers (Gmail, Yahoo, Outlook, etc.), regional providers,
3116
+ * business/enterprise providers, and many others. See the provider list for complete coverage.
3117
+ *
3118
+ * @overload
3119
+ * @param {EmailProviderName} provider - The name of the email provider (e.g., "Gmail", "Yahoo", "Outlook").
3120
+ * @returns {string | null} The webmail URL for the provider, or `null` if not found.
3121
+ *
3122
+ * @overload
3123
+ * @param {EmailProviderName} provider - The name of the email provider.
3124
+ * @param {string} domainOrEmail - A domain name (e.g., "example.com") or email address (e.g., "user@example.com").
3125
+ * Used as a fallback if the provider name doesn't have a direct URL mapping.
3126
+ * @returns {string | null} The webmail URL for the provider/domain, or `null` if not found.
3127
+ *
3128
+ * @overload
3129
+ * @param {string} domainOrEmail - A domain name (e.g., "gmail.com") or email address (e.g., "user@gmail.com").
3130
+ * The method automatically detects if this is a domain or email by checking for "@" or ".".
3131
+ * @returns {string | null} The webmail URL for the domain, or `null` if not found.
3132
+ *
3133
+ * @example
3134
+ * // Get webmail URL by provider name
3135
+ * validator.getProviderWebmailUrl("Gmail");
3136
+ * // Returns: "https://mail.google.com"
3137
+ *
3138
+ * @example
3139
+ * // Get webmail URL by provider name with domain
3140
+ * validator.getProviderWebmailUrl("Yahoo", "yahoo.com");
3141
+ * // Returns: "https://mail.yahoo.com"
3142
+ *
3143
+ * @example
3144
+ * // Get webmail URL by email address (auto-detects domain)
3145
+ * validator.getProviderWebmailUrl("user@gmail.com");
3146
+ * // Returns: "https://mail.google.com"
3147
+ *
3148
+ * @example
3149
+ * // Get webmail URL by domain name
3150
+ * validator.getProviderWebmailUrl("outlook.com");
3151
+ * // Returns: "https://outlook.live.com"
3152
+ *
3153
+ * @example
3154
+ * // Unknown provider returns null
3155
+ * validator.getProviderWebmailUrl("UnknownProvider");
3156
+ * // Returns: null
3157
+ *
3158
+ * @example
3159
+ * // Provider with domain fallback
3160
+ * validator.getProviderWebmailUrl("CustomProvider", "customdomain.com");
3161
+ * // May return a URL if the domain is recognized as a free provider
3162
+ */
3163
+ getProviderWebmailUrl(provider: EmailProviderName): string | null;
3164
+ getProviderWebmailUrl(provider: EmailProviderName, domainOrEmail: string): string | null;
3165
+ getProviderWebmailUrl(domainOrEmail: string): string | null;
3166
+ /**
3167
+ * Extract and validate email addresses from mixed HTML or plain-text content.
3168
+ *
3169
+ * The method:
3170
+ * 1. Sanitizes the input by stripping HTML tags and removing non-essential punctuation.
3171
+ * 2. Applies a robust regular-expression pattern to locate candidate email strings.
3172
+ * 3. Validates each candidate against the full RFC-style rules implemented in {@link isEmail}.
3173
+ * 4. De-duplicates the final list while preserving the original order of first appearance.
3174
+ *
3175
+ * @param content - Arbitrary HTML or plain-text that may contain zero or more email addresses.
3176
+ * @returns An array of unique, syntactically valid email addresses discovered in the supplied content.
3177
+ * Returns an empty array when no valid emails are found.
3178
+ *
3179
+ * @example
3180
+ * // Plain text
3181
+ * validator.extractEmails('Contact us at support@example.com or sales@example.com');
3182
+ * // → ['support@example.com', 'sales@example.com']
3183
+ *
3184
+ * @example
3185
+ * // HTML fragment
3186
+ * validator.extractEmails('<a href="mailto:info@site.org">Info</a> <span>admin@site.org</span>');
3187
+ * // → ['info@site.org', 'admin@site.org']
3188
+ *
3189
+ * @example
3190
+ * // Duplicates are removed
3191
+ * validator.extractEmails('user@demo.io, User@demo.io, USER@DEMO.IO');
3192
+ * // → ['user@demo.io']
3193
+ */
3194
+ extractEmails(content: string): string[];
3195
+ }
3196
+ export interface Valid {
3197
+ success: true;
3198
+ data: {
3199
+ provider: EmailProviderName;
3200
+ isFree: boolean;
3201
+ email: string;
3202
+ role: boolean;
3203
+ websiteTitle: string;
3204
+ webmail?: string;
3205
+ loginUrl?: string;
3206
+ logo?: string;
3207
+ };
3208
+ }
3209
+ export interface Invalid {
3210
+ success: false;
3211
+ type: "Invalid";
3212
+ email: string;
3213
+ role: boolean;
3214
+ }
3215
+ export interface EmailDisposable {
3216
+ success: false;
3217
+ type: "Disposable";
3218
+ email: string;
3219
+ role: boolean;
3220
+ }
3221
+ export interface Rejected {
3222
+ success: false;
3223
+ type: "Rejected";
3224
+ email: string;
3225
+ role: boolean;
3226
+ }
3227
+ export interface Syntax {
3228
+ success: false;
3229
+ type: "Syntax";
3230
+ email: string;
3231
+ role: boolean;
3232
+ }
3233
+ export interface EmailError {
3234
+ success: false;
3235
+ type: "Error";
3236
+ email: string;
3237
+ message: string;
3238
+ role: boolean;
3239
+ }
3240
+ export type EmailResponse = Valid | Invalid | Rejected | Syntax | EmailError | EmailDisposable;
3241
+ export interface RustResolveOptions {
3242
+ /** Hard deadline in milliseconds. Rust task self-cancels at the
3243
+ * boundary; prevents orphan tasks if the JS caller's watchdog gives
3244
+ * up first. `| undefined` is explicit so callers can spread
3245
+ * `{ timeoutMs: options?.timeout }` under exactOptionalPropertyTypes. */
3246
+ timeoutMs?: number | undefined;
3247
+ }
3248
+ export interface RustMxRecord {
3249
+ exchange: string;
3250
+ priority: number;
3251
+ }
3252
+ export interface RustSrvRecord {
3253
+ priority: number;
3254
+ weight: number;
3255
+ port: number;
3256
+ name: string;
3257
+ }
3258
+ export interface RustSoaRecord {
3259
+ nsname: string;
3260
+ hostmaster: string;
3261
+ serial: number;
3262
+ refresh: number;
3263
+ retry: number;
3264
+ expire: number;
3265
+ minttl: number;
3266
+ }
3267
+ export interface RustCaaRecord {
3268
+ /** 128 when issuer-critical bit set, 0 otherwise (mirrors libuv). */
3269
+ critical: number;
3270
+ issue?: string;
3271
+ issuewild?: string;
3272
+ iodef?: string;
3273
+ }
3274
+ export interface RustNaptrRecord {
3275
+ order: number;
3276
+ preference: number;
3277
+ flags: string;
3278
+ service: string;
3279
+ regexp: string;
3280
+ replacement: string;
3281
+ }
3282
+ /** TLSA. Note: field is `matching` (not `match`); the validator-side
3283
+ * adapter renames if needed for the public TS type. */
3284
+ export interface RustTlsaRecord {
3285
+ certUsage: number;
3286
+ selector: number;
3287
+ matching: number;
3288
+ data: Uint8Array;
3289
+ }
3290
+ /** Generic envelope for `resolveAny`. Different shape from node:dns's
3291
+ * tagged union — `kind` is the record-type name ("A", "MX", …) and
3292
+ * `data` is hickory's textual rendering. The validator's hot path
3293
+ * doesn't use ANY, so divergence is acceptable. */
3294
+ export interface RustAnyRecord {
3295
+ kind: string;
3296
+ data: string;
3297
+ ttl: number;
3298
+ }
3299
+ export interface RustBinding {
3300
+ resolveMx(hostname: string, options?: RustResolveOptions | null): Promise<RustMxRecord[]>;
3301
+ resolveA(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
3302
+ resolveAaaa(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
3303
+ resolveCname(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
3304
+ resolveTxt(hostname: string, options?: RustResolveOptions | null): Promise<string[][]>;
3305
+ resolveNs(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
3306
+ resolvePtr(hostname: string, options?: RustResolveOptions | null): Promise<string[]>;
3307
+ resolveSrv(hostname: string, options?: RustResolveOptions | null): Promise<RustSrvRecord[]>;
3308
+ resolveSoa(hostname: string, options?: RustResolveOptions | null): Promise<RustSoaRecord | null>;
3309
+ resolveCaa(hostname: string, options?: RustResolveOptions | null): Promise<RustCaaRecord[]>;
3310
+ resolveNaptr(hostname: string, options?: RustResolveOptions | null): Promise<RustNaptrRecord[]>;
3311
+ resolveTlsa(hostname: string, options?: RustResolveOptions | null): Promise<RustTlsaRecord[]>;
3312
+ resolveAny(hostname: string, options?: RustResolveOptions | null): Promise<RustAnyRecord[]>;
3313
+ reverseLookup(ip: string, options?: RustResolveOptions | null): Promise<string[]>;
3314
+ buildInfo?(): string;
3315
+ }
3316
+ declare class Zynor {
3317
+ private providers;
3318
+ private static __emailValidator;
3319
+ private dnsCache;
3320
+ private dnsTtl;
3321
+ private inflight;
3322
+ private rrIndex;
3323
+ protected rust: RustBinding | null;
3324
+ private dnsInFlight;
3325
+ /** Epoch-ms until which a DoH provider is considered failing and excluded
3326
+ * from {@link pickFreestProvider}. Native is never paused — libuv errors
3327
+ * are local concerns, not upstream-health signals. */
3328
+ private dohPausedUntil;
3329
+ /** Consecutive-failure counters per provider; reset on any success. We only
3330
+ * pause once a provider's streak exceeds {@link DOH_PAUSE_AFTER}, so single
3331
+ * transient errors don't cascade-pause healthy providers under high load. */
3332
+ private dohFailureStreak;
3333
+ private static readonly DOH_PAUSE_MS;
3334
+ private static readonly DOH_PAUSE_AFTER;
3335
+ /** Native's reported `concurrency` (default 50) is the PQueue limit, which
3336
+ * the validator path bypasses anyway. The *real* parallel ceiling is
3337
+ * libuv's getaddrinfo thread pool — defaults to 4 unless UV_THREADPOOL_SIZE
3338
+ * is set. {@link pickFreestProvider} uses this to weight native correctly
3339
+ * in load balancing instead of dumping 60%+ of traffic on libuv. */
3340
+ private static readonly NATIVE_EFFECTIVE_CONCURRENCY;
3341
+ /**
3342
+ * Creates a new Zynor resolver instance.
3343
+ * @param config - Configuration for all providers
3344
+ * @example
3345
+ * ```typescript
3346
+ * const dns = new Zynor({
3347
+ * google: { enabled: true, limit: { concurrency: 10 } },
3348
+ * cloudflare: { enabled: false }
3349
+ * });
3350
+ * ```
3351
+ */
3352
+ constructor(config?: ZynorConfig);
3353
+ private cachedResolve;
3354
+ /**
3355
+ * Creates or returns a singleton instance of EmailValidator.
3356
+ * If an instance already exists, returns the existing instance.
3357
+ * If no instance exists, creates a new one with the provided configuration.
3358
+ *
3359
+ * @param config - Configuration object for the EmailValidator
3360
+ * @param config.options - Optional validation configuration settings
3361
+ * @param config.options.allowIPv6 - Whether to allow IPv6 addresses in email domains
3362
+ * @param config.options.allowInternational - Whether to allow international email addresses
3363
+ * @param config.options.checkDNS - Whether to perform DNS lookups during validation
3364
+ * @param config.dns - Optional DNS configuration for the validator's DNS resolver
3365
+ * @returns An EmailValidator instance
3366
+ *
3367
+ * @example
3368
+ * ```typescript
3369
+ * // Create with default configuration
3370
+ * const validator = Zynor.createEmailValidator();
3371
+ *
3372
+ * // Create with custom configuration
3373
+ * const validator = Zynor.createEmailValidator({
3374
+ * options: {
3375
+ * allowIPv6: true,
3376
+ * checkDNS: true
3377
+ * },
3378
+ * dns: {
3379
+ * google: { enabled: true }
3380
+ * }
3381
+ * });
3382
+ * ```
3383
+ */
3384
+ static createEmailValidator(config?: {
3385
+ options?: ValidationConfig;
3386
+ dns?: ZynorConfig;
3387
+ }): EmailValidator;
3388
+ static get emailValidator(): EmailValidator;
3389
+ /**
3390
+ * Initializes all DNS providers with their configurations.
3391
+ */
3392
+ private initializeProviders;
3393
+ /**
3394
+ * @internal Overridable factory for the `native` provider. Base
3395
+ * implementation returns a libuv-backed NativeProvider. The subclass
3396
+ * exported from `'zynor/native'` overrides this to inject `useRust: true`
3397
+ * so importers of that subpath get the hickory-dns binding.
3398
+ *
3399
+ * Called from {@link initializeProviders} during construction. JS method
3400
+ * dispatch resolves through the *actual* class of `this`, so subclass
3401
+ * overrides fire correctly even though the call site is in the base
3402
+ * constructor's code path.
3403
+ */
3404
+ protected createNativeProvider(config?: ProviderConfig): NativeProvider;
3405
+ /**
3406
+ * Sets configuration for a specific provider.
3407
+ * @param provider - The provider name
3408
+ * @param config - The provider configuration
3409
+ * @throws {InvalidProviderError} If the provider name is invalid
3410
+ * @example
3411
+ * ```typescript
3412
+ * dns.setConfig('google', { enabled: true, limit: { concurrency: 15 } });
3413
+ * ```
3414
+ */
3415
+ setConfig(provider: string, config: ProviderConfig): void;
3416
+ /**
3417
+ * Sets configurations for all providers.
3418
+ * @param config - Configuration object for all providers
3419
+ * @example
3420
+ * ```typescript
3421
+ * dns.setConfigs({
3422
+ * native: { enabled: true },
3423
+ * google: { enabled: true, limit: { concurrency: 10 } },
3424
+ * cloudflare: { enabled: false },
3425
+ * quad9: { enabled: true }
3426
+ * });
3427
+ * ```
3428
+ */
3429
+ setConfigs(config: ZynorConfig): void;
3430
+ /**
3431
+ * Validates if a provider name is valid.
3432
+ */
3433
+ private isValidProvider;
3434
+ /**
3435
+ * Validates hostname format.
3436
+ */
3437
+ private validateHostname;
3438
+ /**
3439
+ * Gets all enabled providers.
3440
+ */
3441
+ private getEnabledProviders;
3442
+ /**
3443
+ * Selects a random enabled provider, preferring non-full queues.
3444
+ */
3445
+ private selectProvider;
3446
+ private rnd;
3447
+ /**
3448
+ * Parses the second argument which can be either AbortOptions or a provider string.
3449
+ */
3450
+ private parseArgs;
3451
+ /**
3452
+ * Gets a provider instance by name.
3453
+ */
3454
+ private getProvider;
3455
+ /**
3456
+ * Resolves A records for a hostname.
3457
+ * @param hostname - The hostname to resolve
3458
+ * @param options - Optional resolution options
3459
+ * @param provider - Optional specific provider to use (e.g., 'google', 'cloudflare')
3460
+ * @returns A promise resolving to an array of IPv4 addresses or records with TTL
3461
+ * @throws {InvalidHostnameError} If the hostname is invalid
3462
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3463
+ * @example
3464
+ * ```typescript
3465
+ * const addresses = await dns.resolve4('example.com');
3466
+ * console.log(addresses); // ['93.184.216.34']
3467
+ *
3468
+ * const withTtl = await dns.resolve4('example.com', { ttl: true });
3469
+ * console.log(withTtl); // [{ address: '93.184.216.34', ttl: 300 }]
3470
+ * ```
3471
+ */
3472
+ resolve4: IResolver["resolve4"];
3473
+ /**
3474
+ * Resolves AAAA records for a hostname.
3475
+ * @param hostname - The hostname to resolve
3476
+ * @param options - Optional resolution options
3477
+ * @param provider - Optional specific provider to use
3478
+ * @returns A promise resolving to an array of IPv6 addresses or records with TTL
3479
+ * @throws {InvalidHostnameError} If the hostname is invalid
3480
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3481
+ * @example
3482
+ * ```typescript
3483
+ * const addresses = await dns.resolve6('example.com');
3484
+ * console.log(addresses); // ['2606:2800:220:1:248:1893:25c8:1946']
3485
+ * ```
3486
+ */
3487
+ resolve6: IResolver["resolve6"];
3488
+ /**
3489
+ * Resolves ANY records for a hostname.
3490
+ * @param hostname - The hostname to resolve
3491
+ * @param provider - Optional specific provider to use
3492
+ * @returns A promise resolving to an array of any DNS records
3493
+ * @throws {InvalidHostnameError} If the hostname is invalid
3494
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3495
+ * @example
3496
+ * ```typescript
3497
+ * const records = await dns.resolveAny('example.com');
3498
+ * console.log(records); // [{ type: 'A', address: '93.184.216.34' }, ...]
3499
+ * ```
3500
+ */
3501
+ resolveAny: IResolver["resolveAny"];
3502
+ /**
3503
+ * Resolves CAA records for a hostname.
3504
+ * @param hostname - The hostname to resolve
3505
+ * @param provider - Optional specific provider to use
3506
+ * @returns A promise resolving to an array of CAA records
3507
+ * @throws {InvalidHostnameError} If the hostname is invalid
3508
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3509
+ */
3510
+ resolveCaa: IResolver["resolveCaa"];
3511
+ /**
3512
+ * Resolves CNAME records for a hostname.
3513
+ * @param hostname - The hostname to resolve
3514
+ * @param provider - Optional specific provider to use
3515
+ * @returns A promise resolving to an array of CNAME records
3516
+ * @throws {InvalidHostnameError} If the hostname is invalid
3517
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3518
+ */
3519
+ resolveCname: IResolver["resolveCname"];
3520
+ /**
3521
+ * Resolves MX records for a hostname.
3522
+ * @param hostname - The hostname to resolve
3523
+ * @param provider - Optional specific provider to use
3524
+ * @returns A promise resolving to an array of MX records
3525
+ * @throws {InvalidHostnameError} If the hostname is invalid
3526
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3527
+ * @example
3528
+ * ```typescript
3529
+ * const mxRecords = await dns.resolveMx('example.com');
3530
+ * console.log(mxRecords); // [{ priority: 10, exchange: 'mail.example.com' }]
3531
+ * ```
3532
+ */
3533
+ resolveMx: IResolver["resolveMx"];
3534
+ /**
3535
+ * Resolves NAPTR records for a hostname.
3536
+ * @param hostname - The hostname to resolve
3537
+ * @param provider - Optional specific provider to use
3538
+ * @returns A promise resolving to an array of NAPTR records
3539
+ * @throws {InvalidHostnameError} If the hostname is invalid
3540
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3541
+ */
3542
+ resolveNaptr: IResolver["resolveNaptr"];
3543
+ /**
3544
+ * Resolves NS records for a hostname.
3545
+ * @param hostname - The hostname to resolve
3546
+ * @param provider - Optional specific provider to use
3547
+ * @returns A promise resolving to an array of NS records
3548
+ * @throws {InvalidHostnameError} If the hostname is invalid
3549
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3550
+ */
3551
+ resolveNs: IResolver["resolveNs"];
3552
+ /**
3553
+ * Resolves PTR records for an IP address.
3554
+ * @param ip - The IP address to resolve
3555
+ * @param provider - Optional specific provider to use
3556
+ * @returns A promise resolving to an array of PTR records
3557
+ * @throws {InvalidHostnameError} If the IP address is invalid
3558
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3559
+ */
3560
+ resolvePtr: IResolver["resolvePtr"];
3561
+ /**
3562
+ * Resolves SOA record for a hostname.
3563
+ * @param hostname - The hostname to resolve
3564
+ * @param provider - Optional specific provider to use
3565
+ * @returns A promise resolving to the SOA record
3566
+ * @throws {InvalidHostnameError} If the hostname is invalid
3567
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3568
+ */
3569
+ resolveSoa: IResolver["resolveSoa"];
3570
+ /**
3571
+ * Resolves SRV records for a hostname.
3572
+ * @param hostname - The hostname to resolve
3573
+ * @param provider - Optional specific provider to use
3574
+ * @returns A promise resolving to an array of SRV records
3575
+ * @throws {InvalidHostnameError} If the hostname is invalid
3576
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3577
+ */
3578
+ resolveSrv: IResolver["resolveSrv"];
3579
+ /**
3580
+ * Resolves TLSA records for a hostname.
3581
+ * @param hostname - The hostname to resolve
3582
+ * @param provider - Optional specific provider to use
3583
+ * @returns A promise resolving to an array of TLSA records
3584
+ * @throws {InvalidHostnameError} If the hostname is invalid
3585
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3586
+ */
3587
+ resolveTlsa: IResolver["resolveTlsa"];
3588
+ /**
3589
+ * Resolves TXT records for a hostname.
3590
+ * @param hostname - The hostname to resolve
3591
+ * @param provider - Optional specific provider to use
3592
+ * @returns A promise resolving to an array of TXT records
3593
+ * @throws {InvalidHostnameError} If the hostname is invalid
3594
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3595
+ * @example
3596
+ * ```typescript
3597
+ * const txtRecords = await dns.resolveTxt('example.com');
3598
+ * console.log(txtRecords); // [['v=spf1 include:_spf.example.com ~all']]
3599
+ * ```
3600
+ */
3601
+ resolveTxt: IResolver["resolveTxt"];
3602
+ /**
3603
+ * Performs reverse DNS lookup for an IP address.
3604
+ * @param ip - The IP address to reverse lookup
3605
+ * @param provider - Optional specific provider to use
3606
+ * @returns A promise resolving to an array of hostnames
3607
+ * @throws {InvalidHostnameError} If the IP address is invalid
3608
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3609
+ * @example
3610
+ * ```typescript
3611
+ * const hostnames = await dns.reverse('8.8.8.8');
3612
+ * console.log(hostnames); // ['dns.google.']
3613
+ * ```
3614
+ */
3615
+ reverse: IResolver["reverse"];
3616
+ /**
3617
+ * Generic resolve method that delegates to specific resolve methods.
3618
+ * @param hostname - The hostname to resolve
3619
+ * @param rrtype - The DNS record type
3620
+ * @param provider - Optional specific provider to use
3621
+ * @returns A promise resolving to DNS records of the specified type
3622
+ * @throws {InvalidHostnameError} If the hostname is invalid
3623
+ * @throws {NoEnabledProvidersError} If no providers are enabled
3624
+ * @example
3625
+ * ```typescript
3626
+ * const aRecords = await dns.resolve('example.com', 'A');
3627
+ * const mxRecords = await dns.resolve('example.com', 'MX');
3628
+ * ```
3629
+ */
3630
+ resolve: IResolver["resolve"];
3631
+ /**
3632
+ * @internal Validator-only. Picks the enabled provider with the lowest
3633
+ * load ratio (`inFlight / effectiveCapacity`), which yields a distribution
3634
+ * proportional to each provider's capacity even when total in-flight far
3635
+ * exceeds total capacity. A simple slack-based picker over-saturates
3636
+ * everyone equally above their cap and effectively ignores weights; the
3637
+ * ratio formulation keeps weights honest at any load level.
3638
+ *
3639
+ * Native is included but its effective cap is clamped to libuv's
3640
+ * getaddrinfo pool ({@link NATIVE_EFFECTIVE_CONCURRENCY}, defaults to
3641
+ * UV_THREADPOOL_SIZE or 4) — otherwise the validator would dump 50+ in-
3642
+ * flight lookups onto a 4-thread pool. Paused DoH providers are excluded;
3643
+ * if every enabled provider is paused, the filter is dropped.
3644
+ *
3645
+ * RR breaks ties so even loads spread.
3646
+ */
3647
+ private pickFreestProvider;
3648
+ /**
3649
+ * Distinguishes "this provider is broken/slow" from cases that don't
3650
+ * indicate provider health:
3651
+ * - DNS-level no-such-name answers (ENOTFOUND/NODATA): authoritative,
3652
+ * not the provider's fault.
3653
+ * - AbortError: caller-initiated cancellation or per-call timeout.
3654
+ * A user's tight deadline shouldn't make us blacklist a healthy provider.
3655
+ */
3656
+ private isProviderFailure;
3657
+ /**
3658
+ * @internal Validator-only. Direct DNS path that bypasses the per-provider
3659
+ * PQueue and rate limiter while keeping LRU cache + singleflight. Provider
3660
+ * is chosen by least-loaded-first (the validator does not need to know or
3661
+ * pick); the in-flight counter is incremented inside the singleflight
3662
+ * closure so coalesced waiters don't overcount upstream load. Public
3663
+ * consumers must continue to use the queued resolve* methods.
3664
+ */
3665
+ _resolveDirect<T>(hostname: string, type: RecordType, options?: AbortOptions): Promise<T>;
3666
+ /**
3667
+ * Returns the sum of concurrency limits across all enabled DNS providers.
3668
+ * Used by `validateBulk` to determine default parallelism.
3669
+ * @example
3670
+ * ```typescript
3671
+ * const dns = new Zynor({ google: { enabled: true }, cloudflare: { enabled: true } });
3672
+ * console.log(dns.totalConcurrency); // 20 (10 + 10)
3673
+ * ```
3674
+ */
3675
+ get totalConcurrency(): number;
3676
+ /**
3677
+ * Validates multiple email addresses in parallel using the email validator.
3678
+ * Concurrency is derived from enabled DNS provider limits unless explicitly provided.
3679
+ * @param emails - Array of email addresses to validate
3680
+ * @param options - Optional bulk validation options
3681
+ * @returns A promise resolving to an array of EmailResponse in the same order as input
3682
+ * @example
3683
+ * ```typescript
3684
+ * const results = await Zynor.validateBulk(['user@gmail.com', 'test@example.com']);
3685
+ * console.log(results); // [{ success: true, data: { provider: 'Google', ... } }, ...]
3686
+ * ```
3687
+ */
3688
+ static validateBulk(emails: string[], options?: {
3689
+ concurrency?: number;
3690
+ deep?: boolean;
3691
+ logo?: boolean;
3692
+ signal?: AbortSignal;
3693
+ timeout?: number;
3694
+ }): Promise<EmailResponse[]>;
3695
+ /**
3696
+ * Streams validation results as they complete. Forwards to
3697
+ * {@link EmailValidator.each} on the singleton validator. See `each` for
3698
+ * full semantics — defaults are `concurrency: 500`, `returnBatch: 10`, and
3699
+ * all validator-routed DNS calls bypass the per-provider queue.
3700
+ *
3701
+ * @param emails - The list of email addresses to validate
3702
+ * @param options - Streaming options (concurrency, returnBatch, deep, etc.)
3703
+ * @param onBatch - Callback invoked with each completed batch
3704
+ * @returns Resolves once every input has been processed and flushed
3705
+ *
3706
+ * @example
3707
+ * ```typescript
3708
+ * await Zynor.each(emails, { returnBatch: 50 }, async (batch) => {
3709
+ * await db.insertMany(batch);
3710
+ * });
3711
+ * ```
3712
+ */
3713
+ static each(emails: string[], options: {
3714
+ concurrency?: number;
3715
+ returnBatch?: number;
3716
+ deep?: boolean;
3717
+ logo?: boolean;
3718
+ signal?: AbortSignal;
3719
+ timeout?: number;
3720
+ } | undefined, onBatch: Parameters<EmailValidator["each"]>[2]): Promise<void>;
3721
+ }
3722
+ /**
3723
+ * Identical to {@link BaseZynor} except the `native` provider routes
3724
+ * through the hickory-dns Rust binding. Overrides {@link BaseZynor.createNativeProvider}.
3725
+ */
3726
+ declare class Zynor$1 extends Zynor {
3727
+ constructor(config?: ZynorConfig);
3728
+ }
3729
+ /**
3730
+ * Identical to {@link BaseEmailValidator} except the internal DNS
3731
+ * resolver is a {@link Zynor} — every DNS call zynor makes during
3732
+ * validation routes through the Rust binding.
3733
+ */
3734
+ declare class NativeEmailValidator extends EmailValidator {
3735
+ protected createDns(config?: Omit<ZynorConfig, "cache">): Zynor$1;
3736
+ }
3737
+ export declare const resetDefaultResolver: () => void;
3738
+ export declare const setDefaultResolver: (resolver: Zynor$1) => void;
3739
+ export declare const resolve4: IResolver["resolve4"];
3740
+ export declare const resolve6: IResolver["resolve6"];
3741
+ export declare const resolveAny: IResolver["resolveAny"];
3742
+ export declare const resolveCaa: IResolver["resolveCaa"];
3743
+ export declare const resolveCname: IResolver["resolveCname"];
3744
+ export declare const resolveMx: IResolver["resolveMx"];
3745
+ export declare const resolveNaptr: IResolver["resolveNaptr"];
3746
+ export declare const resolveNs: IResolver["resolveNs"];
3747
+ export declare const resolvePtr: IResolver["resolvePtr"];
3748
+ export declare const resolveSoa: IResolver["resolveSoa"];
3749
+ export declare const resolveSrv: IResolver["resolveSrv"];
3750
+ export declare const resolveTlsa: IResolver["resolveTlsa"];
3751
+ export declare const resolveTxt: IResolver["resolveTxt"];
3752
+ export declare const reverse: IResolver["reverse"];
3753
+ export declare const resolve: IResolver["resolve"];
3754
+
3755
+ export {
3756
+ CaaRecord,
3757
+ MxRecord,
3758
+ NaptrRecord,
3759
+ NativeEmailValidator as EmailValidator,
3760
+ RecordWithTtl,
3761
+ ResolveOptions,
3762
+ ResolveWithTtlOptions,
3763
+ SoaRecord,
3764
+ SrvRecord,
3765
+ TlsaRecord,
3766
+ Zynor$1 as Zynor,
3767
+ Zynor$1 as default,
3768
+ };
3769
+
3770
+ export {};