Refactor #4103 - Update lifecycle names in Base* files

This commit is contained in:
mertsincan 2023-07-10 10:34:48 +01:00
parent 2572561902
commit 63b5b8be8e
6 changed files with 71 additions and 33 deletions

View file

@ -1,6 +1,37 @@
import { ObjectDirective } from 'vue';
import { DirectiveBinding, VNode } from 'vue';
export interface DirectiveHooks extends Omit<ObjectDirective, 'getSSRProps' | 'deep'> {}
export interface DirectiveInstance<T = any, V = any> {
$name: string | undefined;
$host: T;
$binding: DirectiveBinding<V>;
$el: HTMLElement | undefined;
$css?: {
classes?: undefined;
inlineStyles?: undefined;
loadStyle?: () => void;
};
defaultPT: any;
isUnstyled: boolean;
[key: string]: any;
}
/* All parameters passed by the directive of Vue.js */
export interface DirectiveOptions<T = any, Prev = VNode<any, T> | null, V = any> {
el: T;
binding: DirectiveBinding<V>;
vnode: VNode<any, T>;
prevVNode: Prev;
}
export interface DirectiveHooks<T = any, V = any> {
onCreated?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, null, V>) => void;
onBeforeMount?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, null, V>) => void;
onMounted?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, null, V>) => void;
onBeforeUpdate?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, VNode<any, T>, V>) => void;
onUpdated?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, VNode<any, T>, V>) => void;
onBeforeUnmount?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, null, V>) => void;
onUnmounted?: (instance: DirectiveInstance<T, V> | undefined, options: DirectiveOptions<T, null, V>) => void;
}
export interface BaseDirectivePassThroughOptions {
hooks?: DirectiveHooks;