-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Note by @nknapp: Unless anybody objects, this change will be made in the 4.x branch by December, 8 2019
Currently the typings and documentation for Decorator and DecoratorBlock are out of sync.
According to the documentation Decorator and DecoratorBlock should extend Statement. In the typings they extend MustacheStatement and BlockStatement. This makes it impossible to add the correct type fields for them (see #1570 and #1571 for more info ).
I assume this was done to write less code in the typings, but I think it's incorrect. I'd love to create a pull request that fixes this by making sure they extend Statement (just like they should according to the documentation) and then adding the missing fields if that's ok?
Basically I'd like to turn this
// types/index.d.ts
interface Decorator extends MustacheStatement { }
interface DecoratorBlock extends BlockStatement { }into this
// types/index.d.ts
interface Decorator extends Statement {
type: "Decorator";
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
strip: StripFlags | null;
}
interface DecoratorBlock extends Statement {
type: "DecoratorBlock";
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
program: Program | null;
openStrip: StripFlags | null;
closeStrip: StripFlags | null;
}