MCPcopy Create free account
hub / github.com/callstack/agent-device / targetInputFromClientTarget

Function targetInputFromClientTarget

src/commands/cli-grammar/common.ts:101–112  ·  view source on GitHub ↗
(
  target: InteractionTarget | ElementTarget,
)

Source from the content-addressed store, hash-verified

99}
100
101export function targetInputFromClientTarget(
102 target: InteractionTarget | ElementTarget,
103): Record<string, unknown> {
104 if ('ref' in target && target.ref !== undefined) {
105 return compactRecord({ kind: 'ref', ref: target.ref, label: target.label });
106 }
107 if ('selector' in target && target.selector !== undefined) {
108 return { kind: 'selector', selector: target.selector };
109 }
110 const point = target as { x: number; y: number };
111 return { kind: 'point', x: point.x, y: point.y };
112}
113
114export function interactionTargetPositionals(input: InteractionTarget | CommandInput): string[] {
115 const target = readTargetRecord(input);

Callers 1

interactions.tsFile · 0.90

Calls 1

compactRecordFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…