UNPKG

6.15 kBTypeScriptView Raw
1import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from "../core";
2import { FileAssociation } from "./FileAssociation";
3export interface FileSet {
4 /**
5 * The source path relative to the project directory.
6 */
7 from?: string;
8 /**
9 * The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.
10 */
11 to?: string;
12 /**
13 * The [glob patterns](/file-patterns).
14 */
15 filter?: Array<string> | string;
16}
17export interface AsarOptions {
18 /**
19 * Whether to automatically unpack executables files.
20 * @default true
21 */
22 smartUnpack?: boolean;
23 ordering?: string | null;
24}
25export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
26 /**
27 * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as
28 * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
29 * @default com.electron.${name}
30 */
31 readonly appId?: string | null;
32 /**
33 * The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).
34 */
35 readonly artifactName?: string | null;
36 /**
37 * The executable name. Defaults to `productName`.
38 */
39 readonly executableName?: string | null;
40 /**
41 * The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time.
42 * @default normal
43 */
44 readonly compression?: CompressionLevel | null;
45 /**
46 * Whether to exclude all default ignored files(https://www.electron.build/configuration/contents#files) and options. Defaults to `false`.
47 *
48 * @default false
49 */
50 disableDefaultIgnoredFiles?: boolean | null;
51 files?: Array<FileSet | string> | FileSet | string | null;
52 extraResources?: Array<FileSet | string> | FileSet | string | null;
53 extraFiles?: Array<FileSet | string> | FileSet | string | null;
54 /**
55 * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
56 *
57 * Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work.
58 * @default true
59 */
60 readonly asar?: AsarOptions | boolean | null;
61 /**
62 * A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.
63 */
64 readonly asarUnpack?: Array<string> | string | null;
65 /** @private */
66 readonly icon?: string | null;
67 /**
68 * The file associations.
69 */
70 readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
71 /**
72 * The URL protocol schemes.
73 */
74 readonly protocols?: Array<Protocol> | Protocol;
75 /**
76 * The electron locales to keep. By default, all Electron locales used as-is.
77 */
78 readonly electronLanguages?: Array<string> | string;
79 /**
80 * Whether to fail if app will be not code signed.
81 */
82 readonly forceCodeSigning?: boolean;
83 /**
84 * The [electron-updater compatibility](/auto-update#compatibility) semver range.
85 */
86 readonly electronUpdaterCompatibility?: string | null;
87 publish?: Publish;
88 /**
89 * Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.
90 * @default true
91 */
92 readonly detectUpdateChannel?: boolean;
93 /**
94 * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).
95 * @default false
96 */
97 readonly generateUpdatesFilesForAllChannels?: boolean;
98 /**
99 * The release info. Intended for command line usage:
100 *
101 * ```
102 * -c.releaseInfo.releaseNotes="new features"
103 * ```
104 */
105 readonly releaseInfo?: ReleaseInfo;
106 readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null;
107 /** @private */
108 cscLink?: string | null;
109 /** @private */
110 cscKeyPassword?: string | null;
111 readonly defaultArch?: string;
112}
113export interface ReleaseInfo {
114 /**
115 * The release name.
116 */
117 releaseName?: string | null;
118 /**
119 * The release notes.
120 */
121 releaseNotes?: string | null;
122 /**
123 * The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](#MetadataDirectories-buildResources).
124 */
125 releaseNotesFile?: string | null;
126 /**
127 * The release date.
128 */
129 releaseDate?: string;
130 /**
131 * Vendor specific information.
132 */
133 vendor?: {
134 [key: string]: any;
135 } | null;
136}
137/**
138 * URL Protocol Schemes. Protocols to associate the app with. macOS only.
139 *
140 * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
141 */
142export interface Protocol {
143 /**
144 * The name. e.g. `IRC server URL`.
145 */
146 readonly name: string;
147 /**
148 * The schemes. e.g. `["irc", "ircs"]`.
149 */
150 readonly schemes: Array<string>;
151 /**
152 * *macOS-only* The app’s role with respect to the type.
153 * @default Editor
154 */
155 readonly role?: "Editor" | "Viewer" | "Shell" | "None";
156}