UNPKG

@appium/support

Version:

Support libs used across Appium packages

50 lines 2.05 kB
/** * Parses a file in xml or binary format of plist * * @param plist - The plist file path * @param mustExist - If set to false, this method will return an empty object when the file doesn't exist * @param quiet - If set to false, the plist path will be logged in debug level * @returns Parsed plist as a JS object */ export declare function parsePlistFile(plist: string, mustExist?: boolean, quiet?: boolean): Promise<object>; /** * Updates a plist file with the given fields * * @param plist - The plist file path * @param updatedFields - The updated fields-value pairs * @param binary - If set to false, the file will be created as a xml plist * @param mustExist - If set to false, this method will update an empty plist * @param quiet - If set to false, the plist path will be logged in debug level */ export declare function updatePlistFile(plist: string, updatedFields: object, binary?: boolean, mustExist?: boolean, quiet?: boolean): Promise<void>; /** * Creates a binary plist Buffer from an object * * @param data - The object to be turned into a binary plist * @returns Plist in the form of a binary buffer */ export declare function createBinaryPlist(data: object): Buffer; /** * Parses a Buffer into an Object * * @param data - The buffer of a binary plist * @returns Array of parsed root objects (typically one element) */ export declare function parseBinaryPlist(data: Buffer): object[]; /** * Creates a plist from an object * * @param object - The JS object to be turned into a plist * @param binary - Set it to true for a binary plist * @returns A buffer or a string depending on the binary parameter */ export declare function createPlist(object: object, binary?: boolean): Buffer | string; /** * Parses a buffer or string into a JS object * * @param data - The plist as a string or Buffer * @returns Parsed plist as a JS object * @throws Will throw an error if the plist type is unknown */ export declare function parsePlist(data: string | Buffer): object; //# sourceMappingURL=plist.d.ts.map