refactor: network strategy rewrite
This commit is contained in:
23
packages/hoppscotch-app/types/pw-ext-hook.d.ts
vendored
23
packages/hoppscotch-app/types/pw-ext-hook.d.ts
vendored
@@ -1,21 +1,10 @@
|
||||
interface PWExtensionRequestInfo {
|
||||
method: string
|
||||
url: string
|
||||
data: any & { wantsBinary: boolean }
|
||||
}
|
||||
import { AxiosRequestConfig } from "axios"
|
||||
import { NetworkResponse } from "~/helpers/network"
|
||||
|
||||
interface PWExtensionResponse {
|
||||
data: any
|
||||
config?: {
|
||||
timeData?: {
|
||||
startTime: number
|
||||
endTime: number
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface PWExtensionHook {
|
||||
export interface PWExtensionHook {
|
||||
getVersion: () => { major: number; minor: number }
|
||||
sendRequest: (req: PWExtensionRequestInfo) => Promise<PWExtensionResponse>
|
||||
sendRequest: (
|
||||
req: AxiosRequestConfig & { wantsBinary: boolean }
|
||||
) => Promise<NetworkResponse>
|
||||
cancelRunningRequest: () => void
|
||||
}
|
||||
|
||||
2
packages/hoppscotch-app/types/window.d.ts
vendored
2
packages/hoppscotch-app/types/window.d.ts
vendored
@@ -1,3 +1,5 @@
|
||||
import { PWExtensionHook } from "./pw-ext-hook"
|
||||
|
||||
export {}
|
||||
|
||||
declare global {
|
||||
|
||||
Reference in New Issue
Block a user