export declare type JSONValue = boolean | number | string | null | JSONArray | JSONObject; export interface JSONArray extends Array { } export interface JSONObject { [key: string]: JSONValue | undefined; } declare type Defined = T extends undefined ? never : T; declare type Options = { badJsonDefault?: TJSONObject; jsonParseErrorDefault?: TJSONObject; cantReadFileDefault?: TJSONObject; ensureDir?: boolean; default?: TJSONObject; json5?: boolean; space?: number; addNewLineAtEOF?: boolean; }; /** * The JsonFile class represents the contents of json file. * * It's polymorphic on "JSONObject", which is a simple type representing * and object with string keys and either objects or primitive types as values. * @type {[type]} */ export default class JsonFile { file: string; options: Options; static read: typeof read; static readAsync: typeof readAsync; static parseJsonString: typeof parseJsonString; static writeAsync: typeof writeAsync; static getAsync: typeof getAsync; static setAsync: typeof setAsync; static mergeAsync: typeof mergeAsync; static deleteKeyAsync: typeof deleteKeyAsync; static deleteKeysAsync: typeof deleteKeysAsync; static rewriteAsync: typeof rewriteAsync; constructor(file: string, options?: Options); read(options?: Options): TJSONObject; readAsync(options?: Options): Promise; writeAsync(object: TJSONObject, options?: Options): Promise; parseJsonString(json: string, options?: Options): TJSONObject; getAsync(key: K, defaultValue: TDefault, options?: Options): Promise | TDefault>; setAsync(key: string, value: unknown, options?: Options): Promise; mergeAsync(sources: Partial | Partial[], options?: Options): Promise; deleteKeyAsync(key: string, options?: Options): Promise; deleteKeysAsync(keys: string[], options?: Options): Promise; rewriteAsync(options?: Options): Promise; _getOptions(options?: Options): Options; } declare function read(file: string, options?: Options): TJSONObject; declare function readAsync(file: string, options?: Options): Promise; declare function parseJsonString(json: string, options?: Options, fileName?: string): TJSONObject; declare function getAsync(file: string, key: K, defaultValue: DefaultValue, options?: Options): Promise; declare function writeAsync(file: string, object: TJSONObject, options?: Options): Promise; declare function setAsync(file: string, key: string, value: unknown, options?: Options): Promise; declare function mergeAsync(file: string, sources: Partial | Partial[], options?: Options): Promise; declare function deleteKeyAsync(file: string, key: string, options?: Options): Promise; declare function deleteKeysAsync(file: string, keys: string[], options?: Options): Promise; declare function rewriteAsync(file: string, options?: Options): Promise; export {};