]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(VNode): improve helper types (#392)
authorDmitry Sharshakov <d3dx12.xx@gmail.com>
Mon, 28 Oct 2019 00:54:54 +0000 (03:54 +0300)
committerEvan You <yyx990803@gmail.com>
Mon, 28 Oct 2019 00:54:54 +0000 (20:54 -0400)
packages/runtime-core/src/vnode.ts

index 98cdc0211f38ab914b891f3b9a3d52ac73012765..25e80821f47d7be0fa48911f8ba8c92d24954244 100644 (file)
@@ -232,7 +232,10 @@ export function createVNode(
   return vnode
 }
 
-export function cloneVNode(vnode: VNode, extraProps?: Data): VNode {
+export function cloneVNode<T, U>(
+  vnode: VNode<T, U>,
+  extraProps?: Data
+): VNode<T, U> {
   // This is intentionally NOT using spread or extend to avoid the runtime
   // key enumeration cost.
   return {
@@ -279,7 +282,7 @@ export function createCommentVNode(
     : createVNode(Comment, null, text)
 }
 
-export function normalizeVNode(child: VNodeChild): VNode {
+export function normalizeVNode<T, U>(child: VNodeChild<T, U>): VNode<T, U> {
   if (child == null) {
     // empty placeholder
     return createVNode(Comment)