Files
cypress/packages/proxy/lib/network-proxy.ts
Lachlan Miller ab401ecd35 chore: use import type syntax (#17864)
* chore: use import type across repo

* chore: use import type across repo

* chore: use import type across repo

* chore: use import type across repo

* update exports

* update test

* update import type

* update types

* use import type in driver

* correctly export function

* revert test

* remove unrelated code

* revert code

* improve type imports

* override for reporter
2021-08-25 09:11:56 +10:00

31 lines
590 B
TypeScript

import { Http, ServerCtx } from './http'
import type { BrowserPreRequest } from './types'
export class NetworkProxy {
http: Http
constructor (opts: ServerCtx) {
this.http = new Http(opts)
}
addPendingBrowserPreRequest (preRequest: BrowserPreRequest) {
this.http.addPendingBrowserPreRequest(preRequest)
}
handleHttpRequest (req, res) {
this.http.handle(req, res)
}
handleSourceMapRequest (req, res) {
this.http.handleSourceMapRequest(req, res)
}
setHttpBuffer (buffer) {
this.http.setBuffer(buffer)
}
reset () {
this.http.reset()
}
}