Closed BryanCrotaz closed 2 years ago
Further investigation discovered your typescript definitions are missing the static deserialize:
// parse.d.ts
...
export declare class LRParser extends Parser {
// add this line and create a type for spec as there isn't one defined
static deserialize(spec: any): LRParser;
...
That's valid code, as in it works, it's just not TypeScript code. You're not doing anything wrong except that you're running TypeScript on it.
You publish typescript types, but they're wrong.
No, they just don't show internals that the parser generator output uses.
It's not internal if it ends up in the generated project file. That file is part of the app, so it will be type checked during the app build.
So that's public api not private.
I have written a simple grammar:
then generated the parser;
and get
Error: Property 'deserialize' does not exist on type 'typeof LRParser'.
I've searched the code base and deserialize doesn't appear in any of the parser source. Looks like the generator is out of date compared to the parser.