import { type ElementPart, noChange, nothing } from 'lit'; import { AsyncDirective, type DirectiveParameters, type Part } from 'lit/async-directive.js'; type Callbacks = { start: () => void; end: () => void; }; /** * A directive that determines,if a HTMLButtonElement is long pressed or only clicked. * Depending on the state it executes the callback once or repeating. * * Usage: * * */ declare class LongPressDirective extends AsyncDirective { host: HTMLButtonElement; observer: MutationObserver; callbacks: Callbacks; interval: NodeJS.Timeout; timeout: NodeJS.Timeout; constructor(part: Part); render(_callback: Callbacks): typeof nothing; update(part: ElementPart, [callbacks]: DirectiveParameters): typeof noChange; reconnected(): void; protected disconnected(): void; private handlePointerDown; /** * Start spinning on long press clicks otherwise handle as single click event */ private spinOnLongPressCallback; private handlePointerUp; /** * Stop the spinning and clean up all timer and observer */ private stopSpinningAndCleanUp; } export declare const longPress: (_callback: Callbacks) => import("lit/async-directive.js").DirectiveResult; export type { LongPressDirective };