UNPKG

@shockpkg/ria-packager

Version:

Package for creating Adobe AIR packages

365 lines (364 loc) 10.3 kB
/// <reference types="node" /> import { Plist, Value } from '@shockpkg/plist-dom'; import { IPackagerResourceOptions } from '../../packager'; import { IIcon, PackagerBundle } from '../bundle'; export interface IFileTypeIcon { data?: Buffer | null; file?: string | null; } /** * PackagerBundleMac constructor. * * @param path Output path. */ export declare class PackagerBundleMac extends PackagerBundle { /** * Create modern application icon file. * Enables higher resolutions icons and PNG compression. * Default false uses the legacy formats of the official packager. */ applicationIconModern: boolean; /** * Create modern document type icon file. * Enables higher resolutions icons and PNG compression. * Default false uses the legacy formats of the official packager. */ fileTypeIconModern: boolean; /** * Info.plist file. */ infoPlistFile: string | null; /** * Info.plist data. */ infoPlistData: (string | Readonly<string[]> | Readonly<Buffer> | null); /** * PkgInfo file. */ pkgInfoFile: string | null; /** * PkgInfo data. */ pkgInfoData: string | Readonly<Buffer> | null; /** * Remove unnecessary OS files from older versions of the framework. * The official packages will include these if they are present in SDK. */ frameworkCleanOsFiles: boolean; /** * Optionally preserve resource mtime. * The official packager does not preserve resource mtimes. */ preserveResourceMtime: boolean; /** * Value of CFBundleDocumentTypes CFBundleTypeName is description, not name. * Tag value controlled by application descriptor. * Set to false to match the behavior of SDK versions before 3.2.0.2070. */ plistDocumentTypeNameIsDescription: boolean; /** * Add an NSHighResolutionCapable tag to the Info.plist file. * Tag value controlled by application descriptor. * Set to false to match the behavior of SDK versions before 3.6.0.6090. */ plistHighResolutionCapable: boolean; /** * Remove unnecessary helper files from framework. * Set to false to match the behavior of SDK versions before 25.0.0.134. */ frameworkCleanHelpers: boolean; /** * Add an NSAppTransportSecurity tag to the Info.plist file. * Tag value controlled by application descriptor. * Set to false to match the behavior of SDK versions before 27.0.0.128. */ plistHasAppTransportSecurity: boolean; /** * Extension mapping. */ protected _extensionMapping: Map<string, string>; constructor(path: string); /** * If Info.plist is specified. * * @returns Is specified. */ get hasInfoPlist(): boolean; /** * If PkgInfo is specified. * * @returns Is specified. */ get hasPkgInfo(): boolean; /** * Get app icns file. * * @returns File name. */ get appIcnsFile(): string; /** * Get app icns path. * * @returns File path. */ get appIcnsPath(): string; /** * Get app Info.plist path. * * @returns File path. */ get appInfoPlistPath(): string; /** * Get app PkgInfo path. * * @returns File path. */ get appPkgInfoPath(): string; /** * Get app resources path. * * @returns Resources path. */ get appResourcesPath(): string; /** * Get app binary path. * * @returns Binary path. */ getAppBinaryPath(): string; /** * Get app framework path. * * @returns Framework path. */ getAppFrameworkPath(): string; /** * Get SDK binary path. * * @returns Binary path. */ getSdkBinaryPath(): string; /** * Get SDK framework path. * * @returns Framework path. */ getSdkFrameworkPath(): string; /** * Get framework files excluded. * * @returns Excluded files in framework. */ getFrameworkExcludes(): string[]; /** * Get Info.plist data if any specified, from data or file. * * @returns Info.plist data or null. */ getInfoPlistData(): Promise<Buffer | null>; /** * Get Info.plist data as DOM if any specified. * * @returns Info.plist DOM or null. */ getInfoPlistDom(): Promise<Plist | null>; /** * Get Info.plist data as DOM if any specified, or default. * * @returns Info.plist DOM or null. */ getInfoPlistDomOrDefault(): Promise<Plist>; /** * Get PkgInfo data if any specified, from data or file. * * @returns PkgInfo data or null. */ getPkgInfoData(): Promise<Buffer | null>; /** * Get PkgInfo data if any specified, or default. * * @returns PkgInfo data. */ getPkgInfoDataOrDefault(): Promise<Buffer>; /** * Get file mode value. * * @param executable Is the entry executable. * @returns File mode. */ protected _getFileMode(executable: boolean): 484 | 420; /** * Get plist CFBundleExecutable value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleExecutable(): Value | null; /** * Get plist CFBundleIdentifier value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleIdentifier(): Value | null; /** * Get plist CFBundleShortVersionString value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleShortVersionString(): Value | null; /** * Get plist CFBundleGetInfoString value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleGetInfoString(): Value | null; /** * Get plist NSHumanReadableCopyright value. * * @returns The value or null if excluded. */ protected _getPlistNSHumanReadableCopyright(): Value | null; /** * Get plist CFBundleIconFile value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleIconFile(): Value | null; /** * Get plist CFBundleLocalizations value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleLocalizations(): Value | null; /** * Get plist NSHighResolutionCapable value. * * @returns The value or null if excluded. */ protected _getPlistNSHighResolutionCapable(): Value | null; /** * Get plist NSAppTransportSecurity value. * * @returns The value or null if excluded. */ protected _getPlistNSAppTransportSecurity(): Value | null; /** * Get plist CFBundleDocumentTypes value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleDocumentTypes(): Value | null; /** * Get plist CFBundleAllowMixedLocalizations value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleAllowMixedLocalizations(): Value | null; /** * Get plist CFBundlePackageType value. * * @returns The value or null if excluded. */ protected _getPlistCFBundlePackageType(): Value | null; /** * Get plist CFBundleInfoDictionaryVersion value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleInfoDictionaryVersion(): Value | null; /** * Get plist LSMinimumSystemVersion value. * * @returns The value or null if excluded. */ protected _getPlistLSMinimumSystemVersion(): Value | null; /** * Get plist LSRequiresCarbon value. * * @returns The value or null if excluded. */ protected _getPlistLSRequiresCarbon(): Value | null; /** * Open implementation. * * @param applicationData The application descriptor data. */ protected _open(applicationData: Readonly<Buffer>): Promise<void>; /** * Close implementation. */ protected _close(): Promise<void>; /** * Write resource with data implementation. * * @param destination Packaged file relative destination. * @param data Resource data. * @param options Resource options. */ protected _writeResource(destination: string, data: Readonly<Buffer>, options: Readonly<IPackagerResourceOptions>): Promise<void>; /** * Get path to a resource file. * * @param parts Path parts. * @returns Full path. */ protected _getResourcePath(...parts: string[]): string; /** * Write the application icon if specified. */ protected _writeApplicationIcon(): Promise<void>; /** * Write file type icons, creating extension name mapping. * Avoids writting duplicate icons where the file/data is the same. */ protected _writeFileTypeIcons(): Promise<void>; /** * Write out PkgInfo file. */ protected _writePkgInfo(): Promise<void>; /** * Generate Info.plist DOM object. * * @returns Plist DOM. */ protected _generateInfoPlist(): Promise<Plist>; /** * Write out Info.plist file. */ protected _writeInfoPlist(): Promise<void>; /** * Calculate UID for icon, or null if none of required icons set. * * @param icon Icon info. * @returns UID string or null. */ protected _uidIcon(icon: Readonly<IIcon>): string | null; /** * Write icon matching official format. * * @param path Icon path. * @param icon Icon info. */ protected _writeIconReference(path: string, icon: Readonly<IIcon>): Promise<void>; /** * Write icon using modern format. * * @param path Icon path. * @param icon Icon info. * @returns Icon written. */ protected _writeIconModern(path: string, icon: Readonly<IIcon>): Promise<void>; /** * Get path for a file type icon file. * * @param name File name. * @returns File path. */ protected _getFileTypeIconPath(name: string): string; /** * Get name for a file type icon file. * * @param index Unique index. * @returns File name. */ protected _getFileTypeIconName(index: number): string; }