i18next 26.5.1 → 26.5.3

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.
@@ -1 +1 @@
1
- {"type":"module","version":"26.5.1"}
1
+ {"type":"module","version":"26.5.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next",
3
- "version": "26.5.1",
3
+ "version": "26.5.3",
4
4
  "description": "i18next internationalization framework",
5
5
  "main": "./dist/cjs/i18next.js",
6
6
  "module": "./dist/esm/i18next.js",
package/typescript/t.d.ts CHANGED
@@ -700,9 +700,15 @@ interface TFunctionNonStrict<
700
700
  },
701
701
  DefaultValue extends string = never,
702
702
  >(
703
+ // `[key, defaultValue, options?]` is written as two tuples: on a failed call,
704
+ // TypeScript elaborates the error against the last of the equally matching
705
+ // members, and TypeScript 7 sorts a 3-element tuple last, so a wrong options
706
+ // object was reported as "not assignable to type 'string'" instead of the
707
+ // missing or mistyped argument.
703
708
  ...args:
704
709
  | [key: string | string[], options: TOpt & $Dictionary & { defaultValue: DefaultValue }]
705
- | [key: string | string[], defaultValue: DefaultValue, options?: TOpt & $Dictionary]
710
+ | [key: string | string[], defaultValue: DefaultValue]
711
+ | [key: string | string[], defaultValue: DefaultValue, options: TOpt & $Dictionary]
706
712
  | _KeyAndOptions<Key, $NoInfer<Ret>, ActualOptions>
707
713
  ): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, DefaultValue>, TOpt>;
708
714
  }
@@ -813,19 +819,31 @@ interface TFunctionSelector<Ns extends Namespace, KPrefix, Source> extends Brand
813
819
  ...args: [options?: Opts & $Dictionary]
814
820
  ): DefaultTReturn<Opts>;
815
821
 
816
- // ── Selector(s) with explicit `ns` ───────────────────────────────────────────
822
+ // ── Array of selectors with explicit `ns` ───────────────────────────────────
817
823
  <
818
824
  Target extends ConstrainTarget<Opts>,
819
825
  const NewNs extends NsArg<Ns> & Namespace,
820
826
  const Opts extends SelectorOptions<NewNs>,
821
827
  NewSrc extends GetSource<NewNs, KPrefix>,
822
828
  >(
823
- selector:
824
- | SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>
825
- | readonly SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>[],
829
+ selectors: readonly SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>[],
826
830
  options: Opts & InterpolationMap<Target> & { ns: NewNs },
827
831
  ): SelectorReturn<Target, Opts>;
828
832
 
833
+ // ── Single selector with explicit `ns` ──────────────────────────────────────
834
+ <
835
+ Target extends ConstrainTarget<Opts>,
836
+ const NewNs extends NsArg<Ns> & Namespace,
837
+ const Opts extends SelectorOptions<NewNs>,
838
+ NewSrc extends GetSource<NewNs, KPrefix>,
839
+ >(
840
+ selector: SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>,
841
+ options: Opts &
842
+ InterpolationMap<DeepUnwrapPlural<Target>> & {
843
+ ns: NewNs;
844
+ } & (Target extends PluralValue<string> ? { count: number } : {}),
845
+ ): SelectorReturn<Target, Opts>;
846
+
829
847
  // ── Array of selectors with default `ns` ─────────────────────────────────────
830
848
  // Captures the selector tuple as `const Fns` so TypeScript preserves each
831
849
  // element's exact return type. The union of return types is then extracted