Skip to content

Commit 38d7854

Browse files
authored
fix: type error in the build (#1011)
* fix: type error in the build * remove import('@appium/types') every time * simplify a bit
1 parent 0cc9391 commit 38d7854

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/driver.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
InitialOpts,
77
StringRecord,
88
SingularSessionData,
9+
RouteMatcher
910
} from '@appium/types';
1011
import type { EspressoConstraints } from './constraints';
1112
import _ from 'lodash';
@@ -45,8 +46,7 @@ const DEVICE_PORT = 6791;
4546
// TODO: Add the list of paths that we never want to proxy to espresso server.
4647
// TODO: Need to segregate the paths better way using regular expressions wherever applicable.
4748
// (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[] = [
5050
['GET', new RegExp('^/session/(?!.*/)')],
5151
['GET', new RegExp('^/session/[^/]+/appium/device/current_activity')],
5252
['GET', new RegExp('^/session/[^/]+/appium/device/current_package')],
@@ -111,8 +111,7 @@ const NO_PROXY: import('@appium/types').RouteMatcher[] = [
111111
];
112112

113113
// 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[] = [
116115
['GET', new RegExp('^/session/[^/]+/appium')],
117116
['GET', new RegExp('^/session/[^/]+/context')],
118117
['GET', new RegExp('^/session/[^/]+/element/[^/]+/rect')],
@@ -686,12 +685,12 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
686685
}
687686

688687
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
689-
getProxyAvoidList (sessionId) {
688+
getProxyAvoidList (sessionId): RouteMatcher[] {
690689
// we are maintaining two sets of NO_PROXY lists, one for chromedriver(CHROME_NO_PROXY)
691690
// and one for Espresso(NO_PROXY), based on current context will return related NO_PROXY list
692691
this.jwpProxyAvoid = _.isNil(this.chromedriver) ? NO_PROXY : CHROME_NO_PROXY;
693692
if (this.opts.nativeWebScreenshot) {
694-
this.jwpProxyAvoid = /**@type {import('@appium/types').RouteMatcher[]} */([
693+
this.jwpProxyAvoid = ([
695694
...this.jwpProxyAvoid,
696695
['GET', new RegExp('^/session/[^/]+/screenshot')]
697696
]);

0 commit comments

Comments
 (0)