mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* [write-json-file] correct typings for indent and sortKeys options * [write-json-file] add tests for new typings
19 lines
790 B
TypeScript
19 lines
790 B
TypeScript
// Type definitions for write-json-file 2.2
|
|
// Project: https://github.com/sindresorhus/write-json-file
|
|
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare function writeJsonFile(filepath: string, data: any, options?: writeJsonFile.Options): Promise<void>;
|
|
declare namespace writeJsonFile {
|
|
type Replacer = (key: string, value: any) => void;
|
|
interface Options {
|
|
indent?: string | number | null;
|
|
detectIndent?: boolean;
|
|
sortKeys?: boolean | ((a: string, b: string) => number);
|
|
replacer?: Replacer | Array<number | string> | null;
|
|
mode?: number;
|
|
}
|
|
function sync(filepath: string, data: any, options?: Options): void;
|
|
}
|
|
export = writeJsonFile;
|