electron-builder.config.d.mts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /** Electron-builder fields asserted by the Desktop release tests. */
  2. export interface DesktopElectronBuilderConfig {
  3. readonly appId: string
  4. readonly directories: {
  5. readonly output: string
  6. }
  7. readonly extraResources: readonly [
  8. { readonly from: string, readonly to: 'runtime' },
  9. { readonly from: string, readonly to: 'seed' },
  10. ]
  11. readonly mac: {
  12. readonly identity: string | undefined
  13. readonly forceCodeSigning: boolean
  14. readonly notarize: boolean
  15. }
  16. readonly dmg: {
  17. readonly sign: boolean
  18. readonly writeUpdateInfo: boolean
  19. }
  20. readonly artifactBuildCompleted: (artifact: { readonly file: string }) => Promise<void> | undefined
  21. readonly publish: readonly [{ readonly provider: 'generic', readonly url: string }]
  22. }
  23. /**
  24. * Create electron-builder configuration from one release environment.
  25. * @param env - Packaging environment.
  26. * @param hostPlatform - Build-host platform used when no explicit target is present.
  27. * @param hostArch - Build-host architecture used when no explicit target is present.
  28. * @returns electron-builder configuration.
  29. */
  30. export function createElectronBuilderConfig(
  31. env?: NodeJS.ProcessEnv,
  32. hostPlatform?: NodeJS.Platform,
  33. hostArch?: string,
  34. ): DesktopElectronBuilderConfig
  35. declare const electronBuilderConfig: DesktopElectronBuilderConfig
  36. export default electronBuilderConfig