UNPKG

appium-ios-simulator

Version:
52 lines 2.32 kB
/** * Serializes the given value to plist-compatible * XML representation, which is ready for further usage * with `defaults` command line tool arguments * * @param value The value to be serialized * @param serialize Whether to serialize the resulting * XML to string or to return raw HTMLElement instance * @returns Either string or raw node representation of * the given value * @throws {TypeError} If it is not known how to serialize the given value */ export declare function toXmlArg(value: any, serialize?: boolean): string | Element; /** * 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 valuesMap Preferences mapping * @param replace Whether to generate arguments that replace * complex typed values like arrays or dictionaries in the current plist or * update them (the default settings) * @returns Each item in the array * is the `defaults write <plist>` command suffix */ export declare function generateDefaultsCommandArgs(valuesMap: Record<string, any>, replace?: boolean): string[][]; export declare class NSUserDefaults { plist: string; constructor(plist: string); /** * Reads the content of the given plist file using plutil command line tool * and serializes it to a JSON representation * * @returns 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 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: Record<string, any>): Promise<void>; } //# sourceMappingURL=defaults-utils.d.ts.map