@@ -23,15 +23,17 @@ import type { BackMode } from '../contracts/back-mode.ts';
2323import type { ClickButton } from '../core/click-button.ts' ;
2424import type { RecordingExportQuality } from '../core/recording-export-quality.ts' ;
2525import type { RecordingScope } from '../contracts/recording-scope.ts' ;
26- import type { DeviceRotation } from '../contracts/device-rotation.ts' ;
27- import type { TvRemoteButton } from '../contracts/tv-remote.ts' ;
2826import type {
2927 ScrollDirection ,
3028 SwipePattern ,
3129 SwipePreset ,
3230 TransformGestureParams ,
3331} from '../contracts/scroll-gesture.ts' ;
3432import type { ScrollInputDirection } from '../commands/interaction/runtime/gestures.ts' ;
33+ import type {
34+ NavigationCommandOptions ,
35+ ProjectedNavigationCommandClient ,
36+ } from '../commands/system/navigation-projection.ts' ;
3537import type { LogAction } from '../contracts/logs.ts' ;
3638import type { SessionSurface } from '../contracts/session-surface.ts' ;
3739import type { FindLocator } from '../selectors/find.ts' ;
@@ -534,17 +536,12 @@ export type AlertCommandResult = DaemonResponseData & {
534536
535537export type AppStateCommandOptions = DeviceCommandBaseOptions ;
536538
537- export type BackCommandOptions = DeviceCommandBaseOptions & {
538- mode ?: BackMode ;
539- } ;
540-
541- type HomeCommandOptions = DeviceCommandBaseOptions ;
539+ export type BackCommandOptions = DeviceCommandBaseOptions & NavigationCommandOptions < 'back' > ;
542540
543- export type RotateCommandOptions = DeviceCommandBaseOptions & {
544- orientation : DeviceRotation ;
545- } ;
541+ export type RotateCommandOptions = DeviceCommandBaseOptions & NavigationCommandOptions < 'rotate' > ;
546542
547- export type AppSwitcherCommandOptions = DeviceCommandBaseOptions ;
543+ export type AppSwitcherCommandOptions = DeviceCommandBaseOptions &
544+ NavigationCommandOptions < 'app-switcher' > ;
548545
549546export type KeyboardCommandOptions = DeviceCommandBaseOptions & {
550547 action ?: 'status' | 'dismiss' | 'enter' | 'return' ;
@@ -559,10 +556,8 @@ export type ClipboardCommandOptions =
559556 text : string ;
560557 } ) ;
561558
562- export type TvRemoteCommandOptions = DeviceCommandBaseOptions & {
563- button : TvRemoteButton ;
564- durationMs ?: number ;
565- } ;
559+ export type TvRemoteCommandOptions = DeviceCommandBaseOptions &
560+ NavigationCommandOptions < 'tv-remote' > ;
566561
567562export type ReactNativeCommandOptions = DeviceCommandBaseOptions & {
568563 action : 'dismiss-overlay' ;
@@ -583,17 +578,12 @@ export type ViewportCommandOptions = DeviceCommandBaseOptions & {
583578 height : number ;
584579} ;
585580
586- export type AgentDeviceCommandClient = {
581+ type NonNavigationCommandClient = {
587582 wait : ( options : WaitCommandOptions ) => Promise < CommandResult < 'wait' > > ;
588583 alert : ( options ?: AlertCommandOptions ) => Promise < CommandRequestResult > ;
589584 appState : ( options ?: AppStateCommandOptions ) => Promise < CommandResult < 'appstate' > > ;
590- back : ( options ?: BackCommandOptions ) => Promise < CommandResult < 'back' > > ;
591- home : ( options ?: HomeCommandOptions ) => Promise < CommandResult < 'home' > > ;
592- rotate : ( options : RotateCommandOptions ) => Promise < CommandResult < 'rotate' > > ;
593- appSwitcher : ( options ?: AppSwitcherCommandOptions ) => Promise < CommandResult < 'app-switcher' > > ;
594585 keyboard : ( options ?: KeyboardCommandOptions ) => Promise < CommandResult < 'keyboard' > > ;
595586 clipboard : ( options : ClipboardCommandOptions ) => Promise < CommandResult < 'clipboard' > > ;
596- tvRemote : ( options : TvRemoteCommandOptions ) => Promise < CommandResult < 'tv-remote' > > ;
597587 reactNative : ( options : ReactNativeCommandOptions ) => Promise < CommandRequestResult > ;
598588 doctor : ( options ?: DoctorCommandOptions ) => Promise < CommandResult < 'doctor' > > ;
599589 /**
@@ -604,6 +594,9 @@ export type AgentDeviceCommandClient = {
604594 viewport : ( options : ViewportCommandOptions ) => Promise < CommandResult < 'viewport' > > ;
605595} ;
606596
597+ export type AgentDeviceCommandClient = ProjectedNavigationCommandClient < DeviceCommandBaseOptions > &
598+ NonNavigationCommandClient ;
599+
607600type SelectorSnapshotCommandOptions = Pick < CaptureSnapshotOptions , 'depth' | 'scope' | 'raw' > ;
608601type FindSnapshotCommandOptions = Pick < CaptureSnapshotOptions , 'depth' | 'raw' > ;
609602
0 commit comments