zynor 0.0.85 → 0.0.92

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.
package/dist/native.d.ts CHANGED
@@ -2817,7 +2817,7 @@ declare class EmailValidator {
2817
2817
  *
2818
2818
  * Unlike {@link validateBulk}, which waits for every input before returning,
2819
2819
  * `each` invokes `onBatch` as soon as enough results have accumulated
2820
- * (`returnBatch`, default 10) and continues until every input has been
2820
+ * (`perPage`, default 10) and continues until every input has been
2821
2821
  * processed. Designed for very large inputs (millions) where time-to-first
2822
2822
  * result matters and holding the entire result array in memory is wasteful.
2823
2823
  *
@@ -2827,7 +2827,7 @@ declare class EmailValidator {
2827
2827
  * round-robin per validation.
2828
2828
  *
2829
2829
  * Backpressure: `onBatch` is awaited serially. If the callback is slow and
2830
- * the in-memory buffer reaches `10 * returnBatch`, workers pause picking
2830
+ * the in-memory buffer reaches `10 * perPage`, workers pause picking
2831
2831
  * new emails until the buffer drains below the cap. This keeps memory
2832
2832
  * bounded for truly large inputs.
2833
2833
  *
@@ -2845,7 +2845,7 @@ declare class EmailValidator {
2845
2845
  * @param emails - The list of email addresses to validate
2846
2846
  * @param options - Streaming options
2847
2847
  * @param options.concurrency - Max parallel validations (default 500)
2848
- * @param options.returnBatch - Min results buffered before invoking onBatch (default 10)
2848
+ * @param options.perPage - Min results buffered before invoking onBatch (default 10)
2849
2849
  * @param options.deep - Enable deep validation per email
2850
2850
  * @param options.logo - Fetch provider logo per email
2851
2851
  * @param options.signal - AbortSignal to cancel the batch
@@ -2857,7 +2857,7 @@ declare class EmailValidator {
2857
2857
  * ```typescript
2858
2858
  * await validator.each(
2859
2859
  * emails, // could be millions
2860
- * { concurrency: 500, returnBatch: 50, deep: true },
2860
+ * { concurrency: 500, perPage: 50, deep: true },
2861
2861
  * async (batch) => {
2862
2862
  * await db.insertMany(batch);
2863
2863
  * },
@@ -2866,7 +2866,7 @@ declare class EmailValidator {
2866
2866
  */
2867
2867
  each(emails: string[], options: {
2868
2868
  concurrency?: number;
2869
- returnBatch?: number;
2869
+ perPage?: number;
2870
2870
  deep?: boolean;
2871
2871
  logo?: boolean;
2872
2872
  signal?: AbortSignal;
@@ -3695,43 +3695,53 @@ declare class Zynor {
3695
3695
  /**
3696
3696
  * Streams validation results as they complete. Forwards to
3697
3697
  * {@link EmailValidator.each} on the singleton validator. See `each` for
3698
- * full semantics — defaults are `concurrency: 500`, `returnBatch: 10`, and
3698
+ * full semantics — defaults are `concurrency: 500`, `perPage: 10`, and
3699
3699
  * all validator-routed DNS calls bypass the per-provider queue.
3700
3700
  *
3701
3701
  * @param emails - The list of email addresses to validate
3702
- * @param options - Streaming options (concurrency, returnBatch, deep, etc.)
3702
+ * @param options - Streaming options (concurrency, perPage, deep, etc.)
3703
3703
  * @param onBatch - Callback invoked with each completed batch
3704
3704
  * @returns Resolves once every input has been processed and flushed
3705
3705
  *
3706
3706
  * @example
3707
3707
  * ```typescript
3708
- * await Zynor.each(emails, { returnBatch: 50 }, async (batch) => {
3708
+ * await Zynor.each(emails, { perPage: 50 }, async (batch) => {
3709
3709
  * await db.insertMany(batch);
3710
3710
  * });
3711
3711
  * ```
3712
3712
  */
3713
3713
  static each(emails: string[], options: {
3714
3714
  concurrency?: number;
3715
- returnBatch?: number;
3715
+ perPage?: number;
3716
3716
  deep?: boolean;
3717
3717
  logo?: boolean;
3718
3718
  signal?: AbortSignal;
3719
3719
  timeout?: number;
3720
3720
  } | undefined, onBatch: Parameters<EmailValidator["each"]>[2]): Promise<void>;
3721
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
3722
  declare class Zynor$1 extends Zynor {
3727
3723
  constructor(config?: ZynorConfig);
3724
+ /**
3725
+ * Returns the Rust-backed {@link EmailValidator} (its `createDns` builds
3726
+ * a Rust {@link Zynor}). The inherited base static builds a libuv-backed
3727
+ * validator, so without this override `validate`/`each` from
3728
+ * `'zynor/native'` would silently run on libuv.
3729
+ */
3730
+ static createEmailValidator(config?: {
3731
+ options?: ValidationConfig;
3732
+ dns?: ZynorConfig;
3733
+ }): EmailValidator;
3734
+ /** Kept consistent with {@link createEmailValidator} so `Zynor.emailValidator`
3735
+ * (used by the static `validateBulk`/`each`) also resolves to the
3736
+ * Rust-backed singleton on this entry. */
3737
+ static get emailValidator(): EmailValidator;
3728
3738
  }
3729
3739
  /**
3730
3740
  * Identical to {@link BaseEmailValidator} except the internal DNS
3731
3741
  * resolver is a {@link Zynor} — every DNS call zynor makes during
3732
3742
  * validation routes through the Rust binding.
3733
3743
  */
3734
- declare class NativeEmailValidator extends EmailValidator {
3744
+ declare class EmailValidator$1 extends EmailValidator {
3735
3745
  protected createDns(config?: Omit<ZynorConfig, "cache">): Zynor$1;
3736
3746
  }
3737
3747
  export declare const resetDefaultResolver: () => void;
@@ -3754,9 +3764,9 @@ export declare const resolve: IResolver["resolve"];
3754
3764
 
3755
3765
  export {
3756
3766
  CaaRecord,
3767
+ EmailValidator$1 as EmailValidator,
3757
3768
  MxRecord,
3758
3769
  NaptrRecord,
3759
- NativeEmailValidator as EmailValidator,
3760
3770
  RecordWithTtl,
3761
3771
  ResolveOptions,
3762
3772
  ResolveWithTtlOptions,