-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: avoid accessing undeclared instance fields on type level #189
Conversation
type VueConstructorProxy<PropsOptions, RawBindings> = { | ||
new (): ComponentRenderProxy< | ||
type VueConstructorProxy<PropsOptions, RawBindings> = VueConstructor & { | ||
new (...args: any[]): ComponentRenderProxy< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified this type as it cannot match existing typings which expects VueConstructor
like vue-router. By writing argument as (...args: any[])
, we can mix it with the intersected constructor so that ComponentRenderProxy
retains even after inherit VueConstructor
.
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html
This probably fixes #185 ?
Does this get merged? |
This solves #185 for me! |
This PR can fix #185 for me. |
fix #187
As
never
is bottom type,ExtractPropTypes<never>
is resolved as a type that accepts any field access:which is included in intersections of
ComponentRenderProxy
type, consists ofVueProxy
instance type.The default type of
Props
seems to beunknown
. As it is top type,ExtractPropTypes<unknown>
will be{}
which is expected type in this case.