1 | import { Arch } from "builder-util";
|
2 | import { BeforeBuildContext, Target } from "./core";
|
3 | import { ElectronDownloadOptions } from "./electron/electron-download";
|
4 | import { AppXOptions } from "./options/AppXOptions";
|
5 | import { AppImageOptions, DebOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from "./options/linuxOptions";
|
6 | import { DmgOptions, MacConfiguration, MasConfiguration, PkgOptions } from "./options/macOptions";
|
7 | import { MsiOptions } from "./options/MsiOptions";
|
8 | import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions";
|
9 | import { SnapOptions } from "./options/SnapOptions";
|
10 | import { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions";
|
11 | import { WindowsConfiguration } from "./options/winOptions";
|
12 | import { BuildResult } from "./packager";
|
13 | import { PlatformPackager } from "./platformPackager";
|
14 | import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/nsis/nsisOptions";
|
15 |
|
16 |
|
17 |
|
18 | export interface Configuration extends PlatformSpecificBuildOptions {
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 | readonly appId?: string | null;
|
25 | |
26 |
|
27 |
|
28 | readonly productName?: string | null;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | readonly copyright?: string | null;
|
34 | readonly directories?: MetadataDirectories | null;
|
35 | |
36 |
|
37 |
|
38 | readonly mac?: MacConfiguration | null;
|
39 | |
40 |
|
41 |
|
42 | readonly mas?: MasConfiguration | null;
|
43 | |
44 |
|
45 |
|
46 | readonly dmg?: DmgOptions | null;
|
47 | |
48 |
|
49 |
|
50 | readonly pkg?: PkgOptions | null;
|
51 | |
52 |
|
53 |
|
54 | readonly win?: WindowsConfiguration | null;
|
55 | readonly nsis?: NsisOptions | null;
|
56 | readonly nsisWeb?: NsisWebOptions | null;
|
57 | readonly portable?: PortableOptions | null;
|
58 | readonly appx?: AppXOptions | null;
|
59 |
|
60 | readonly msi?: MsiOptions | null;
|
61 | readonly squirrelWindows?: SquirrelWindowsOptions | null;
|
62 | |
63 |
|
64 |
|
65 | readonly linux?: LinuxConfiguration | null;
|
66 | |
67 |
|
68 |
|
69 | readonly deb?: DebOptions | null;
|
70 | |
71 |
|
72 |
|
73 | readonly snap?: SnapOptions | null;
|
74 | |
75 |
|
76 |
|
77 | readonly appImage?: AppImageOptions | null;
|
78 | readonly pacman?: LinuxTargetSpecificOptions | null;
|
79 | readonly rpm?: LinuxTargetSpecificOptions | null;
|
80 | readonly freebsd?: LinuxTargetSpecificOptions | null;
|
81 | readonly p5p?: LinuxTargetSpecificOptions | null;
|
82 | readonly apk?: LinuxTargetSpecificOptions | null;
|
83 | |
84 |
|
85 |
|
86 |
|
87 | buildDependenciesFromSource?: boolean;
|
88 | |
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | readonly nodeGypRebuild?: boolean;
|
95 | |
96 |
|
97 |
|
98 | readonly npmArgs?: Array<string> | string | null;
|
99 | |
100 |
|
101 |
|
102 |
|
103 | readonly npmRebuild?: boolean;
|
104 | |
105 |
|
106 |
|
107 |
|
108 | readonly npmSkipBuildFromSource?: boolean;
|
109 | |
110 |
|
111 |
|
112 |
|
113 | readonly buildVersion?: string | null;
|
114 | |
115 |
|
116 |
|
117 | readonly electronCompile?: boolean;
|
118 | |
119 |
|
120 |
|
121 | readonly electronDist?: string;
|
122 | |
123 |
|
124 |
|
125 | readonly electronDownload?: ElectronDownloadOptions;
|
126 | |
127 |
|
128 |
|
129 | electronVersion?: string | null;
|
130 | |
131 |
|
132 |
|
133 |
|
134 |
|
135 | extends?: string | null;
|
136 | |
137 |
|
138 |
|
139 | readonly extraMetadata?: any;
|
140 | |
141 |
|
142 |
|
143 |
|
144 | readonly?: boolean;
|
145 | |
146 |
|
147 |
|
148 | readonly muonVersion?: string | null;
|
149 | |
150 |
|
151 |
|
152 |
|
153 | readonly protonNodeVersion?: string | null;
|
154 | |
155 |
|
156 |
|
157 | readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null;
|
158 | /**
|
159 | * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).
|
160 | */
|
161 | readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null;
|
162 | /**
|
163 | * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).
|
164 | */
|
165 | readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null;
|
166 | /**
|
167 | * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file.
|
168 | */
|
169 | readonly onNodeModuleFile?: ((file: string) => void) | string | null;
|
170 | /**
|
171 | * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.
|
172 | *
|
173 | * If provided and `node_modules` are missing, it will not invoke production dependencies check.
|
174 | */
|
175 | readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null;
|
176 | /**
|
177 | * Whether to build using Electron Build Service if target not supported on current OS.
|
178 | * @default true
|
179 | */
|
180 | readonly remoteBuild?: boolean;
|
181 | /**
|
182 | * Whether to include PDB files.
|
183 | * @default false
|
184 | */
|
185 | readonly includePdb?: boolean;
|
186 | /**
|
187 | * Whether to remove `scripts` field from `package.json` files.
|
188 | *
|
189 | * @default true
|
190 | */
|
191 | readonly removePackageScripts?: boolean;
|
192 | }
|
193 | export interface AfterPackContext {
|
194 | readonly outDir: string;
|
195 | readonly appOutDir: string;
|
196 | readonly packager: PlatformPackager<any>;
|
197 | readonly electronPlatformName: string;
|
198 | readonly arch: Arch;
|
199 | readonly targets: Array<Target>;
|
200 | }
|
201 | export interface MetadataDirectories {
|
202 | /**
|
203 | * The path to build resources.
|
204 | *
|
205 | * Please note — build resources is not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `"files": ["**\/*", "build/icon.*"]`
|
206 | * @default build
|
207 | */
|
208 | readonly buildResources?: string | null;
|
209 | /**
|
210 | * The output directory. [File macros](/file-patterns.md#file-macros) are supported.
|
211 | * @default dist
|
212 | */
|
213 | readonly output?: string | null;
|
214 | /**
|
215 | * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.
|
216 | */
|
217 | readonly app?: string | null;
|
218 | }
|
219 |
|
\ | No newline at end of file |