Skip to content

types(i18n): add missing toJSON() declaration#2393

Merged
adrai merged 1 commit intoi18next:masterfrom
nagosu:types/add-tojson-declaration
Feb 15, 2026
Merged

types(i18n): add missing toJSON() declaration#2393
adrai merged 1 commit intoi18next:masterfrom
nagosu:types/add-tojson-declaration

Conversation

@nagosu
Copy link
Copy Markdown
Contributor

@nagosu nagosu commented Feb 15, 2026

What

Add missing toJSON() declaration to the i18n interface.

Why

Runtime already exposes I18n#toJSON() but TypeScript types did not, so i18next.toJSON() was not type-safe / discoverable.

How

  • Add toJSON() signature to index.d.ts.
  • Add a TypeScript regression test under test/typescript/misc.

Tests

  • npm run format
  • npm run lint
  • npm run test:typescript -- --project misc

Risk

Type-only change; no runtime behavior changes. Return shape matches runtime toJSON() implementation.

Signed-off-by: 박진우 <nozick1021@gmail.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 94.964%. remained the same
when pulling dd6a493 on nagosu:types/add-tojson-declaration
into 383831f on i18next:master.

@adrai adrai merged commit 1739b7d into i18next:master Feb 15, 2026
9 checks passed
@adrai
Copy link
Copy Markdown
Member

adrai commented Feb 15, 2026

thx, included in v25.8.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants