UNPKG

appium-ios-simulator

Version:
53 lines 2.45 kB
/** * Serializes the given value to plist-compatible * XML representation, which is ready for further usage * with `defaults` command line tool arguments * * @param {any} value The value to be serialized * @param {boolean} serialize [true] Whether to serialize the resulting * XML to string or to return raw HTMLElement instance * @returns {xmlDomElement|string} Either string or raw node representation of * the given value * @throws {TypeError} If it is not known how to serialize the given value */ export function toXmlArg(value: any, serialize?: boolean): xmlDomElement | string; /** * Generates command line args for the `defaults` * command line utility based on the given preference values mapping. * See https://shadowfile.inode.link/blog/2018/06/advanced-defaults1-usage/ * for more details. * * @param {Object} valuesMap Preferences mapping * @param {Boolean} replace [false] Whether to generate arguments that replace * complex typed values like arrays or dictionaries in the current plist or * update them (the default settings) * @returns {string[][]} Each item in the array * is the `defaults write <plist>` command suffix */ export function generateDefaultsCommandArgs(valuesMap: any, replace?: boolean): string[][]; export class NSUserDefaults { constructor(plist: any); plist: any; /** * Reads the content of the given plist file using plutil command line tool * and serializes it to a JSON representation * * @returns {Promise<Record<string, any>>} The serialized plist content * @throws {Error} If there was an error during serialization */ asJson(): Promise<Record<string, any>>; /** * Updates the content of the given plist file. * If the plist does not exist yet then it is going to be created. * * @param {Object} valuesMap Mapping of preference values to update. * If any of item values are of dictionary type then only the first level dictionary gets * updated. Everything below this level will be replaced. This is the known limitation * of the `defaults` command line tool. A workaround for it would be to read the current * preferences mapping first and merge it with this value. * @throws {Error} If there was an error while updating the plist */ update(valuesMap: any): Promise<void>; } export type xmlDomElement = import("@xmldom/xmldom").Element; //# sourceMappingURL=defaults-utils.d.ts.map