UNPKG

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