Skip to content
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

Update api.d.ts to properly define input #1978

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Conversation

matthew-dean
Copy link
Contributor

Explanation

Because api.d.ts incorrectly defines input as a data property instead of an accessor property (as it's defined in code), then TypeScript will throw compilation errors if you try to override the parser's input accessor.

If you attempt to augment the Chevrotain types (with declare module 'chevrotain' and altering the interface), TypeScript will still fail, because the name exists, it's just incorrectly defined. The only workaround is to add a @ts-ignore. (Even @ts-expect-error will cause problems, because extensions like Volar cannot correctly determine that tsc will error in this case.)

@bd82
Copy link
Member

bd82 commented Aug 23, 2023

Thanks @matthew-dean 👍

@bd82 bd82 merged commit a0a3856 into Chevrotain:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants