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.)
Explanation
Because
api.d.ts
incorrectly definesinput
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 thattsc
will error in this case.)