/
Framework.ts
54 lines (39 loc) · 1.56 KB
/
Framework.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
import { FileTransformer } from "builder-util/out/fs"
import { AsarIntegrity } from "./asar/integrity"
import { Platform, PlatformPackager, ElectronPlatformName, PackContext } from "./index"
export interface Framework {
readonly name: string
readonly version: string
readonly distMacOsAppName: string
readonly macOsDefaultTargets: Array<string>
readonly defaultAppIdPrefix: string
readonly isNpmRebuildRequired: boolean
readonly isCopyElevateHelper: boolean
getDefaultIcon?(platform: Platform): string | null
getMainFile?(platform: Platform): string | null
getExcludedDependencies?(platform: Platform): Array<string> | null
prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise<any>
beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise<any>
afterPack?(context: PackContext): Promise<any>
createTransformer?(): FileTransformer | null
}
export interface BeforeCopyExtraFilesOptions {
packager: PlatformPackager<any>
appOutDir: string
asarIntegrity: AsarIntegrity | null
// ElectronPlatformName
platformName: string
}
export interface PrepareApplicationStageDirectoryOptions {
readonly packager: PlatformPackager<any>
/**
* Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.
*/
readonly appOutDir: string
readonly platformName: ElectronPlatformName
readonly arch: string
readonly version: string
}
export function isElectronBased(framework: Framework): boolean {
return framework.name === "electron"
}