feat: extension identification improvements (#2332)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { AxiosRequestConfig } from "axios"
|
||||
import { NetworkResponse } from "~/helpers/network"
|
||||
import { ExtensionStatus } from "~/newstore/HoppExtension"
|
||||
|
||||
export interface PWExtensionHook {
|
||||
getVersion: () => { major: number; minor: number }
|
||||
@@ -8,3 +9,11 @@ export interface PWExtensionHook {
|
||||
) => Promise<NetworkResponse>
|
||||
cancelRunningRequest: () => void
|
||||
}
|
||||
|
||||
export type HoppExtensionStatusHook = {
|
||||
status: ExtensionStatus
|
||||
_subscribers: {
|
||||
status?: ((...args: any[]) => any)[] | undefined
|
||||
}
|
||||
subscribe(prop: "status", func: (...args: any[]) => any): void
|
||||
}
|
||||
|
||||
7
packages/hoppscotch-app/types/window.d.ts
vendored
7
packages/hoppscotch-app/types/window.d.ts
vendored
@@ -1,9 +1,8 @@
|
||||
import { PWExtensionHook } from "./pw-ext-hook"
|
||||
|
||||
export {}
|
||||
import { HoppExtensionStatusHook, PWExtensionHook } from "./pw-ext-hook"
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__POSTWOMAN_EXTENSION_HOOK__: PWExtensionHook
|
||||
__POSTWOMAN_EXTENSION_HOOK__: PWExtensionHook | undefined
|
||||
__HOPP_EXTENSION_STATUS_PROXY__: HoppExtensionStatusHook | undefined
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user