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

View 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`)
}