maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
37 lines (36 loc) • 1.09 kB
TypeScript
import { ObjectDirective, Plugin } from 'vue';
interface VClickOutsideOptions {
/**
* The callback function to be called when the element is clicked outside.
*/
callback: (...args: any[]) => any;
/**
* The selectors to ignore.
*/
ignore?: string[];
/**
* Whether to capture the event.
*/
capture?: boolean;
/**
* Whether to only trigger the callback once.
*/
once?: boolean;
/**
* Whether to stop event propagation.
*/
stopPropagation?: boolean;
}
/**
* The value of the v-click-outside directive.
*/
type VClickOutsideBindingValue = ((...args: any[]) => any) | VClickOutsideOptions;
export type VClickOutsideDirective = ObjectDirective<HTMLElement, VClickOutsideBindingValue>;
declare const directive: VClickOutsideDirective;
declare const plugin: Plugin;
export { directive as vClickOutside, type VClickOutsideBindingValue, plugin as vClickOutsideInstall, type VClickOutsideOptions, };
declare module 'vue' {
interface GlobalDirectives {
vClickOutside: VClickOutsideDirective;
}
}