pw-ext-hook.d.ts 593 B

12345678910111213141516171819
  1. import { AxiosRequestConfig } from "axios"
  2. import { NetworkResponse } from "~/helpers/network"
  3. import { ExtensionStatus } from "~/newstore/HoppExtension"
  4. export interface PWExtensionHook {
  5. getVersion: () => { major: number; minor: number }
  6. sendRequest: (
  7. req: AxiosRequestConfig & { wantsBinary: boolean }
  8. ) => Promise<NetworkResponse>
  9. cancelRunningRequest: () => void
  10. }
  11. export type HoppExtensionStatusHook = {
  12. status: ExtensionStatus
  13. _subscribers: {
  14. status?: ((...args: any[]) => any)[] | undefined
  15. }
  16. subscribe(prop: "status", func: (...args: any[]) => any): void
  17. }