( target: InteractionTarget | ElementTarget, )
| 99 | } |
| 100 | |
| 101 | export 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 | |
| 114 | export function interactionTargetPositionals(input: InteractionTarget | CommandInput): string[] { |
| 115 | const target = readTargetRecord(input); |
no test coverage detected
searching dependent graphs…