electron-builder.config.d.mts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 files: readonly [
  8. string,
  9. string,
  10. string,
  11. string,
  12. { readonly from: string, readonly to: 'dsh', readonly filter: readonly ['**/*'] },
  13. { readonly from: string, readonly to: 'dsh/node_modules', readonly filter: readonly ['**/*'] },
  14. ]
  15. readonly asarUnpack: readonly string[]
  16. readonly extraResources: readonly [{ readonly from: string, readonly to: 'runtime' }]
  17. readonly mac: {
  18. readonly identity: string | undefined
  19. readonly forceCodeSigning: boolean
  20. readonly notarize: boolean
  21. readonly signIgnore: readonly string[]
  22. }
  23. readonly dmg: {
  24. readonly sign: boolean
  25. readonly writeUpdateInfo: boolean
  26. }
  27. readonly nsis: {
  28. readonly include: string
  29. }
  30. readonly artifactBuildCompleted: (artifact: { readonly file: string }) => Promise<void> | undefined
  31. readonly publish: readonly [{ readonly provider: 'generic', readonly url: string }] | null
  32. }
  33. /**
  34. * Create electron-builder configuration from one release environment.
  35. * @param env - Packaging environment.
  36. * @param hostPlatform - Build-host platform used when no explicit target is present.
  37. * @param hostArch - Build-host architecture used when no explicit target is present.
  38. * @returns electron-builder configuration.
  39. */
  40. export function createElectronBuilderConfig(
  41. env?: NodeJS.ProcessEnv,
  42. hostPlatform?: NodeJS.Platform,
  43. hostArch?: string,
  44. ): DesktopElectronBuilderConfig
  45. declare const electronBuilderConfig: DesktopElectronBuilderConfig
  46. export default electronBuilderConfig