this follows the estree format
interface Fragment <: Node {
type: "Fragment";
body: [
Component | Tag | Block | Conditional | Iteration |
Expression // Any JS Expression
]
}
interface Tag <: Node {
type: "Tag";
name: string; // might be a reference to a registered Component
attributes: [ Attribute ];
body: Fragment | null;
}
interface Attribute <: Node {
type: "Attribute";
name: string;
value: Expression | null; // if null then this is a truthy boolean attribute
}
interface Block <: Node { // this will be used both for defining blocks and to use them
type: "Block";
name: string | null; // it will be the default block if null
operation: "append" | "prepend" | null;
body: Fragment | null;
}
interface Conditional <: Node {
type: "Conditional";
test: Expression;
consequent: Fragment;
alternate: Fragment | null;
}
interface Iteration <: Node {
type: "Iteration";
binding: Identifier;
keybinding: Identifier | null;
expression: Expression;
body: Fragment;
alternate: Fragment | null;
}