forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron-builder.d.ts
90 lines (76 loc) · 2.6 KB
/
electron-builder.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
// Type definitions for electron-builder v2.0.2
// Project: https://github.com/loopline-systems/electron-builder
// Definitions by: Maxime LUCE <https://github.com/SomaticIT/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace ElectronBuilder {
/** Electron-builder Options. */
export interface Options {
/** Source application path. */
appPath: string;
/** Platforms to build. Allowed values: win, osx, all. */
platform: string;
/** Path or Object. Configuration for build. */
config: string | Config;
/** The output directory. */
out?: string;
}
/** Build configuration by platforms. */
export interface Config {
/** Configurations for Mac OS X. */
osx: {
/** Installer title. */
title: string;
/** Installer background. */
background: string;
/** Installer icon. */
icon: string;
/** Installer icon size. */
"icon-size": number;
/** Installer custom contents. */
contents: [OsxContents, OsxContents]
};
/** Configurations for Windows. */
win: {
/** Installer title. */
title: string;
/** Installer icon. */
icon: string;
};
}
/** OSX Installer custom contents. */
export interface OsxContents {
/** Horizontal position on installer screen (in pixels). */
x: number;
/** Vertical position on installer screen (in pixels). */
y: number;
/** Content type. Allowed values are "file", "link". */
type: string;
/** Link only. Customize link destination path. */
path?: string;
}
/** Electron-builder done callback. */
export interface Callback {
/**
* Callback wich is called when electron-builder is done.
* @param err - Contains errors if any.
*/
(err: Error): void
}
/** Prototype for electron-builder. */
export interface Builder {
/**
* Build the installer for given platform.
*
* @param opts - Options to configure installer.
* @param callback - Callback which is called when building is done or an error occured.
*/
build(opts: Options, callback: Callback): void;
}
}
declare module "electron-builder" {
export function init(): ElectronBuilder.Builder;
}
interface NodeRequireFunction {
(id: "electron-builder"): { init(): ElectronBuilder.Builder };
}