typed-vue-extend
v1.0.0
Published
VueComponent.extend type is not strict enough. This type ensures extended methods exist and their types match.
Downloads
3
Readme
How to use
const Component = Vue.extend({
methods: {
a() {
return 'a';
},
async b() {
return 'b';
},
},
});
import type { TypedVueExtendOverride } from 'typed-vue-extend';
Component.extend({
methods: {
// Type checked that method exists and return type matches.
async b() {
return 'bb';
},
},
} as TypedVueExtendOverride<typeof Component>);
See ./test.ts