aboutsummaryrefslogtreecommitdiff
path: root/src/pen-gestures/GestureUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pen-gestures/GestureUtils.ts')
-rw-r--r--src/pen-gestures/GestureUtils.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pen-gestures/GestureUtils.ts b/src/pen-gestures/GestureUtils.ts
index 41917aac9..28323d62f 100644
--- a/src/pen-gestures/GestureUtils.ts
+++ b/src/pen-gestures/GestureUtils.ts
@@ -1,32 +1,32 @@
import { Rect } from 'react-measure';
-import { PointData } from '../fields/InkField';
+import { Gestures, PointData } from './GestureTypes';
import { NDollarRecognizer } from './ndollar';
export namespace GestureUtils {
export class GestureEvent {
- constructor(readonly gesture: Gestures, readonly points: PointData[], readonly bounds: Rect, readonly text?: any) {}
+ readonly gesture: Gestures;
+ readonly points: PointData[];
+ readonly bounds: Rect;
+ readonly text?: any;
+
+ constructor(gesture: Gestures, points: PointData[], bounds: Rect, text?: any) {
+ this.gesture = gesture;
+ this.points = points;
+ this.bounds = bounds;
+ this.text = text;
+ }
}
export interface GestureEventDisposer {
(): void;
}
+ // eslint-disable-next-line no-undef
export function MakeGestureTarget(element: HTMLElement, func: (e: Event, ge: GestureEvent) => void): GestureEventDisposer {
const handler = (e: Event) => func(e, (e as CustomEvent<GestureEvent>).detail);
element.addEventListener('dashOnGesture', handler);
return () => element.removeEventListener('dashOnGesture', handler);
}
- export enum Gestures {
- Line = 'line',
- Stroke = 'stroke',
- Scribble = 'scribble',
- Text = 'text',
- Triangle = 'triangle',
- Circle = 'circle',
- Rectangle = 'rectangle',
- Arrow = 'arrow',
- }
-
export const GestureRecognizer = new NDollarRecognizer(false);
}