typed-vue-extend
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i typed-vue-extend

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.91 kB

Total Files

7

Last publish

Collaborators

  • lukaw3d