@alanchenchen/cbml-processor
Version:
基于cbml parser和cbml规范实现的构建工具
37 lines (36 loc) • 1.02 kB
TypeScript
import { Node, Attributes, SourceLocation, Language } from 'cbml/lib/ast';
export declare type CBMLNodeType = 'CBMLElement' | 'BlockElement' | 'CommentElement' | 'TextNode' | 'VoidElement';
export interface EmptyCBMLNode {
type?: CBMLNodeType;
tag?: string;
attributes?: Attributes;
body?: CBMLNode[];
content?: string;
range?: [number, number];
loc?: SourceLocation | null;
language?: Language;
}
export interface CBMLNode extends Node {
type: CBMLNodeType;
tag?: string;
attributes?: Attributes;
body?: CBMLNode[];
content?: string;
range?: [number, number];
loc?: SourceLocation | null;
language?: Language;
}
export declare type PluginFunc = (CBMLRootEle: CBMLNode, code: string) => Promise<CBMLNode>;
export interface Source {
input: string;
output?: string;
}
export interface ProcessorConfig {
sources: Source[];
plugins: PluginFunc[];
}
export interface BuildReturn {
input: string;
output?: string;
outputCode: string;
}