UNPKG

4.31 kBTypeScriptView Raw
1import { Arch, AsyncTaskManager, DebugLogger } from "builder-util";
2import { FileTransformer } from "builder-util/out/fs";
3import { AppInfo } from "./appInfo";
4import { PackagerOptions, Packager, AfterPackContext, Configuration, ElectronPlatformName, FileAssociation, PlatformSpecificBuildOptions, CompressionLevel, Platform, Target, TargetSpecificOptions } from "./index";
5export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions> {
6 readonly info: Packager;
7 readonly platform: Platform;
8 readonly packagerOptions: PackagerOptions;
9 readonly buildResourcesDir: string;
10 readonly projectDir: string;
11 readonly config: Configuration;
12 readonly platformSpecificBuildOptions: DC;
13 readonly resourceList: Promise<Array<string>>;
14 private readonly _resourceList;
15 readonly appInfo: AppInfo;
16 protected constructor(info: Packager, platform: Platform);
17 readonly compression: CompressionLevel;
18 readonly debugLogger: DebugLogger;
19 abstract readonly defaultTarget: Array<string>;
20 protected prepareAppInfo(appInfo: AppInfo): AppInfo;
21 private static normalizePlatformSpecificBuildOptions;
22 abstract createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void;
23 protected getCscPassword(): string;
24 protected getCscLink(extraEnvName?: string | null): string | null | undefined;
25 protected doGetCscPassword(): string | null | undefined;
26 protected computeAppOutDir(outDir: string, arch: Arch): string;
27 dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): void;
28 pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any>;
29 protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): void;
30 private static buildAsyncTargets;
31 private getExtraFileMatchers;
32 readonly electronDistExecutableName: "electron" | "brave";
33 readonly electronDistMacOsExecutableName: "Electron" | "Brave";
34 protected doPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array<Target>): Promise<void>;
35 protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null;
36 private copyAppFiles;
37 protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise<any>;
38 getIconPath(): Promise<string | null>;
39 private computeAsarOptions;
40 getElectronSrcDir(dist: string): string;
41 getElectronDestinationDir(appOutDir: string): string;
42 getResourcesDir(appOutDir: string): string;
43 getMacOsResourcesDir(appOutDir: string): string;
44 private checkFileInPackage;
45 private sanityCheckPackage;
46 computeSafeArtifactName(suggestedName: string | null, ext: string, arch?: Arch | null, skipArchIfX64?: boolean, safePattern?: string): string | null;
47 expandArtifactNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null, defaultPattern?: string, skipArchIfX64?: boolean): string;
48 private computeArtifactName;
49 expandMacro(pattern: string, arch?: string | null, extra?: any, isProductNameSanitized?: boolean): string;
50 generateName2(ext: string | null, classifier: string | null | undefined, deployment: boolean): string;
51 getTempFile(suffix: string): Promise<string>;
52 readonly fileAssociations: Array<FileAssociation>;
53 getResource(custom: string | null | undefined, ...names: Array<string>): Promise<string | null>;
54 readonly forceCodeSigning: boolean;
55 protected getOrConvertIcon(format: IconFormat): Promise<string | null>;
56 resolveIcon(sources: Array<string>, outputFormat: IconFormat): Promise<Array<IconInfo>>;
57}
58export interface IconInfo {
59 file: string;
60 size: number;
61}
62export declare type IconFormat = "icns" | "ico" | "set";
63export declare function isSafeGithubName(name: string): boolean;
64export declare function normalizeExt(ext: string): string;
65export declare function resolveFunction<T>(executor: T | string, name: string): T;
66export declare function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined;