UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

14 lines (13 loc) • 630 B
import type { BaseDecorator, BaseInterface } from '../Base/types.js'; import type { Base } from '../Base/index.js'; import type { DragServiceOptions, DragServiceProps } from '../services/index.js'; export type DragDecoratorOptions = DragServiceOptions & { target?: (this: Base, instance: Base) => HTMLElement; }; export interface WithDragInterface extends BaseInterface { dragged?(props: DragServiceProps): void; } /** * Add dragging capabilities to a component. */ export declare function withDrag<S extends Base>(BaseClass: typeof Base, { target, ...options }?: DragDecoratorOptions): BaseDecorator<BaseInterface, S>;