types: type sync for template-compiler and server-renderer

This commit is contained in:
Evan You 2019-01-15 17:41:42 -05:00
parent 7fb6fdd168
commit 730a10f771
3 changed files with 8 additions and 2 deletions

View File

@ -38,6 +38,7 @@ interface RendererOptions {
interface BundleRendererOptions extends RendererOptions {
clientManifest?: object;
serializer?: (state: object) => string;
runInNewContext?: boolean | 'once';
basedir?: string;
}

View File

@ -189,6 +189,7 @@ export interface ASTText {
*/
interface SFCParserOptions {
pad?: true | 'line' | 'space';
deindent?: boolean
}
export interface SFCBlock {

View File

@ -4,7 +4,8 @@ import {
compileToFunctions,
ssrCompile,
ssrCompileToFunctions,
parseComponent
parseComponent,
generateCodeFrame
} from "./";
// check compile options
@ -78,9 +79,12 @@ const vnode: VNode = compiledFns.render.call(vm);
// check SFC parser
const desc = parseComponent("<template></template>", {
pad: "space"
pad: "space",
deindent: false
});
const templateContent: string = desc.template!.content;
const scriptContent: string = desc.script!.content;
const styleContent: string = desc.styles.map(s => s.content).join("\n");
const codeframe: string = generateCodeFrame(`foobar`, 0, 4)