@shockpkg/ria-packager
Version:
Package for creating Adobe AIR packages
188 lines (187 loc) • 5.48 kB
TypeScript
import { IPackagerResourceOptions } from '../../packager.ts';
import { IIcon, PackagerBundle } from '../bundle.ts';
/**
* PackagerBundleWindows object.
*/
export declare class PackagerBundleWindows extends PackagerBundle {
/**
* Create modern application icon resource.
* Enables higher resolution 256x256 icon with PNG compression.
* Higher resolutions resized with lanczos from 512x512 or 1024x1024.
* Default false uses the legacy formats of the official packager.
*/
applicationIconModern: boolean;
/**
* Create modern document type icon resource.
* Enables higher resolution 256x256 icon with PNG compression.
* Higher resolutions resized with lanczos from 512x512 or 1024x1024.
* Default false uses the legacy formats of the official packager.
*/
fileTypeIconModern: boolean;
/**
* Remove unnecessary helper files from framework.
* The official packages will include these.
*/
frameworkCleanHelpers: boolean;
/**
* Optionally preserve resource mtime.
* The official packager does not preserve resource mtimes.
*/
preserveResourceMtime: boolean;
/**
* Optionally use specific architecture.
*/
architecture: 'x86' | 'x64' | null;
/**
* Version strings.
*
* @default null
*/
fileVersion: string | null;
/**
* Product version.
*
* @default null
*/
productVersion: string | null;
/**
* Version strings.
*
* @default null
*/
versionStrings: {
[key: string]: string;
} | null;
/**
* PackagerBundleWindows constructor.
*
* @param path Output path.
*/
constructor(path: 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 all version strings, if any.
*
* @returns Verion strings.
*/
getVersionStrings(): {
[key: string]: string;
} | null;
/**
* Get file mode value.
*
* @param executable Is the entry executable.
* @returns File mode.
*/
protected _getFileMode(executable: boolean): 484 | 420;
/**
* 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;
/**
* Get the configured architecture.
* Prefers the architecture option, descriptor file, then default of x86.
*
* @returns Architecture string.
*/
protected _getArchitecture(): "x64" | "x86";
/**
* Get the main app binary data modifier function if any.
*
* @returns Modifier function or null.
*/
protected _getAppBinaryModifier(): Promise<((data: Uint8Array) => Promise<Uint8Array<ArrayBuffer>>) | null>;
/**
* Parse PE version string to integers (MS then LS bits) or null.
*
* @param version Version string.
* @returns Version integers ([MS, LS]) or null.
*/
protected _peVersionInts(version: string): [number, number] | null;
/**
* 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;
/**
* Encode the application icon if specified.
*
* @returns Encoded icon.
*/
protected _encodeApplicationIcon(): Promise<Uint8Array<ArrayBufferLike> | null>;
/**
* Encode file type icons.
* Avoids writting duplicate icons where the file/data is the same.
*
* @returns Encoded icons.
*/
protected _encodeFileTypeIcons(): Promise<Uint8Array<ArrayBufferLike>[] | null>;
/**
* Encode icon matching official format.
*
* @param icon Icon info.
* @returns Encoded icon.
*/
protected _encodeIconReference(icon: Readonly<IIcon>): Promise<Uint8Array<ArrayBufferLike>>;
/**
* Encode icon using modern format.
*
* @param icon Icon info.
* @returns Encoded icon.
*/
protected _encodeIconModern(icon: Readonly<IIcon>): Promise<Uint8Array<ArrayBufferLike>>;
/**
* Get 256x256 icon data from icon set.
* Unfortuantely the icon set does not support this icon size.
* This functions will resize a larger icon instead.
* Uses the lanczos algorithm to resize icon down.
*
* @param icon Icon info.
* @returns Encoded icon or null.
*/
protected _getIcon256x256Data(icon: Readonly<IIcon>): Promise<Uint8Array<ArrayBufferLike> | null>;
}