Skip to content

Commit

Permalink
feat(types): support IDE renaming for props (#3656)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jul 1, 2021
1 parent 1ffd48a commit 81e69b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/runtime-core/src/componentProps.ts
Expand Up @@ -109,7 +109,8 @@ type InferPropType<T> = [T] extends [null]
: T

export type ExtractPropTypes<O> = O extends object
? { [K in RequiredKeys<O>]: InferPropType<O[K]> } &
? { [K in keyof O]?: unknown } & // This is needed to keep the relation between the option prop and the props, allowing to use ctrl+click to navigate to the prop options. see: #3656
{ [K in RequiredKeys<O>]: InferPropType<O[K]> } &
{ [K in OptionalKeys<O>]?: InferPropType<O[K]> }
: { [K in string]: any }

Expand Down

0 comments on commit 81e69b2

Please sign in to comment.