pencil.js
Version:
Nice modular interactive 2D drawing library.
34 lines (33 loc) • 731 B
TypeScript
export type DraggableOptions = {
/**
* - Can move along vertical axis
*/
x?: boolean;
/**
* - Can move along horizontal axis
*/
y?: boolean;
/**
* - Relative limit of freedom
*/
constrain?: Vector;
};
export type DraggableAPI = {
/**
* - Change the "x" value in the draggable's options
*/
x: Function;
/**
* - Change the "y" value in the draggable's options
*/
y: Function;
/**
* - Change the "constrain" value in the draggable's options
*/
constrain: Function;
/**
* - Stop the component from being draggable
*/
stop: Function;
};
import Vector from "@pencil.js/vector";