--- /dev/null
+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)
+ }
+})
mixin(mixin: ComponentOptions): this
component(name: string): Component | undefined
component(name: string, component: Component | DefineComponent): this
- directive(name: string): Directive | undefined
- directive(name: string, directive: Directive): this
+ directive<T = any, V = any>(name: string): Directive<T, V> | undefined
+ directive<T = any, V = any>(name: string, directive: Directive<T, V>): this
mount(
rootContainer: HostElement | string,
isHydrate?: boolean,
component(name: string): Component | undefined
component(name: string, component: Component): CompatVue
- directive(name: string): Directive | undefined
- directive(name: string, directive: Directive): CompatVue
+ directive<T = any, V = any>(name: string): Directive<T, V> | undefined
+ directive<T = any, V = any>(
+ name: string,
+ directive: Directive<T, V>
+ ): CompatVue
compile(template: string): RenderFunction