DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

I18n missing constructor

Open
#60,984 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @types/i18n@0.13.3 for the project I'm working on.

The typings for i18n-node are missing the I18n constructor.

Here is the diff that solved my problem:

diff --git a/node_modules/@types/i18n/index.d.ts b/node_modules/@types/i18n/index.d.ts
index 08576ca..ef2a82f 100755
--- a/node_modules/@types/i18n/index.d.ts
+++ b/node_modules/@types/i18n/index.d.ts
@@ -387,6 +387,8 @@ declare namespace i18n {
     const version: string;
 
     class I18n {
+        constructor(options?: ConfigurationOptions);
+
         configure(options: ConfigurationOptions): void;
 
         init(request: Express.Request, response: Express.Response, next?: () => void): void;

This issue body was partially generated by patch-package.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open @types/i18n/index.d.ts and inspect the I18n class declaration shown in the issue. Add the missing optional constructor declaration using ConfigurationOptions, then verify that the type definition represents the constructor usage described in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.