Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Typescript definitions not valid #737
protobuf.js version: 6.7.0
npm i -g typescript@next
import * as protobuf from "protobufjs";
npm install protobufjs
Expected behaviour: compile success
Current behaviour: numerous typescript errors:
node_modules/protobufjs/index.d.ts(419,13): error TS2300: Duplicate identifier 'LoadCallback'.
Way to fix: rebuild protobufjs file index.d.ts by pbts but with added option --no-comments
Reason: Typescript using JSDoc data to build types info, but with JSDoc comments typescript use same types twice:
Of course we can fix this for now by excluding just
Typescript is rather new and very swiftly evolving project, but right now use of protobufjs in typescript projects lead to above problem
Personally I agree with you and see no reason typescript using JSDoc data from d.ts, but that's current situation.
I also see no reason to keep JSDoc data in d.ts files, as JSDoc and d.ts both define type data
Will you fix the problem?