feat: init new response state system
This commit is contained in:
22
helpers/types/HoppRESTResponse.ts
Normal file
22
helpers/types/HoppRESTResponse.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export type HoppRESTResponse =
|
||||
| { type: "loading" }
|
||||
| {
|
||||
type: "fail"
|
||||
headers: { key: string; value: string }[]
|
||||
body: ArrayBuffer
|
||||
statusCode: number
|
||||
}
|
||||
| {
|
||||
type: "network_fail"
|
||||
error: Error
|
||||
}
|
||||
| {
|
||||
type: "success"
|
||||
headers: { key: string; value: string }[]
|
||||
body: ArrayBuffer
|
||||
statusCode: number
|
||||
meta: {
|
||||
responseSize: number // in bytes
|
||||
responseDuration: number // in millis
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user