forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron-packager.d.ts
115 lines (105 loc) · 4.56 KB
/
electron-packager.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Type definitions for electron-packager v5.1.0
// Project: https://github.com/maxogden/electron-packager
// Definitions by: Maxime LUCE <https://github.com/SomaticIT/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace ElectronPackager {
/** Electron-packager Options. */
export interface Options {
/** The source directory. */
dir: string;
/** The application name. */
name: string;
/**
* Allowed values: linux, win32, darwin, all. Not required if `all` is used.
* Arbitrary combinations of individual platforms are also supported via a comma-delimited string or array of strings.
*/
platform?: string | string[];
/** Allowed values: ia32, x64, all Not required if `all` is used. */
arch?: string;
/** Electron version (without the "v"). See https://github.com/atom/electron/releases. */
version: string;
/** Shortcut for `--arch=all --platform=all`. */
all?: boolean;
/** The output directory. */
out?: string;
/**
* Currently you must look for conversion tools in order to supply an icon in the format required by the platform:
* - OS X: `.icns`
* - Windows: `.ico`
*
* For Linux builds, this option is not required, as the dock/window list icon is set via the icon option in the BrowserWindow contructor.
* Setting the icon in the file manager is not currently supported.
*
* If the file extension is omitted, it is auto-completed to the correct extension based on the platform,
* including when `--platform=all` is in effect.
*/
icon?: string;
/** The bundle identifier to use in the app plist. */
"app-bundle-id"?: string;
/** The release version to set for the app. */
"app-version"?: string;
/** The build version to set for the app (OS X only). */
"build-version"?: string;
/** The bundle identifier to use in the app helper plist. */
"helper-bundle-id"?: string;
/** Object hash of application metadata to embed into the executable (Windows only). */
"version-string"?: VersionString;
/** The directory of cached electron downloads. Defaults to "$HOME/.electron". */
cache?: string;
/** Do not copy files into App whose filenames regex .match this string. */
ignore?: RegExp;
/** Runs `npm prune --production` on the app. */
prune?: boolean;
/** If output directory for a platform already exists, replaces it rather than skipping it. */
overwrite?: boolean;
/** Packages the source code within your app into an archive. */
asar?: boolean;
/** Unpacks the files to app.asar.unpacked directory whose filenames regex .match this string. */
"asar-unpack"?: string;
/** Should contain the identity to be used when running `codesign` (OS X only). */
sign?: string;
}
/** Object hash of application metadata to embed into the executable (Windows only). */
export interface VersionString {
CompanyName?: string;
LegalCopyright?: string;
FileDescription?: string;
OriginalFilename?: string;
FileVersion?: string;
ProductVersion?: string;
ProductName?: string;
InternalName?: string;
}
/** Electron-packager done callback. */
export interface Callback {
/**
* Callback wich is called when electron-packager is done.
*
* @param err - Contains errors if any.
* @param appPath - Path to the newly created application.
*/
(err: Error, appPath: string): void
}
/** Electron-packager function */
export interface Packager {
/**
* This will:
* - Find or download the correct release of Electron
* - Use that version of electron to create a app in <out>/<appname>-<platform>-<arch>
*
* You should be able to launch the app on the platform you built for. If not, check your settings and try again.
*
* @param opts - Options to configure packaging.
* @param callback - Callback which is called when packaging is done or an error occured.
*/
(opts: Options, callback: Callback): void;
}
}
declare module "electron-packager" {
const packager: ElectronPackager.Packager;
export = packager;
}
interface NodeRequireFunction {
(id: "electron-packager"): ElectronPackager.Packager;
}