diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 80655ab5b8..32fc34d76d 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -75,10 +75,10 @@ fs.outputJSON(file, data, errorCallback); fs.outputJsonSync(file, data); fs.outputJSONSync(file, data); -fs.readJson(file, errorCallback); -fs.readJson(file, openOpts, errorCallback); -fs.readJSON(file, errorCallback); -fs.readJSON(file, openOpts, errorCallback); +fs.readJson(file, (error: Error, jsonObject: any) => {}); +fs.readJson(file, openOpts, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, openOpts, (error: Error, jsonObject: any) => {}); fs.readJsonSync(file, openOpts); fs.readJSONSync(file, openOpts); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index e4f800185f..b5cba7c083 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -65,10 +65,10 @@ declare module "fs-extra" { export function outputJsonSync(file: string, data: any): void; export function outputJSONSync(file: string, data: any): void; - export function readJson(file: string, callback?: (err: Error) => void): void; - export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; - export function readJSON(file: string, callback?: (err: Error) => void): void; - export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; + export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; export function readJsonSync(file: string, options?: OpenOptions): any; export function readJSONSync(file: string, options?: OpenOptions): any;