]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(types): add slots types for built-in components (#6033)
authorJohnson Chu <johnsoncodehk@gmail.com>
Fri, 5 May 2023 09:12:51 +0000 (17:12 +0800)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 09:12:51 +0000 (17:12 +0800)
packages/runtime-core/src/components/BaseTransition.ts
packages/runtime-core/src/components/KeepAlive.ts
packages/runtime-core/src/components/Suspense.ts
packages/runtime-core/src/components/Teleport.ts

index 043b97365255eec30843a248f994fe4d79d49f5c..a4e862335eb2bc2f3b6a6a22284311925e49f5cd 100644 (file)
@@ -283,6 +283,9 @@ if (__COMPAT__) {
 export const BaseTransition = BaseTransitionImpl as unknown as {
   new (): {
     $props: BaseTransitionProps<any>
+    $slots: {
+      default(): VNode[]
+    }
   }
 }
 
index d5813f90e097321d20ccc78acabf4770f9f11c21..8c1b6318887bd8a9a06b52017e523e73ca20f026 100644 (file)
@@ -344,6 +344,9 @@ export const KeepAlive = KeepAliveImpl as any as {
   __isKeepAlive: true
   new (): {
     $props: VNodeProps & KeepAliveProps
+    $slots: {
+      default(): VNode[]
+    }
   }
 }
 
index aef62db4a314a79fc2ad2498d811d09718184596..fd6a7e0fac8dc213038c1846f5094a9cc970d016 100644 (file)
@@ -104,7 +104,13 @@ export const Suspense = (__FEATURE_SUSPENSE__
   ? SuspenseImpl
   : null) as unknown as {
   __isSuspense: true
-  new (): { $props: VNodeProps & SuspenseProps }
+  new (): {
+    $props: VNodeProps & SuspenseProps
+    $slots: {
+      default(): VNode[]
+      fallback(): VNode[]
+    }
+  }
 }
 
 function triggerEvent(
index f9f845298dca079c88d2806b145c56cd8e64b45c..6e66d0444f9b35527f4bc18fec39e81dbaf6cb4c 100644 (file)
@@ -393,7 +393,12 @@ function hydrateTeleport(
 // Force-casted public typing for h and TSX props inference
 export const Teleport = TeleportImpl as unknown as {
   __isTeleport: true
-  new (): { $props: VNodeProps & TeleportProps }
+  new(): {
+    $props: VNodeProps & TeleportProps
+    $slots: {
+      default(): VNode[]
+    }
+  }
 }
 
 function updateCssVars(vnode: VNode) {