types: fix manual api types for useAttrs/useListeners

This commit is contained in:
Evan You 2022-07-22 10:05:35 +08:00
parent adf3ac8adc
commit ce6fc149e3
2 changed files with 10 additions and 1 deletions

View File

@ -181,18 +181,25 @@ export function syncSetupSlots(to: any, from: any) {
}
/**
* @internal use manual type def because it relies on legacy VNode types
* @internal use manual type def because public setup context type relies on
* legacy VNode types
*/
export function useSlots(): SetupContext['slots'] {
return getContext().slots
}
/**
* @internal use manual type def because public setup context type relies on
* legacy VNode types
*/
export function useAttrs(): SetupContext['attrs'] {
return getContext().attrs
}
/**
* Vue 2 only
* @internal use manual type def because public setup context type relies on
* legacy VNode types
*/
export function useListeners(): SetupContext['listeners'] {
return getContext().listeners

View File

@ -6,3 +6,5 @@ export function getCurrentInstance(): { proxy: Vue } | null
export const h: CreateElement
export function useSlots(): SetupContext['slots']
export function useAttrs(): SetupContext['attrs']
export function useListeners(): SetupContext['listeners']