DefinitelyTyped/github-electron/github-electron.auto-updater.d.ts
2016-03-26 02:11:16 +01:00

52 lines
1.7 KiB
TypeScript

// 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;
}
}