Я хотел использовать Thrift с Typescript для моего проекта Nodejs. Вот ошибка, с которой я сталкиваюсь
src/gen-js/myService.d.ts:9:12 - error TS2503: Cannot find namespace 'Thrift'.
10 input: Thrift.TJSONProtocol;
~~~~~~
src/gen-js/myService.d.ts:10:1 - error TS2503: Cannot find namespace 'Thrift'.
11 output: Thrift.TJSONProtocol;
~~~~~~
error TS2304: Cannot find name 'Thrift'.
...(more of the same)
src/gen-js/myService_types.d.ts:198:32 - error TS2304: Cannot find name 'Thrift'.
198 class StoreException extends Thrift.TException {
~~~~~~
...(more of the same)
Я установил @types/thrift
, а также настроил свой tsconfig.json следующим образом
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es2017",
"noImplicitAny": true,
"moduleResolution": "node",
"inlineSourceMap": true,
"outDir": "dist",
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"baseUrl": ".",
"paths": {
"*": ["node_modules/*", "src/types/*"]
},
"lib": [
"dom",
"esnext"
]
},
"include": ["src/**/*"]
}
Кажется, хорошо, верно?и все еще сталкиваюсь с ошибкой.Любая идея, как успешно построить это?
PS Я использую Typescript 3.2, Thrift v0.11 и @ types / thrift 0.10.7