UNPKG

@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) 733 B
import type { ActionReturn } from 'svelte/action'; export type ResizeHandleParams<Element extends HTMLElement = HTMLElement> = { threshold?: number; onresize?: (params: { side: ResizeSide; node: Element; event: PointerEvent; height: number; width: number; }) => void; onresizeend?: () => void; sides?: { top?: boolean; left?: boolean; bottom?: boolean; right?: boolean; all?: boolean; } | undefined; }; export type ResizeSide = 'n' | 'w' | 's' | 'e' | 'ne' | 'se' | 'nw' | 'sw'; export declare function resizable<N extends HTMLElement = HTMLElement>(node: N, params?: ResizeHandleParams<N>): ActionReturn<ResizeHandleParams<N>>;