( parts: string[], action: Pick<SessionAction, 'command' | 'flags'>, )
| 65 | |
| 66 | // fallow-ignore-next-line complexity |
| 67 | export function appendScriptSeriesFlags( |
| 68 | parts: string[], |
| 69 | action: Pick<SessionAction, 'command' | 'flags'>, |
| 70 | ): void { |
| 71 | const flags = action.flags ?? {}; |
| 72 | if (isClickLikeCommand(action.command)) { |
| 73 | if (typeof flags.count === 'number') parts.push('--count', String(flags.count)); |
| 74 | if (typeof flags.intervalMs === 'number') parts.push('--interval-ms', String(flags.intervalMs)); |
| 75 | if (typeof flags.holdMs === 'number') parts.push('--hold-ms', String(flags.holdMs)); |
| 76 | if (typeof flags.jitterPx === 'number') parts.push('--jitter-px', String(flags.jitterPx)); |
| 77 | if (flags.doubleTap === true) parts.push('--double-tap'); |
| 78 | const clickButton = flags.clickButton; |
| 79 | if (clickButton && clickButton !== 'primary') { |
| 80 | parts.push('--button', clickButton); |
| 81 | } |
| 82 | return; |
| 83 | } |
| 84 | if (action.command === 'swipe') { |
| 85 | if (typeof flags.count === 'number') parts.push('--count', String(flags.count)); |
| 86 | if (typeof flags.pauseMs === 'number') parts.push('--pause-ms', String(flags.pauseMs)); |
| 87 | if (flags.pattern === 'one-way' || flags.pattern === 'ping-pong') { |
| 88 | parts.push('--pattern', flags.pattern); |
| 89 | } |
| 90 | return; |
| 91 | } |
| 92 | if (isTypingCommand(action.command) && typeof flags.delayMs === 'number') { |
| 93 | parts.push('--delay-ms', String(flags.delayMs)); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | export function appendRuntimeHintFlags( |
| 98 | parts: string[], |
no test coverage detected