updater.ts 495 B

1234567891011121314151617
  1. import type { Accessor } from "solid-js"
  2. export type UpdaterState =
  3. | { status: "disabled" }
  4. | { status: "idle" }
  5. | { status: "checking" }
  6. | { status: "downloading"; version: string; percent?: number }
  7. | { status: "ready"; version: string }
  8. | { status: "up-to-date" }
  9. | { status: "installing"; version: string }
  10. | { status: "error"; message: string }
  11. export type UpdaterPlatform = {
  12. state: Accessor<UpdaterState>
  13. check(): Promise<UpdaterState>
  14. install(): Promise<void>
  15. }