Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Issues can be funded by anyone and the money will be transparently distributed t
- [Recipes](#recipes)
- [Baseline tsconfig.json](#baseline-tsconfigjson)
- [Default and Named Module Exports](#default-and-named-module-exports)
- [Imports in Module Decleration](#imports-in-module-decleration)
- [Type Augmentation for npm libraries](#type-augmentation-for-npm-libraries)
- [Override type-definitions for npm libraries](#override-type-definitions-for-npm-libraries)
- [FAQ](#faq)
Expand Down Expand Up @@ -1599,6 +1600,16 @@ import Select from '@src/components/select';

[⇧ back to top](#table-of-contents)

### Imports in Module Decleration
> When creating 3rd party modules declarations all the imports should be put inside the module decleration, otherwise it will be treated as augmentation and show error
```ts
declare module "react-custom-scrollbars" {
import * as React from "react";
export interface positionValues {
...
```
[⇧ back to top](#table-of-contents)

### Type Augmentation for npm libraries
Strategies to fix issues coming from external type-definitions files (*.d.ts)

Expand Down
11 changes: 11 additions & 0 deletions README_SOURCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Issues can be funded by anyone and the money will be transparently distributed t
- [Recipes](#recipes)
- [Baseline tsconfig.json](#baseline-tsconfigjson)
- [Default and Named Module Exports](#default-and-named-module-exports)
- [Imports in Module Decleration](#imports-in-module-decleration)
- [Type Augmentation for npm libraries](#type-augmentation-for-npm-libraries)
- [Override type-definitions for npm libraries](#override-type-definitions-for-npm-libraries)
- [FAQ](#faq)
Expand Down Expand Up @@ -623,6 +624,16 @@ import Select from '@src/components/select';

[⇧ back to top](#table-of-contents)

### Imports in Module Decleration
> When creating 3rd party modules declarations all the imports should be put inside the module decleration, otherwise it will be treated as augmentation and show error
```ts
declare module "react-custom-scrollbars" {
import * as React from "react";
export interface positionValues {
...
```
[⇧ back to top](#table-of-contents)

### Type Augmentation for npm libraries
Strategies to fix issues coming from external type-definitions files (*.d.ts)

Expand Down