( interactor: Interactor, selector: NonNullable<DispatchContext['directElementSelector']>, positionals: string[], context: DispatchContext, )
| 125 | } |
| 126 | |
| 127 | async function handleDirectElementSelectorFill( |
| 128 | interactor: Interactor, |
| 129 | selector: NonNullable<DispatchContext['directElementSelector']>, |
| 130 | positionals: string[], |
| 131 | context: DispatchContext, |
| 132 | ): Promise<Record<string, unknown>> { |
| 133 | if (!interactor.fillElementSelector) { |
| 134 | throw new AppError('UNSUPPORTED_OPERATION', 'direct element selector fill is not supported'); |
| 135 | } |
| 136 | const text = positionals.join(' '); |
| 137 | if (!text) throw new AppError('INVALID_ARGS', 'fill requires text'); |
| 138 | const delayMs = requireIntInRange(context.delayMs ?? 0, 'delay-ms', 0, 10_000); |
| 139 | const result = await interactor.fillElementSelector(selector, text, delayMs); |
| 140 | return { |
| 141 | selector: selector.raw, |
| 142 | text, |
| 143 | delayMs, |
| 144 | ...(result ?? {}), |
| 145 | ...successText(formatTextLengthMessage('Filled', text)), |
| 146 | }; |
| 147 | } |
| 148 | |
| 149 | export async function handlePressCommand( |
| 150 | device: DeviceInfo, |
no test coverage detected
searching dependent graphs…