UNPKG

2.17 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Arch, ArchType } from "builder-util";
3import { Publish } from "builder-util-runtime";
4export declare type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null;
5export interface TargetConfiguration {
6 /**
7 * The target name. e.g. `snap`.
8 */
9 readonly target: string;
10 /**
11 * The arch or list of archs.
12 */
13 readonly arch?: Array<ArchType> | ArchType;
14}
15export declare class Platform {
16 name: string;
17 buildConfigurationKey: string;
18 nodeName: NodeJS.Platform;
19 static MAC: Platform;
20 static LINUX: Platform;
21 static WINDOWS: Platform;
22 constructor(name: string, buildConfigurationKey: string, nodeName: NodeJS.Platform);
23 toString(): string;
24 createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>>;
25 static current(): Platform;
26 static fromString(name: string): Platform;
27}
28export declare abstract class Target {
29 readonly name: string;
30 readonly isAsyncSupported: boolean;
31 abstract readonly outDir: string;
32 abstract readonly options: TargetSpecificOptions | null | undefined;
33 protected constructor(name: string, isAsyncSupported?: boolean);
34 protected logBuilding(targetPresentableName: string, artifactPath: string, arch: Arch): void;
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.md#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 declare 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}