@shockpkg/dir-projector
Version:
Package for creating Shockwave Director projectors
122 lines (121 loc) • 3.34 kB
TypeScript
/// <reference types="node" />
import { Plist, Value, ValueDict } from '@shockpkg/plist-dom';
export interface IMachoType {
/**
* CPU type.
*/
cpuType: number;
/**
* CPU subtype.
*/
cpuSubtype: number;
}
/**
* Parse plist data.
* Currently only supports XML plist.
*
* @param data Plist XML.
* @returns Plist document.
*/
export declare function plistParse(data: string): Promise<Plist>;
/**
* Read plist file.
* Currently only supports XML plist.
*
* @param path Plist file.
* @returns Plist document.
*/
export declare function plistRead(path: string): Promise<Plist>;
/**
* Get Info.plist dictionary or throw.
*
* @param plist Plist document.
* @returns Dictionary object.
*/
export declare function infoPlistDict(plist: Plist): ValueDict;
/**
* Get Info.plist dictionary value or throw.
*
* @param plist Plist document.
* @param key Dictionary key.
* @returns Value object.
*/
export declare function infoPlistDictGetValue(plist: Plist, key: string): Value;
/**
* Set Info.plist dictionary value or throw.
*
* @param plist Plist document.
* @param key Dictionary key.
* @param value Value object.
*/
export declare function infoPlistDictSet(plist: Plist, key: string, value: Value | null): void;
/**
* Get Info.plist bundle executable.
*
* @param plist Plist document.
* @returns Executable name.
*/
export declare function infoPlistBundleExecutableGet(plist: Plist): string;
/**
* Set Info.plist bundle executable.
*
* @param plist Plist document.
* @param value Executable name.
*/
export declare function infoPlistBundleExecutableSet(plist: Plist, value: string | null): void;
/**
* Get Info.plist bundle icon.
*
* @param plist Plist document.
* @returns Icon name.
*/
export declare function infoPlistBundleIconFileGet(plist: Plist): string;
/**
* Set Info.plist bundle icon.
*
* @param plist Plist document.
* @param value Icon name.
*/
export declare function infoPlistBundleIconFileSet(plist: Plist, value: string | null): void;
/**
* Set Info.plist bundle name.
*
* @param plist Plist document.
* @param value Icon name.
*/
export declare function infoPlistBundleNameSet(plist: Plist, value: string | null): void;
/**
* Get types of Mach-O data, array if FAT binary, else a single object.
*
* @param data Mach-O data.
* @returns Mach-O types.
*/
export declare function machoTypesData(data: Readonly<Buffer>): IMachoType | IMachoType[];
/**
* Get types of Mach-O file, array if FAT binary, else a single object.
*
* @param path Mach-O file.
* @returns Mach-O types.
*/
export declare function machoTypesFile(path: string): Promise<IMachoType | IMachoType[]>;
/**
* Get Mach-O app launcher for a single type.
*
* @param type Mach-O type.
* @returns Launcher data.
*/
export declare function machoAppLauncherThin(type: Readonly<IMachoType>): Promise<Buffer>;
/**
* Get Mach-O app launcher for a type list.
*
* @param types Mach-O types.
* @returns Launcher data.
*/
export declare function machoAppLauncherFat(types: Readonly<Readonly<IMachoType>[]>): Promise<Buffer>;
/**
* Get Mach-O app launcher for a single or multiple types.
*
* @param types Mach-O types.
* @returns Launcher data.
*/
export declare function machoAppLauncher(types: Readonly<IMachoType> | Readonly<Readonly<IMachoType>[]>): Promise<Buffer>;