From 14e99086c02f4bcda55e639fb0baf2c664591448 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 24 Nov 2017 09:23:59 -0500 Subject: [PATCH] fix(types): add missing ssr renderToString signature --- packages/vue-server-renderer/types/index.d.ts | 1 + types/test/ssr-test.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/vue-server-renderer/types/index.d.ts b/packages/vue-server-renderer/types/index.d.ts index 66c7b4bf77..1c7e8bdd42 100644 --- a/packages/vue-server-renderer/types/index.d.ts +++ b/packages/vue-server-renderer/types/index.d.ts @@ -11,6 +11,7 @@ interface Renderer { renderToString(vm: Vue, callback: RenderCallback): void; renderToString(vm: Vue, context: object, callback: RenderCallback): void; renderToString(vm: Vue): Promise; + renderToString(vm: Vue, context: object): Promise; renderToStream(vm: Vue, context?: object): Readable; } diff --git a/types/test/ssr-test.ts b/types/test/ssr-test.ts index d0a8e5c701..ed6409a316 100644 --- a/types/test/ssr-test.ts +++ b/types/test/ssr-test.ts @@ -46,6 +46,14 @@ renderer.renderToString(app) throw err; }); +renderer.renderToString(app, context) + .then(html => { + const res: string = html; + }) + .catch(err => { + throw err; + }); + renderer.renderToStream(app, context).on('data', chunk => { const html = chunk.toString(); });