forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub-electron.auto-updater.d.ts
51 lines (49 loc) · 1.74 KB
/
github-electron.auto-updater.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Type definitions for Electron v0.37.2
// Project: http://electron.atom.io/
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="github-electron.event-emitter.d.ts" />
declare namespace Electron {
/**
* This module provides an interface for the Squirrel auto-updater framework.
*/
class AutoUpdater extends EventEmitter {
/**
* Emitted when there is an error while updating.
*/
on(event: 'error', listener: (error: Error) => void): this;
/**
* Emitted when checking if an update has started.
*/
on(event: 'checking-for-update', listener: Function): this;
/**
* Emitted when there is an available update. The update is downloaded automatically.
*/
on(event: 'update-available', listener: Function): this;
/**
* Emitted when there is no available update.
*/
on(event: 'update-not-available', listener: Function): this;
/**
* Emitted when an update has been downloaded.
* Note: On Windows only releaseName is available.
*/
on(event: 'update-downloaded', listener: (event: Event, releaseNotes: string, releaseName: string, releaseDate: Date, updateURL: string) => void): this;
on(event: string, listener: Function): this;
/**
* Set the url and initialize the auto updater.
* The url cannot be changed once it is set.
*/
setFeedURL(url: string): void;
/**
* Ask the server whether there is an update, you have to call setFeedURL
* before using this API
*/
checkForUpdates(): any;
/**
* Restarts the app and installs the update after it has been downloaded.
* It should only be called after update-downloaded has been emitted.
*/
quitAndInstall(): void;
}
}