electron-builder.config.d.mts 1.5 KB

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