diff options
| author | bobzel <zzzman@gmail.com> | 2024-05-14 23:15:24 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-05-14 23:15:24 -0400 |
| commit | 3534aaf88a3c30a474b3b5a5b7f04adfe6f15fac (patch) | |
| tree | 47fb7a8671b209bd4d76e0f755a5b035c6936607 /src/pen-gestures/GestureUtils.ts | |
| parent | 87bca251d87b5a95da06b2212400ce9427152193 (diff) | |
| parent | 5cb7ad90e120123ca572e8ef5b1aa6ca41581134 (diff) | |
Merge branch 'restoringEslint' into sarah-ai-visualization
Diffstat (limited to 'src/pen-gestures/GestureUtils.ts')
| -rw-r--r-- | src/pen-gestures/GestureUtils.ts | 26 |
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); } |
