Skip to content

Commit

Permalink
fix(types): avoid this in VueConstructor signature (#9173)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme authored and yyx990803 committed Dec 10, 2018
1 parent 628c1b7 commit e06d2af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions types/test/tsconfig.json
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
Expand Down
11 changes: 9 additions & 2 deletions types/test/vue-test.ts
Expand Up @@ -102,10 +102,10 @@ class Test extends Vue {
this.compile("<div>{{ message }}</div>");
this
.use(() => {

})
.use(() => {

})
.mixin({})
.mixin({});
Expand Down Expand Up @@ -193,3 +193,10 @@ Vue.extend({
return h('canvas', {}, [a])
}
})

declare function decorate<VC extends typeof Vue>(v: VC): VC;

@decorate
class Decorated extends Vue {
a = 123;
}
6 changes: 3 additions & 3 deletions types/vue.d.ts
Expand Up @@ -111,9 +111,9 @@ export interface VueConstructor<V extends Vue = Vue> {
component<Props>(id: string, definition: FunctionalComponentOptions<Props, RecordPropsDefinition<Props>>): ExtendedVue<V, {}, {}, {}, Props>;
component(id: string, definition?: ComponentOptions<V>): ExtendedVue<V, {}, {}, {}, {}>;

use<T>(plugin: PluginObject<T> | PluginFunction<T>, options?: T): this;
use(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): this;
mixin(mixin: VueConstructor | ComponentOptions<Vue>): this;
use<T>(plugin: PluginObject<T> | PluginFunction<T>, options?: T): VueConstructor<V>;
use(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<V>;
mixin(mixin: VueConstructor | ComponentOptions<Vue>): VueConstructor<V>;
compile(template: string): {
render(createElement: typeof Vue.prototype.$createElement): VNode;
staticRenderFns: (() => VNode)[];
Expand Down

0 comments on commit e06d2af

Please sign in to comment.