diff --git a/pkg/spec/src/actions.ts b/pkg/spec/src/actions.ts index 95ad388..156e480 100644 --- a/pkg/spec/src/actions.ts +++ b/pkg/spec/src/actions.ts @@ -2,6 +2,7 @@ import type { AccessibilityElement, Action, ActionGenerator, + DoubleTapAction, InputTextAction, Key, Point, @@ -42,6 +43,10 @@ export function Tap(parameters: { on: string | AccessibilityElement }): TapActio return globalThis.__sanderling__.tap(parameters); } +export function DoubleTap(parameters: { on: string | AccessibilityElement }): DoubleTapAction { + return globalThis.__sanderling__.doubleTap(parameters); +} + export function InputText(parameters: { into: string | AccessibilityElement; text: string; diff --git a/pkg/spec/src/index.ts b/pkg/spec/src/index.ts index 85febaf..73503ce 100644 --- a/pkg/spec/src/index.ts +++ b/pkg/spec/src/index.ts @@ -4,6 +4,7 @@ export type { Action, ActionGenerator, AttrSelector, + DoubleTapAction, EventuallyFormula, ExceptionRecord, Extracted, @@ -30,6 +31,7 @@ export type { export { extract, keyedBy } from "./extract.ts"; export { always, eventually, next, now } from "./ltl.ts"; export { + DoubleTap, InputText, PressKey, Swipe, diff --git a/pkg/spec/src/types.ts b/pkg/spec/src/types.ts index 0e548be..5752747 100644 --- a/pkg/spec/src/types.ts +++ b/pkg/spec/src/types.ts @@ -133,6 +133,7 @@ export interface Point { } export type TapAction = { kind: "Tap"; on: string | AccessibilityElement }; +export type DoubleTapAction = { kind: "DoubleTap"; on: string | AccessibilityElement }; export type InputTextAction = { kind: "InputText"; into: string | AccessibilityElement; @@ -148,6 +149,7 @@ export type PressKeyAction = { kind: "PressKey"; key: Key }; export type WaitAction = { kind: "Wait"; durationMillis: number }; export type Action = | TapAction + | DoubleTapAction | InputTextAction | SwipeAction | PressKeyAction @@ -194,6 +196,7 @@ export interface SanderlingRuntime { weighted: (...entries: WeightedEntry[]) => ActionGenerator; from: (items: readonly T[]) => Sampler; tap: (parameters: { on: string | AccessibilityElement }) => TapAction; + doubleTap: (parameters: { on: string | AccessibilityElement }) => DoubleTapAction; inputText: (parameters: { into: string | AccessibilityElement; text: string;