import { VNode } from "../VNode"; import { VBindingsPreparer } from "../VBindingsPreparer"; import { VDirective } from "./VDirective"; import { VDirectiveParseContext } from "./VDirectiveParseContext"; import { VDOMUpdater } from "../VDOMUpdater"; /** * Directive for binding event listeners to DOM elements and lifecycle hooks. * The `v-on` directive allows you to listen to DOM events and execute specified methods when those events are triggered. * The syntax for using the `v-on` directive is `v-on:event="methodName"`, where `event` is the name of the event to listen for (e.g., `click`, `mouseover`, etc.), and `methodName` is the name of the method to be called when the event occurs. * Example usage: * * In this example, when the button is clicked, the `handleClick` method will be executed. * You can also use the shorthand `@event` instead of `v-on:event`. For example, `@click="handleClick"` is equivalent to `v-on:click="handleClick"`. * The `v-on` directive supports event modifiers such as `.stop`, `.prevent`, `.capture`, `.self`, and `.once` to modify the behavior of the event listener. * For example, `v-on:click.stop="handleClick"` will stop the event from propagating up the DOM tree. * * Additionally, this directive supports lifecycle hooks: * @mount="onMount" - Called before the VNode is mounted to the DOM element * @mounted="onMounted" - Called after the VNode is mounted to the DOM element * @update="onUpdate" - Called before the element is updated * @updated="onUpdated" - Called after the element is updated * @unmount="onUnmount" - Called before VNode cleanup begins * @unmounted="onUnmounted" - Called after VNode cleanup is complete (element reference still available) * * This directive is essential for handling user interactions and lifecycle events in your application. * Note that the methods referenced in the directive should be defined in the component's methods object. */ export declare class VOnDirective implements VDirective { #private; /** * @param context The context for parsing the directive. */ constructor(context: VDirectiveParseContext); /** * @inheritdoc */ get name(): string; /** * @inheritdoc */ get vNode(): VNode; /** * @inheritdoc */ get needsAnchor(): boolean; /** * @inheritdoc */ get bindingsPreparer(): VBindingsPreparer | undefined; /** * @inheritdoc */ get domUpdater(): VDOMUpdater | undefined; /** * @inheritdoc */ get templatize(): boolean; /** * @inheritdoc */ get dependentIdentifiers(): string[]; /** * @inheritdoc */ get onMount(): (() => void) | undefined; /** * @inheritdoc */ get onMounted(): (() => void) | undefined; /** * @inheritdoc */ get onUpdate(): (() => void) | undefined; /** * @inheritdoc */ get onUpdated(): (() => void) | undefined; /** * @inheritdoc */ get onUnmount(): (() => void) | undefined; /** * @inheritdoc */ get onUnmounted(): (() => void) | undefined; /** * @inheritdoc */ destroy(): void; }