@niuee/board
Version:
<h1 align="center"> board </h1> <p align="center"> board supercharges your html canvas element giving it the capabilities to pan, zoom, rotate, and much more. </p> <p align="center"> <a href="https://www.npmjs.com/package/@niuee/board">
35 lines (34 loc) • 1.53 kB
TypeScript
import { Point } from "../util/misc";
import { TouchPoints } from "./touch-input-state-machine";
import { RawUserInputPublisher } from "../raw-input-publisher";
import { BaseContext } from "../being/interfaces";
export interface TouchContext extends BaseContext {
addTouchPoints: (points: TouchPoints[]) => void;
removeTouchPoints: (idents: number[]) => void;
getCurrentTouchPointsCount: () => number;
getInitialTouchPointsPositions: (idents: number[]) => TouchPoints[];
updateTouchPoints: (pointsMoved: TouchPoints[]) => void;
notifyOnPan: (delta: Point) => void;
notifyOnZoom: (zoomAmount: number, anchorPoint: Point) => void;
alignCoordinateSystem: boolean;
canvas: HTMLCanvasElement;
}
export declare class TouchInputTracker implements TouchContext {
private _inputPublisher;
private _touchPointsMap;
private _canvas;
private _alignCoordinateSystem;
constructor(canvas: HTMLCanvasElement, inputPublisher: RawUserInputPublisher);
addTouchPoints(points: TouchPoints[]): void;
removeTouchPoints(identifiers: number[]): void;
getCurrentTouchPointsCount(): number;
getInitialTouchPointsPositions(idents: number[]): TouchPoints[];
updateTouchPoints(pointsMoved: TouchPoints[]): void;
notifyOnPan(delta: Point): void;
notifyOnZoom(zoomAmount: number, anchorPoint: Point): void;
get canvas(): HTMLCanvasElement;
get alignCoordinateSystem(): boolean;
set alignCoordinateSystem(value: boolean);
cleanup(): void;
setup(): void;
}