[feat] improve types for Style attributes and children

pull/7228/head
Eric Liu 5 years ago
parent eb6fb66f19
commit 1f93539d04

@ -118,10 +118,49 @@ export interface Script extends BaseNode {
content: Program;
}
export interface StyleAttribute extends BaseNode {
type: 'Attribute';
name: string;
value: true | MustacheTag | any[];
}
export interface StyleSelector extends BaseNode {
type: 'Selector';
children: any[];
}
export interface StyleDeclarationValue extends BaseNode {
type: 'Value';
children: any[];
}
export interface StyleDeclaration extends BaseNode {
type: 'Declaration';
important: boolean;
property: string;
value: StyleDeclarationValue;
}
export interface StyleNode extends BaseNode {
type: 'Rule';
prelude: {
type: 'SelectorList';
children: StyleSelector[];
start: number;
end: number;
};
block: {
type: 'Block';
children: StyleDeclaration[];
start: number;
end: number;
}
}
export interface Style extends BaseNode {
type: 'Style';
attributes: any[]; // TODO
children: any[]; // TODO add CSS node types
attributes: StyleAttribute[];
children: StyleNode[];
content: {
start: number;
end: number;

Loading…
Cancel
Save