simgadget
    Preparing search index...

    Type Alias TapResult

    TapResult:
        | {
            acted: "touch";
            x: number;
            y: number;
            count: number;
            durationSeconds: number;
            element?: AXElement;
        }
        | {
            acted: "activation";
            element: AXElement;
            before?: string
            | number;
            after?: string | number;
        }

    What a tap did, and what it read back. There is no success that carries no information: "Tapped successfully" is the bug class this whole library was reshaped to kill, because a tap that hit the wrong control, a tap that landed 40% of the time and a tap that actuated nothing each reported exactly the same string.

    Type Declaration

    • {
          acted: "touch";
          x: number;
          y: number;
          count: number;
          durationSeconds: number;
          element?: AXElement;
      }
      • acted: "touch"

        A real synthesized touch was delivered.

      • x: number

        Logical coordinates the touch landed at — the element's centre when aimed by label, the caller's own coordinates otherwise. Never the portrait-space pair actually sent: reporting those would answer a landscape tap at (162, 352) with "tapped at (50, 163)", a coordinate in a space the caller does not use and cannot check against the tree.

      • y: number
      • count: number
      • durationSeconds: number
      • Optionalelement?: AXElement

        Present when aimed by label: the element that was resolved and hit-test-verified. Absent for a coordinate tap — coordinates are the caller saying where, and are taken at their word.

        Names what was tapped, not merely that something was: matching is a substring and the companion returns the first hit, so the element found is not always the one meant — a status line reading "Settings Switch = on" has outranked the switch it was describing, and a permission alert's sentence has outranked an app icon.

    • {
          acted: "activation";
          element: AXElement;
          before?: string | number;
          after?: string | number;
      }
      • acted: "activation"

        A toggle was operated through accessibility (AXPress — the activation VoiceOver performs), because a toggle's frame is routinely not its actuating region and no coordinate can hit it.

      • element: AXElement
      • Optionalbefore?: string | number
      • Optionalafter?: string | number

        Undefined when the state could not be read back — the host must be able to say so rather than claim success. When defined and equal to before, the activation did not take (most often: the control is scrolled out of view).