UNPKG

syv

Version:

practical svelte components and utilities

28 lines (27 loc) 1.07 kB
import type { Attachment } from 'svelte/attachments'; /** autofocus element when condition is true */ export declare const autofocus: (when: boolean) => Attachment; /** automatically expand `textarea` height according to content */ export declare const autoresize: Attachment; export declare const copy: (opts: { data?: string | Blob; handler?: { accept?(): Promise<void>; reject?(): Promise<void>; }; }) => Attachment; /** determine if click is maintained for `duration` */ export declare const hold: (opts: { /** defaults to `2000` in ms */ duration?: number; /** executed when `duration` has been reached */ invoke?: () => void; }) => Attachment; export declare const observe: (opts: { selector?: string; margin?: string; threshold?: number | number[]; intersect(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; }) => Attachment; /** determine if there is click event outside of the element */ export declare const outside: (callback: (event: MouseEvent) => void) => Attachment;