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(); });