@@ -6,6 +6,7 @@ import type {
6
6
InitialOpts ,
7
7
StringRecord ,
8
8
SingularSessionData ,
9
+ RouteMatcher
9
10
} from '@appium/types' ;
10
11
import type { EspressoConstraints } from './constraints' ;
11
12
import _ from 'lodash' ;
@@ -45,8 +46,7 @@ const DEVICE_PORT = 6791;
45
46
// TODO: Add the list of paths that we never want to proxy to espresso server.
46
47
// TODO: Need to segregate the paths better way using regular expressions wherever applicable.
47
48
// (Not segregating right away because more paths to be added in the NO_PROXY list)
48
- /** @type {import('@appium/types').RouteMatcher[] } */
49
- const NO_PROXY : import ( '@appium/types' ) . RouteMatcher [ ] = [
49
+ const NO_PROXY : RouteMatcher [ ] = [
50
50
[ 'GET' , new RegExp ( '^/session/(?!.*/)' ) ] ,
51
51
[ 'GET' , new RegExp ( '^/session/[^/]+/appium/device/current_activity' ) ] ,
52
52
[ 'GET' , new RegExp ( '^/session/[^/]+/appium/device/current_package' ) ] ,
@@ -111,8 +111,7 @@ const NO_PROXY: import('@appium/types').RouteMatcher[] = [
111
111
] ;
112
112
113
113
// This is a set of methods and paths that we never want to proxy to Chromedriver.
114
- /** @type {import('@appium/types').RouteMatcher[] } */
115
- const CHROME_NO_PROXY : import ( '@appium/types' ) . RouteMatcher [ ] = [
114
+ const CHROME_NO_PROXY : RouteMatcher [ ] = [
116
115
[ 'GET' , new RegExp ( '^/session/[^/]+/appium' ) ] ,
117
116
[ 'GET' , new RegExp ( '^/session/[^/]+/context' ) ] ,
118
117
[ 'GET' , new RegExp ( '^/session/[^/]+/element/[^/]+/rect' ) ] ,
@@ -686,12 +685,12 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
686
685
}
687
686
688
687
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
689
- getProxyAvoidList ( sessionId ) {
688
+ getProxyAvoidList ( sessionId ) : RouteMatcher [ ] {
690
689
// we are maintaining two sets of NO_PROXY lists, one for chromedriver(CHROME_NO_PROXY)
691
690
// and one for Espresso(NO_PROXY), based on current context will return related NO_PROXY list
692
691
this . jwpProxyAvoid = _ . isNil ( this . chromedriver ) ? NO_PROXY : CHROME_NO_PROXY ;
693
692
if ( this . opts . nativeWebScreenshot ) {
694
- this . jwpProxyAvoid = /** @type { import('@appium/types').RouteMatcher[] } */ ( [
693
+ this . jwpProxyAvoid = ( [
695
694
...this . jwpProxyAvoid ,
696
695
[ 'GET' , new RegExp ( '^/session/[^/]+/screenshot' ) ]
697
696
] ) ;
0 commit comments