Skip to content

Commit 14e9908

Browse files
committed
fix(types): add missing ssr renderToString signature
1 parent df37292 commit 14e9908

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/vue-server-renderer/types/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface Renderer {
1111
renderToString(vm: Vue, callback: RenderCallback): void;
1212
renderToString(vm: Vue, context: object, callback: RenderCallback): void;
1313
renderToString(vm: Vue): Promise<string>;
14+
renderToString(vm: Vue, context: object): Promise<string>;
1415

1516
renderToStream(vm: Vue, context?: object): Readable;
1617
}

types/test/ssr-test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ renderer.renderToString(app)
4646
throw err;
4747
});
4848

49+
renderer.renderToString(app, context)
50+
.then(html => {
51+
const res: string = html;
52+
})
53+
.catch(err => {
54+
throw err;
55+
});
56+
4957
renderer.renderToStream(app, context).on('data', chunk => {
5058
const html = chunk.toString();
5159
});

0 commit comments

Comments
 (0)