UNPKG

4.87 kBTypeScriptView Raw
1import { AsarIntegrityOptions } from "../asar/integrity";
2import { CompressionLevel, TargetConfiguration, TargetSpecificOptions } from "../core";
3import { FileAssociation } from "./FileAssociation";
4import { Publish } from "builder-util-runtime";
5export interface FileSet {
6 /**
7 * The source path relative to the project directory.
8 */
9 from?: string;
10 /**
11 * The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.
12 */
13 to?: string;
14 /**
15 * The [glob patterns](/file-patterns.md).
16 */
17 filter?: Array<string> | string;
18}
19export interface AsarOptions extends AsarIntegrityOptions {
20 /**
21 * Whether to automatically unpack executables files.
22 * @default true
23 */
24 smartUnpack?: boolean;
25 ordering?: string | null;
26}
27export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
28 /**
29 * The [artifact file name template](/configuration/configuration.md#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).
30 */
31 readonly artifactName?: string | null;
32 /**
33 * 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.
34 * @default normal
35 */
36 readonly compression?: CompressionLevel | null;
37 readonly files?: Array<FileSet | string> | FileSet | string | null;
38 readonly extraResources?: Array<FileSet | string> | FileSet | string | null;
39 readonly extraFiles?: Array<FileSet | string> | FileSet | string | null;
40 /**
41 * Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
42 *
43 * 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.
44 * @default true
45 */
46 readonly asar?: AsarOptions | boolean | null;
47 /**
48 * A [glob patterns](/file-patterns.md) 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.
49 */
50 readonly asarUnpack?: Array<string> | string | null;
51 /** @private */
52 readonly icon?: string | null;
53 /**
54 * The file associations.
55 */
56 readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
57 /**
58 * The URL protocol schemes.
59 */
60 readonly protocols?: Array<Protocol> | Protocol;
61 readonly forceCodeSigning?: boolean;
62 publish?: Publish;
63 /**
64 * 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`.
65 * @default true
66 */
67 readonly detectUpdateChannel?: boolean;
68 /**
69 * Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).
70 * @default false
71 */
72 readonly generateUpdatesFilesForAllChannels?: boolean;
73 /**
74 * The release info. Intended for command line usage:
75 *
76 * ```
77 * -c.releaseInfo.releaseNotes="new features"
78 * ```
79 */
80 readonly releaseInfo?: ReleaseInfo;
81 readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null;
82 /** @private */
83 cscLink?: string | null;
84 /** @private */
85 cscKeyPassword?: string | null;
86}
87export interface ReleaseInfo {
88 /**
89 * The release name.
90 */
91 releaseName?: string | null;
92 /**
93 * The release notes.
94 */
95 releaseNotes?: string | null;
96 /**
97 * 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).
98 */
99 releaseNotesFile?: string | null;
100 /**
101 * The release date.
102 */
103 releaseDate?: string;
104}
105/**
106 * URL Protocol Schemes. Protocols to associate the app with. macOS only.
107 *
108 * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
109 */
110export interface Protocol {
111 /**
112 * The name. e.g. `IRC server URL`.
113 */
114 readonly name: string;
115 /**
116 * The schemes. e.g. `["irc", "ircs"]`.
117 */
118 readonly schemes: Array<string>;
119 /**
120 * *macOS-only* The app’s role with respect to the type.
121 * @default Editor
122 */
123 readonly role?: "Editor" | "Viewer" | "Shell" | "None";
124}