feat(types/script-setup): add generic type to defineExpose (#5035)

This commit is contained in:
Noel De Martin 2021-12-06 05:25:35 +01:00 committed by GitHub
parent f73547fc05
commit 34985fee6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,7 +118,7 @@ export function defineEmits() {
* This is only usable inside `<script setup>`, is compiled away in the * This is only usable inside `<script setup>`, is compiled away in the
* output and should **not** be actually called at runtime. * 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__) { if (__DEV__) {
warnRuntimeUsage(`defineExpose`) warnRuntimeUsage(`defineExpose`)
} }