()
| 22 | import type { Interactor } from '../interactor-types.ts'; |
| 23 | |
| 24 | export function createLinuxInteractor(): Interactor { |
| 25 | return { |
| 26 | open: (app) => openLinuxApp(app), |
| 27 | openDevice: () => Promise.resolve(), |
| 28 | close: (app) => closeLinuxApp(app), |
| 29 | tap: (x, y) => pressLinux(x, y), |
| 30 | doubleTap: (x, y) => doubleClickLinux(x, y), |
| 31 | swipe: (x1, y1, x2, y2, durationMs) => swipeLinux(x1, y1, x2, y2, durationMs), |
| 32 | pan: (x1, y1, x2, y2, durationMs) => swipeLinux(x1, y1, x2, y2, durationMs), |
| 33 | fling: () => { |
| 34 | throw new AppError('UNSUPPORTED_OPERATION', 'gesture fling not supported on Linux'); |
| 35 | }, |
| 36 | longPress: (x, y, durationMs) => longPressLinux(x, y, durationMs), |
| 37 | focus: (x, y) => focusLinux(x, y), |
| 38 | type: (text, delayMs) => typeLinux(text, delayMs), |
| 39 | fill: (x, y, text, delayMs) => fillLinux(x, y, text, delayMs), |
| 40 | scroll: (direction, options) => scrollLinux(direction, options), |
| 41 | pinch: () => { |
| 42 | throw new AppError('UNSUPPORTED_OPERATION', 'gesture pinch not supported on Linux'); |
| 43 | }, |
| 44 | screenshot: (outPath, options) => screenshotLinux(outPath, options), |
| 45 | snapshot: async (options) => { |
| 46 | const result = await withDiagnosticTimer( |
| 47 | 'snapshot_capture', |
| 48 | async () => await snapshotLinux(options?.surface), |
| 49 | { backend: 'linux-atspi' }, |
| 50 | ); |
| 51 | return { |
| 52 | nodes: result.nodes ?? [], |
| 53 | truncated: result.truncated ?? false, |
| 54 | backend: 'linux-atspi', |
| 55 | }; |
| 56 | }, |
| 57 | back: () => backLinux(), |
| 58 | home: () => homeLinux(), |
| 59 | rotate: () => { |
| 60 | throw new AppError('UNSUPPORTED_OPERATION', 'rotate not supported on Linux'); |
| 61 | }, |
| 62 | rotateGesture: () => { |
| 63 | throw new AppError('UNSUPPORTED_OPERATION', 'gesture rotate not supported on Linux'); |
| 64 | }, |
| 65 | transformGesture: () => { |
| 66 | throw new AppError('UNSUPPORTED_OPERATION', 'gesture transform not supported on Linux'); |
| 67 | }, |
| 68 | appSwitcher: () => { |
| 69 | throw new AppError('UNSUPPORTED_OPERATION', 'appSwitcher not yet supported on Linux'); |
| 70 | }, |
| 71 | readClipboard: () => readLinuxClipboard(), |
| 72 | writeClipboard: (text) => writeLinuxClipboard(text), |
| 73 | setSetting: () => { |
| 74 | throw new AppError('UNSUPPORTED_OPERATION', 'setSetting not supported on Linux'); |
| 75 | }, |
| 76 | }; |
| 77 | } |
no test coverage detected