refactor: move from network strategies to generic interceptor service (#3242)
This commit is contained in:
16
packages/hoppscotch-common/src/platform/interceptors.ts
Normal file
16
packages/hoppscotch-common/src/platform/interceptors.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Service } from "dioc"
|
||||
import { Interceptor } from "~/services/interceptor.service"
|
||||
|
||||
export type PlatformInterceptorDef =
|
||||
| { type: "standalone"; interceptor: Interceptor }
|
||||
| {
|
||||
type: "service"
|
||||
service: typeof Service<unknown> & { ID: string } & {
|
||||
new (): Service & Interceptor
|
||||
}
|
||||
}
|
||||
|
||||
export type InterceptorsPlatformDef = {
|
||||
default: string
|
||||
interceptors: PlatformInterceptorDef[]
|
||||
}
|
||||
Reference in New Issue
Block a user