updateInfo.d.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export interface ReleaseNoteInfo {
  2. /**
  3. * The version.
  4. */
  5. readonly version: string;
  6. /**
  7. * The note.
  8. */
  9. readonly note: string | null;
  10. }
  11. export interface BlockMapDataHolder {
  12. /**
  13. * The file size. Used to verify downloaded size (save one HTTP request to get length).
  14. * Also used when block map data is embedded into the file (appimage, windows web installer package).
  15. */
  16. size?: number;
  17. /**
  18. * The block map file size. Used when block map data is embedded into the file (appimage, windows web installer package).
  19. * This information can be obtained from the file itself, but it requires additional HTTP request,
  20. * so, to reduce request count, block map size is specified in the update metadata too.
  21. */
  22. blockMapSize?: number;
  23. /**
  24. * The file checksum.
  25. */
  26. readonly sha512: string;
  27. }
  28. export interface PackageFileInfo extends BlockMapDataHolder {
  29. readonly path: string;
  30. }
  31. export interface UpdateFileInfo extends BlockMapDataHolder {
  32. url: string;
  33. }
  34. export interface UpdateInfo {
  35. /**
  36. * The version.
  37. */
  38. readonly version: string;
  39. readonly files: Array<UpdateFileInfo>;
  40. /** @deprecated */
  41. readonly path: string;
  42. /** @deprecated */
  43. readonly sha512: string;
  44. /**
  45. * The release name.
  46. */
  47. releaseName?: string | null;
  48. /**
  49. * The release notes. List if `updater.fullChangelog` is set to `true`, `string` otherwise.
  50. */
  51. releaseNotes?: string | Array<ReleaseNoteInfo> | null;
  52. /**
  53. * The release date.
  54. */
  55. releaseDate: string;
  56. /**
  57. * The [staged rollout](auto-update.md#staged-rollouts) percentage, 0-100.
  58. */
  59. readonly stagingPercentage?: number;
  60. }
  61. export interface WindowsUpdateInfo extends UpdateInfo {
  62. packages?: {
  63. [arch: string]: PackageFileInfo;
  64. } | null;
  65. /**
  66. * @deprecated
  67. * @private
  68. */
  69. sha2?: string;
  70. }