Мой файл src/auth/ManagementAPI.ts
использует Auth0. Мне нужно использовать свой собственный файл декларации, и я создал src/@types/auth0.d.ts
.
Однако, когда я запускаю ts-node
, я получаю эту ошибку:
TSError: ⨯ Unable to compile TypeScript:
auth/ManagementAPI.ts(1,69): error TS7016: Could not find a declaration file for module 'auth0'. '/Users/danrumney/WebstormProjects/ohana/node_modules/auth0/src/index.js' implicitly has an 'any' type.
Try `npm install @types/auth0` if it exists or add a new declaration (.d.ts) file containing `declare module 'auth0';
Я обновил tsconfig.json
файл, включив в него:
"typeRoots": [
"./node_modules/@types",
"./src/@types"
]
Мой файл декларации выглядит так:
declare module 'auth0' {
/*...*/
}
Почему эту декларацию не забирают?
Я создал пример репозитория здесь: https://bitbucket.org/ohanapediatrics/so-demo/src/master/