11import { BasePlugin } from 'appium/plugin' ;
22import http from 'http' ;
33import { Application } from 'express' ;
4- import { CliArg , ISessionCapability , MockConfig , SniffConfig } from './types' ;
4+ import { CliArg , ISessionCapability , MockConfig , RequestInfo , SniffConfig } from './types' ;
55import _ from 'lodash' ;
66import { configureWifiProxy , isRealDevice } from './utils/adb' ;
77import { cleanUpProxyServer , sanitizeMockConfig , setupProxyServer } from './utils/proxy' ;
@@ -139,7 +139,7 @@ export class AppiumInterceptorPlugin extends BasePlugin {
139139 proxy . enableMock ( id ) ;
140140 }
141141
142- async startListening ( next : any , driver : any , config : SniffConfig ) {
142+ async startListening ( next : any , driver : any , config : SniffConfig ) : Promise < string > {
143143 const proxy = proxyCache . get ( driver . sessionId ) ;
144144 if ( ! proxy ) {
145145 logger . error ( 'Proxy is not running' ) ;
@@ -150,7 +150,7 @@ export class AppiumInterceptorPlugin extends BasePlugin {
150150 return proxy ?. addSniffer ( config ) ;
151151 }
152152
153- async stopListening ( next : any , driver : any , id : any ) {
153+ async stopListening ( next : any , driver : any , id : any ) : Promise < RequestInfo [ ] > {
154154 const proxy = proxyCache . get ( driver . sessionId ) ;
155155 if ( ! proxy ) {
156156 logger . error ( 'Proxy is not running' ) ;
0 commit comments