Skip to content

Conversation

kaorun343
Copy link
Contributor

According to 06b4703, namespace has been removed, so I updated the types.
Also, I fixed the first argument of $createElement.
In addition, add FunctionalComponentOptions to Vue.extend

@yyx990803
Copy link
Member

/cc @ktsn

types/vue.d.ts Outdated
$nextTick(callback?: (this: this) => void): void;
$createElement(
tag?: string | Vue,
tag?: string | Component | (() => string | Component),
Copy link
Member

@ktsn ktsn Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the function type of this argument is the factory of async component.
So I think following type is more appropriate.

string |
Component |
((
  resolve: (component: Component) => void,
  reject: any
) => Promise<Component> | Component | void)

Maybe it would be better to define AsyncComponent for this function type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaorun343
Copy link
Contributor Author

I've fixed.

Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

$nextTick(callback?: (this: this) => void): void;
$createElement(
tag?: string | Vue,
tag?: string | Component | AsyncComponent,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly what was breaking things up for me 👍

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yyx990803 yyx990803 merged commit ef69459 into vuejs:dev Sep 30, 2016
@kaorun343 kaorun343 deleted the fix-types branch November 2, 2016 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants