You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
566 B

import { expectError, expectType } from 'tsd'
import { defineComponent } from './index'
declare module '@vue/runtime-core' {
interface ComponentCustomOptions {
test?(n: number): void
}
interface ComponentCustomProperties {
state: 'stopped' | 'running'
}
}
export const Custom = defineComponent({
data: () => ({ counter: 0 }),
test(n) {
expectType<number>(n)
},
methods: {
aMethod() {
expectError(this.notExisting)
this.counter++
this.state = 'running'
expectError((this.state = 'not valid'))
}
}
})