Open corwin-of-amber opened 3 years ago
(I see now that there are actually two possible constructors and that the JS code resolves the overloading.)
Hey Shachar, good to hear from you. Again, I'm not a typescript expert, but if you think this is a reasonable thing to do and want to submit a PR, I'm happy to look it over.
Yes I was actually going to suggest myself for the job but didn't want to step on anyone's toes in case they're already working on it :) I can definitely adapt the definitions from DefinitelyTyped; I assume some tests for these are also in order, will you be ok with some tests being written in TypeScript?
Go ahead! Though to be clear, I only want TypeScript-related features tested in TypeScript. Also, please don't make any backwards-incompatible changes.
Cheers!
It seems that the type definitions at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nearley are a bit outdated. For example, the
Parser
constructor is provided as:Whereas the JS definition is https://github.com/kach/nearley/blob/be339244f1f2fde30d8dc163c66da2d3b1537095/lib/nearley.js#L242.
Perhaps it's time to bring those definitions over and have them as part of the nearley package, removing the need for
@types/nearley
and also making the types consistent with the implementation?