1/** 2 * File associations. 3 * 4 * 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. 5 * 6 * On Windows works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to `true`. 7 */ 8export interface FileAssociation { 9 /** 10 * The extension (minus the leading period). e.g. `png`. 11 */ 12 readonly ext: string | Array<string>; 13 /** 14 * The name. e.g. `PNG`. Defaults to `ext`. 15 */ 16 readonly name?: string | null; 17 /** 18 * *windows-only.* The description. 19 */ 20 readonly description?: string | null; 21 /** 22 * *linux-only.* The mime-type. 23 */ 24 readonly mimeType?: string | null; 25 /** 26 * 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. 27 * 28 * Not supported on Linux, file issue if need (default icon will be `x-office-document`). 29 */ 30 readonly icon?: string | null; 31 /** 32 * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`. 33 * @default Editor 34 */ 35 readonly role?: string; 36 /** 37 * *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`. 38 */ 39 readonly isPackage?: boolean; 40 /** 41 * *macOS-only* The app’s rank with respect to the type. The value can be `Owner`, `Default`, `Alternate`, or `None`. Corresponds to `LSHandlerRank`. 42 * @default Default 43 */ 44 readonly rank?: string; 45} 46