UNPKG

@shockpkg/ria-packager

Version:

Package for creating Adobe AIR packages

336 lines (335 loc) 9.77 kB
import { IPackagerResourceOptions } from '../../packager.ts'; import { IIcon, PackagerBundle } from '../bundle.ts'; /** * PackagerBundleMac object. */ 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<Uint8Array> | (() => string | Readonly<Uint8Array>) | (() => Promise<string | Readonly<Uint8Array>>) | null; /** * PkgInfo file. */ pkgInfoFile: string | null; /** * PkgInfo data. */ pkgInfoData: string | Readonly<Uint8Array> | (() => string | Readonly<Uint8Array>) | (() => Promise<string | Readonly<Uint8Array>>) | 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>; /** * PackagerBundleMac constructor. * * @param path Output path. */ 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 PkgInfo data if from data or file, else default. * * @returns PkgInfo data. */ getPkgInfoData(): Promise<Readonly<Uint8Array<ArrayBufferLike>> | Buffer<ArrayBufferLike> | (() => string | Readonly<Uint8Array>) | (() => Promise<string | Readonly<Uint8Array>>)>; /** * 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(): string | null; /** * Get plist CFBundleIdentifier value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleIdentifier(): string | null; /** * Get plist CFBundleShortVersionString value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleShortVersionString(): string | null; /** * Get plist CFBundleGetInfoString value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleGetInfoString(): string | null; /** * Get plist NSHumanReadableCopyright value. * * @returns The value or null if excluded. */ protected _getPlistNSHumanReadableCopyright(): string | null; /** * Get plist CFBundleIconFile value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleIconFile(): string | null; /** * Get plist CFBundleLocalizations value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleLocalizations(): string[] | null; /** * Get plist NSHighResolutionCapable value. * * @returns The value or null if excluded. */ protected _getPlistNSHighResolutionCapable(): boolean | null; /** * Get plist NSAppTransportSecurity value. * * @returns The value or null if excluded. */ protected _getPlistNSAppTransportSecurity(): Map<string, boolean> | null; /** * Get plist CFBundleDocumentTypes value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleDocumentTypes(): Map<string, string | string[]>[] | null; /** * Get plist CFBundleAllowMixedLocalizations value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleAllowMixedLocalizations(): boolean | null; /** * Get plist CFBundlePackageType value. * * @returns The value or null if excluded. */ protected _getPlistCFBundlePackageType(): string | null; /** * Get plist CFBundleInfoDictionaryVersion value. * * @returns The value or null if excluded. */ protected _getPlistCFBundleInfoDictionaryVersion(): string | null; /** * Get plist LSMinimumSystemVersion value. * * @returns The value or null if excluded. */ protected _getPlistLSMinimumSystemVersion(): string | null; /** * Get plist LSRequiresCarbon value. * * @returns The value or null if excluded. */ protected _getPlistLSRequiresCarbon(): boolean | null; /** * Open implementation. */ protected _open(): 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<Uint8Array>, 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 XML string. * * @returns XML string. */ protected _generateInfoPlist(): Promise<string>; /** * 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; }