declare module "electron-builder-core" { import { Publish } from "electron-builder-http/out/publishOptions" export enum Arch { ia32 = 0, x64 = 1, armv7l = 2, } export type ArchType = "x64" | "ia32" | "armv7l" export function getArchSuffix(arch: Arch): string export type TargetConfigType = Array | string | TargetConfig | null export interface TargetConfig { /** * The target name. e.g. `snap`. */ readonly target: string /** * The arch or list of archs. */ readonly arch?: Array<"x64" | "ia32" | "armv7l"> | string } export function toLinuxArchString(arch: Arch): "armv7l" | "i386" | "amd64" export function archFromString(name: string): Arch export class Platform { name: string buildConfigurationKey: string nodeName: string static MAC: Platform static LINUX: Platform static WINDOWS: Platform static OSX: Platform constructor(name: string, buildConfigurationKey: string, nodeName: string) toString(): string createTarget(type?: string | Array | null, ...archs: Array): Map>> static current(): Platform static fromString(name: string): Platform } export abstract class Target { readonly name: string readonly isAsyncSupported: boolean readonly abstract outDir: string readonly abstract options: TargetSpecificOptions | null | undefined constructor(name: string, isAsyncSupported?: boolean) abstract build(appOutDir: string, arch: Arch): Promise finishBuild(): Promise } export interface TargetSpecificOptions { /** The [artifact file name pattern](https://github.com/electron-userland/electron-builder/wiki/Options#artifact-file-name-pattern). */ readonly artifactName?: string | null readonly publish?: Publish } export interface PlatformSpecificBuildOptions extends TargetSpecificOptions { readonly files?: Array | string | null readonly extraFiles?: Array | FilePattern | string | null readonly extraResources?: Array | FilePattern | string | null readonly asarUnpack?: Array | string | null readonly asar?: AsarOptions | boolean | null readonly target?: Array | string | TargetConfig | null readonly icon?: string | null readonly fileAssociations?: Array | FileAssociation readonly forceCodeSigning?: boolean } export const DEFAULT_TARGET = "default" export const DIR_TARGET = "dir" export interface AuthorMetadata { readonly name: string readonly email?: string } export type CompressionLevel = "store" | "normal" | "maximum" export interface RepositoryInfo { readonly url: string } export interface FilePattern { from?: string to?: string filter?: Array | string } export interface AsarOptions { smartUnpack?: boolean ordering?: string | null } export interface BeforeBuildContext { readonly appDir: string readonly electronVersion: string readonly platform: Platform readonly arch: string } /** * File associations. * * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)) and NSIS only. * * On Windows works only if [nsis.perMachine](https://github.com/electron-userland/electron-builder/wiki/Options#NsisOptions-perMachine) is set to `true`. */ export interface FileAssociation { /** * The extension (minus the leading period). e.g. `png`. */ readonly ext: string | Array /** * The name. e.g. `PNG`. Defaults to `ext`. */ readonly name?: string | null /** * *windows-only.* The description. */ readonly description?: string | null /** * The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon. */ readonly icon?: string | null /** * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`. * @default Editor */ readonly role?: string /** * *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`. */ readonly isPackage?: boolean } /** * URL Protocol Schemes. Protocols to associate the app with. macOS only. * * Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos). */ export interface Protocol { /** * The name. e.g. `IRC server URL`. */ readonly name: string /** * *macOS-only* The app’s role with respect to the type. * @default Editor */ readonly role?: "Editor" | "Viewer" | "Shell" | "None" /** * The schemes. e.g. `["irc", "ircs"]`. */ readonly schemes: Array } /** * `directories` */ export interface MetadataDirectories { /** * The path to build resources. * @default build */ readonly buildResources?: string | null /** * The output directory. * @default dist */ readonly output?: string | null /** * The application directory (containing the application package.json), defaults to `app`, `www` or working directory. */ readonly app?: string | null } export interface SourceRepositoryInfo { type: string domain: string user: string project: string } }