Skip to content

This repository is an example how to implement types for some JS library

Notifications You must be signed in to change notification settings

n0th1ng-else/typescript-types-complex-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The article

You can read the article:

Build

To see how TypeScript compiler analyzes the example, build the package via npm run build

Set up the package in the tsconfig.json

Enhance tsconfig.json to put types into action:

{
  "compilerOptions": {
    "*": "Any typescript config options"
  },
  "files": ["node_modules/YOUR_PACKAGE_NAME/dist/index.d.ts"],
  "exclude": ["node_modules"],
  "include": ["YOUR_CUSTOM_TYPES.d.ts", "src/**/*"]
}

This is needed since we use some custom package directory. Only types from @types folder is being picked up automatically.

About

This repository is an example how to implement types for some JS library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published