feat(types): expose ComponentCustomOptions for declaring custom options
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { expectError } from 'tsd'
|
||||
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'
|
||||
}
|
||||
@@ -9,6 +13,11 @@ declare module '@vue/runtime-core' {
|
||||
|
||||
export const Custom = defineComponent({
|
||||
data: () => ({ counter: 0 }),
|
||||
|
||||
test(n) {
|
||||
expectType<number>(n)
|
||||
},
|
||||
|
||||
methods: {
|
||||
aMethod() {
|
||||
expectError(this.notExisting)
|
||||
Reference in New Issue
Block a user