import type { Gesture, GestureEdge, GestureKind } from "./desktop/gestures"; export type GestureDirection = "clockwise" | "counterclockwise" | "down" | "inward" | "left" | "outward" | "right" | "up"; /** A parsed gesture binding. */ export type GestureBinding = { readonly kind: GestureKind; /** `undefined` for any count of three or more. */ readonly fingers: number | undefined; /** Every direction the gesture must have gone; none for any. */ readonly directions: ReadonlySet; /** An edge swipe's side; `undefined` for any side, and for other kinds. */ readonly edge: GestureEdge | undefined; }; /** A gesture that ended without being canceled, and where it went. */ export type FinishedGesture = { readonly kind: GestureKind; readonly fingers: number; readonly directions: ReadonlySet; readonly edge: GestureEdge | undefined; }; /** Whether `written` names a gesture rather than a chord. */ export declare const isGesture: (written: string) => boolean; /** `written` parsed. Throws on a binding written wrong. */ export declare const parseGesture: (written: string) => GestureBinding; /** `written` in its one spelling, directions in a fixed order. */ export declare const spelledGesture: (written: string) => string; /** * What `binding` asks the engine for: its kind, and its count or edge if it * has one. */ export declare const grabOf: ({ kind, fingers, edge }: GestureBinding) => string; /** * Follows one gesture at a time through its phases; `feed` returns it once * it ends without being canceled. * * A swipe went its larger axis's way, and also its smaller one's when that * moved at least half as far, so `swipe:3:up+left` is a diagonal. A pinch * went inward or outward by its last scale, and clockwise or * counterclockwise by its summed rotation. */ export declare const gestureTracker: () => { feed: (gesture: Gesture) => FinishedGesture | undefined; }; /** * The binding of `bindings` that best fits `finished`, of those whose kind, * count, edge and every direction it matches: a count or an edge over none, * then more directions over fewer. */ export declare const bestGesture: (bindings: Iterable, finished: FinishedGesture) => T | undefined;