Skip to content

Commit

Permalink
fix(types): add missing ssr renderToString signature
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 24, 2017
1 parent df37292 commit 14e9908
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue-server-renderer/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Renderer {
renderToString(vm: Vue, callback: RenderCallback): void;
renderToString(vm: Vue, context: object, callback: RenderCallback): void;
renderToString(vm: Vue): Promise<string>;
renderToString(vm: Vue, context: object): Promise<string>;

renderToStream(vm: Vue, context?: object): Readable;
}
Expand Down
8 changes: 8 additions & 0 deletions types/test/ssr-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 14e9908

Please sign in to comment.