UNPKG

@studiometa/js-toolkit

Version:

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

14 lines (13 loc) • 640 B
import type { BaseDecorator, BaseInterface } from '../Base/types.js'; import type { Base } from '../Base/index.js'; import type { PointerServiceProps } from '../services/index.js'; export type RelativePointerDecoratorOptions = { target?: (this: Base, instance: Base) => HTMLElement; }; export interface RelativePointerInterface extends BaseInterface { movedrelative?(props: PointerServiceProps): void; } /** * Add dragging capabilities to a component. */ export declare function withRelativePointer<S extends Base>(BaseClass: typeof Base, { target }?: RelativePointerDecoratorOptions): BaseDecorator<RelativePointerInterface, S>;