( record: Record<string, unknown>, key: string, )
| 314 | } |
| 315 | |
| 316 | function readInteractionTarget( |
| 317 | record: Record<string, unknown>, |
| 318 | key: string, |
| 319 | ): InteractionTargetInput { |
| 320 | const target = readRecordField(record, key); |
| 321 | const kind = requiredEnum(target, 'kind', INTERACTION_TARGET_KINDS); |
| 322 | switch (kind) { |
| 323 | case 'ref': |
| 324 | return { |
| 325 | kind, |
| 326 | ref: requiredString(target, 'ref'), |
| 327 | label: optionalString(target, 'label'), |
| 328 | }; |
| 329 | case 'selector': |
| 330 | return { kind, selector: requiredString(target, 'selector') }; |
| 331 | case 'point': |
| 332 | return { |
| 333 | kind, |
| 334 | x: requiredNumber(target, 'x'), |
| 335 | y: requiredNumber(target, 'y'), |
| 336 | }; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | function readElementTarget(record: Record<string, unknown>, key: string): ElementTargetInput { |
| 341 | const target = readRecordField(record, key); |
no test coverage detected
searching dependent graphs…