-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest release is missing type definitions #1260
Comments
The internal/plugin interfaces are not part of the new type definitions. The old ones accidentally had some of them in there. What kind of thing are you doing that you need |
We're using |
Are you able to switch to a |
@marijnh I believe it can be even simpler with something like |
I'm assuming the reason for this is to make life easier for people who are simply using Acorn as-is, avoiding showing a hundred methods in their editor. But for plugin authors, this makes creating a plugin that will satisfy Would it make sense to add another class that is targeted at plugin authors and then add the type definitions to that? Something like: class PluginParserBase extends Parser {} |
The thing is that no one has really done the work to specify this huge internal plugin interface (which is pretty much 'every property and method on the parser object' plus some odd exports). That might be useful work, but I personally am the only active maintainer at the moment and this is not a focus for me, so I'm not sure when or by who it would be done. Also, is there any TypeScript mechanism that could allow people to opt into an alternative or extended set of types like this without too much kludges? Was your idea to just have people extend some dummy wrapper class that is part of the main types? |
I could take a stab at it, if you'd like. I've essentially had to do this work for the plugin I'm working on.
I'm just learning the ins and outs of TypeScript, myself, so I'm not 100% sure. The complexity, as far as I can tell, is that plugins received a constructor to extend as an argument. As a result, TypeScript wants that type to be defined as class-like, which the current |
Acorn 8.11.2 seems to have shipped with broken type definitions. Some methods like
isIdentifierStart
are missing fromd.ts
files (they exist in the actual JS code though).The text was updated successfully, but these errors were encountered: