electron builder.Interface.FileAssociation
Electron-Builder / electron-builder / FileAssociation
文件关联。
macOS (对应 CFBundleDocumentTypes), 仅限 NSIS 和 MSI。
在 Windows (NSIS) 上,仅当 nsis.perMachine 设置为 true
时才有效。
属性¶
描述?¶
readonly
optional
description:null
|string
仅限 windows。 描述。
扩展名¶
readonly
ext:string
|string
[]
扩展名(不包括前导句点)。例如 png
。
图标?¶
readonly
optional
icon:null
|string
图标的路径(MacOS 为 .icns
,Windows 为 .ico
),相对于 build
(构建资源目录)。默认为 ${firstExt}.icns
/${firstExt}.ico
(如果指定了多个扩展名,则使用第一个)或应用程序图标。
Linux 不支持,如果需要请提交 issue(默认图标将为 x-office-document
)。MSI 不支持。
是包吗?¶
readonly
optional
isPackage:boolean
仅限 macOS 是否将文档作为捆绑包分发。如果设置为 true,则捆绑包目录被视为文件。对应于 LSTypeIsPackage
。
mimeType?¶
readonly
optional
mimeType:null
|string
仅限 linux。 mime-type。
名称?¶
readonly
optional
name:null
|string
名称。例如 PNG
。默认为 ext
。
rank?¶
readonly
optional
rank:string
仅限 macOS 应用程序相对于类型的排名。该值可以是 Owner
、Default
、Alternate
或 None
。对应于 LSHandlerRank
。
默认¶
Default
role?¶
readonly
optional
role:string
仅限 macOS 应用程序相对于类型的角色。该值可以是 Editor
、Viewer
、Shell
或 None
。对应于 CFBundleTypeRole
。
默认¶
Editor