Framework.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { FileTransformer } from "builder-util/out/fs";
  2. import { AsarIntegrity } from "./asar/integrity";
  3. import { Platform, PlatformPackager, ElectronPlatformName, AfterPackContext } from "./index";
  4. export interface Framework {
  5. readonly name: string;
  6. readonly version: string;
  7. readonly distMacOsAppName: string;
  8. readonly macOsDefaultTargets: Array<string>;
  9. readonly defaultAppIdPrefix: string;
  10. readonly isNpmRebuildRequired: boolean;
  11. readonly isCopyElevateHelper: boolean;
  12. getDefaultIcon?(platform: Platform): string | null;
  13. getMainFile?(platform: Platform): string | null;
  14. getExcludedDependencies?(platform: Platform): Array<string> | null;
  15. prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise<any>;
  16. beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise<any>;
  17. afterPack?(context: AfterPackContext): Promise<any>;
  18. createTransformer?(): FileTransformer | null;
  19. }
  20. export interface BeforeCopyExtraFilesOptions {
  21. packager: PlatformPackager<any>;
  22. appOutDir: string;
  23. asarIntegrity: AsarIntegrity | null;
  24. platformName: string;
  25. }
  26. export interface PrepareApplicationStageDirectoryOptions {
  27. readonly packager: PlatformPackager<any>;
  28. /**
  29. * Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.
  30. */
  31. readonly appOutDir: string;
  32. readonly platformName: ElectronPlatformName;
  33. readonly arch: string;
  34. readonly version: string;
  35. }
  36. export declare function isElectronBased(framework: Framework): boolean;