@selenite/commons
Version:
This typescript package provides a set of frequently used utilities, types and svelte actions for building projects with Typescript and Svelte.
22 lines (21 loc) • 741 B
TypeScript
import type { Action } from 'svelte/action';
/**
* Parameters of the box selection Svelte action.
*/
export interface BoxSelectionParams {
/** Is the box selection active. */
enabled?: boolean;
/** Selection callback. */
onselection?: (nodes: Element[]) => void;
/** Element containing the elements to select. */
holder?: HTMLElement;
/** Treshold for elements to be considered inside the box selection. Defaults to 0.9. */
threshold?: number;
}
/**
* Action to enable box selection on an element.
* @param node Element to attach the action to
* @param params Parameters for the action
* @returns Svelte action
*/
export declare const boxSelection: Action<HTMLElement, BoxSelectionParams | undefined>;