n0th1ng-else / typescript-types-complex-example

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:TypeScript 95.1%Language:JavaScript 4.9%