Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active June 26, 2019 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/99bfb118f1bbdc7dd309405c8417aaeb to your computer and use it in GitHub Desktop.
Save miguelmota/99bfb118f1bbdc7dd309405c8417aaeb to your computer and use it in GitHub Desktop.
TypeScript add custom @types (declare module)
  • create @types/ directory in your application
  • add @types/my-module/index.d.ts with declare module 'my-module'
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./@types"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment