From 730a10f771cf722fd28994b0501ad7b04534882a Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 15 Jan 2019 17:41:42 -0500 Subject: [PATCH] types: type sync for template-compiler and server-renderer --- packages/vue-server-renderer/types/index.d.ts | 1 + packages/vue-template-compiler/types/index.d.ts | 1 + packages/vue-template-compiler/types/test.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/vue-server-renderer/types/index.d.ts b/packages/vue-server-renderer/types/index.d.ts index 1c7e8bdd..e1ab6989 100644 --- a/packages/vue-server-renderer/types/index.d.ts +++ b/packages/vue-server-renderer/types/index.d.ts @@ -38,6 +38,7 @@ interface RendererOptions { interface BundleRendererOptions extends RendererOptions { clientManifest?: object; + serializer?: (state: object) => string; runInNewContext?: boolean | 'once'; basedir?: string; } diff --git a/packages/vue-template-compiler/types/index.d.ts b/packages/vue-template-compiler/types/index.d.ts index 09c3e527..d84b3af6 100644 --- a/packages/vue-template-compiler/types/index.d.ts +++ b/packages/vue-template-compiler/types/index.d.ts @@ -189,6 +189,7 @@ export interface ASTText { */ interface SFCParserOptions { pad?: true | 'line' | 'space'; + deindent?: boolean } export interface SFCBlock { diff --git a/packages/vue-template-compiler/types/test.ts b/packages/vue-template-compiler/types/test.ts index fbc6dd3d..b0e6cb15 100644 --- a/packages/vue-template-compiler/types/test.ts +++ b/packages/vue-template-compiler/types/test.ts @@ -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("", { - 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)