]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(types/script-setup): add generic type to defineExpose (#5035)
authorNoel De Martin <noel@noeldemartin.com>
Mon, 6 Dec 2021 04:25:35 +0000 (05:25 +0100)
committerGitHub <noreply@github.com>
Mon, 6 Dec 2021 04:25:35 +0000 (23:25 -0500)
packages/runtime-core/src/apiSetupHelpers.ts

index 02ca5d53e23b6b0fb025bd06458095f9bb69f338..64f5aa865f121640e040f993623362d755b62e1b 100644 (file)
@@ -118,7 +118,7 @@ export function defineEmits() {
  * This is only usable inside `<script setup>`, is compiled away in the
  * output and should **not** be actually called at runtime.
  */
-export function defineExpose(exposed?: Record<string, any>) {
+export function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) {
   if (__DEV__) {
     warnRuntimeUsage(`defineExpose`)
   }