-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(define-props): add missing imports
- Loading branch information
Showing
3 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@vue-macros/define-props': patch | ||
--- | ||
|
||
fix $defineProps retuning type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import type { ComponentObjectPropsOptions, ExtractPropTypes } from 'vue' | ||
import type { RefValue } from 'vue/macros' | ||
|
||
export type RefValueObject<T> = { | ||
[K in keyof T]: RefValue<T[K]> | ||
} | ||
|
||
export declare function $defineProps<PropNames extends string = string>( | ||
props: PropNames[] | ||
): Readonly<{ | ||
[key in PropNames]?: any | ||
}> | ||
export declare function $defineProps< | ||
PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions | ||
>(props: PP): Readonly<ExtractPropTypes<PP>> | ||
export declare function $defineProps<TypeProps>(): { | ||
[Key in keyof TypeProps]: RefValue<TypeProps[Key]> | ||
} | ||
>(props: PP): RefValueObject<ExtractPropTypes<PP>> | ||
export declare function $defineProps<TypeProps>(): RefValueObject<TypeProps> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters