@dvcol/svelte-utils
Version:
Svelte library for common utility functions and constants
16 lines (15 loc) • 484 B
TypeScript
import type { Action } from 'svelte/action';
export type HoveringOptions = {
/**
* Whether the element is hovered.
* @default false
*/
hovered?: boolean;
/**
* Event handler that fires when the hovered state changes.
* @param value - New hovered state
* @param e - PointerEvent that triggered the change
*/
onChange?: (value: boolean, e: PointerEvent) => void;
};
export declare const hovering: Action<HTMLElement, HoveringOptions>;