UNPKG

2.14 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Arch, ArchType } from "builder-util";
3import { AllPublishOptions } from "builder-util-runtime";
4export type Publish = AllPublishOptions | Array<AllPublishOptions> | null;
5export type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null;
6export interface TargetConfiguration {
7 /**
8 * The target name. e.g. `snap`.
9 */
10 readonly target: string;
11 /**
12 * The arch or list of archs.
13 */
14 readonly arch?: Array<ArchType> | ArchType;
15}
16export declare class Platform {
17 name: string;
18 buildConfigurationKey: string;
19 nodeName: NodeJS.Platform;
20 static MAC: Platform;
21 static LINUX: Platform;
22 static WINDOWS: Platform;
23 constructor(name: string, buildConfigurationKey: string, nodeName: NodeJS.Platform);
24 toString(): string;
25 createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>>;
26 static current(): Platform;
27 static fromString(name: string): Platform;
28}
29export declare abstract class Target {
30 readonly name: string;
31 readonly isAsyncSupported: boolean;
32 abstract readonly outDir: string;
33 abstract readonly options: TargetSpecificOptions | null | undefined;
34 protected constructor(name: string, isAsyncSupported?: boolean);
35 checkOptions(): Promise<any>;
36 abstract build(appOutDir: string, arch: Arch): Promise<any>;
37 finishBuild(): Promise<any>;
38}
39export interface TargetSpecificOptions {
40 /**
41 The [artifact file name template](/configuration/configuration#artifact-file-name-template).
42 */
43 readonly artifactName?: string | null;
44 publish?: Publish;
45}
46export declare const DEFAULT_TARGET = "default";
47export declare const DIR_TARGET = "dir";
48export type CompressionLevel = "store" | "normal" | "maximum";
49export interface BeforeBuildContext {
50 readonly appDir: string;
51 readonly electronVersion: string;
52 readonly platform: Platform;
53 readonly arch: string;
54}
55export interface SourceRepositoryInfo {
56 type?: string;
57 domain?: string;
58 user: string;
59 project: string;
60}