vue3-core/packages-private/dts-test/appDirective.test-d.ts

15 lines
318 B
TypeScript

import { createApp } from 'vue'
import { expectType } from './utils'
const app = createApp({})
app.directive<HTMLElement, string>('custom', {
mounted(el, binding) {
expectType<HTMLElement>(el)
expectType<string>(binding.value)
// @ts-expect-error not any
expectType<number>(binding.value)
},
})