-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
component: generatorsissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Description
Problem
At the moment we are shipping hand-written .d.ts files for the generators which are pretty deficient. For example, javacript.d.ts (copied into the package from typings/javascript.d.ts) is essentially:
export enum Order {
ATOMIC = 0, // 0 "" ...
// etc.
NONE = 99, // (...)
}
export declare const javascriptGenerator: any;Note that javascriptGenerator is declared as any, and JavascriptGenerator is not declared at all.
This means that developers using generators from TypeScript are not getting the full benefit of TS's type checking of the generator classes / instances.
Proposed Solution
Publish the .d.ts files produced by tsc instead of these handwritten versions.
- Convert
blocks/andgenerators/to TypeScript #6828 - Decide on what form the generator typings should be published in.
- Modify
build_tasks.jsandpackage_tasks.jsaccordingly. - Remove unused files from
typings/*.js.
Discussion
- Should we publish individual
.d.tsfiles indist/generators/**/*.d.ts(as we do for files in core), with a wrapper that just imports them, or should we try to publish a single file per chunk that rolls these up?- There may be some difficult in publishing a roll up as it will need to reference
CodeGenerator, which is currently defined incore/.
- There may be some difficult in publishing a roll up as it will need to reference
See also #5818.
Metadata
Metadata
Assignees
Labels
component: generatorsissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong