import { JSSanSourceFile } from '../models/san-source-file'; import { strongParseSanSourceFileOptions } from '../compilers/renderer-options'; export declare class SanFileParser { readonly scriptContent: string; readonly templateContent: string; private readonly filePath; private readonly parser; constructor(scriptContent: string, templateContent: string, filePath: string, options: strongParseSanSourceFileOptions); parse(): JSSanSourceFile; /** * 把简写的 san options 替换为 san Component。 * { inited(){} } -> require('san').defineComponent({ inited(){} }) */ private expandToSanComponent; /** * 把模板字符串插入到 san 组件定义中 * - 情况一:defineComponent({ inited(){} }) -> defineComponent({ inited(){}, template: '
...
' }) * - 情况二: * class XComponent { constructor() {} } -> class XComponent { constructor() { this.template='
...
' }} */ private insertTemplate; private createEmptyConstructor; /** * 创建给 this.template 赋值为 this.templateContent 的表达式 */ private createTemplateAssignmentExpression; }