diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index dbe48cf971..9eab816f63 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -214,3 +214,7 @@ fs.writeFile("foo.txt", "i am foo", { encoding: "utf-8" }); // $ExpectType Promise fs.mkdtemp("foo"); + +fs.copyFile("src", "dest").then(); +fs.copyFile("src", "dest", fs.constants.COPYFILE_EXCL).then(); +fs.copyFile("src", "dest", errorCallback); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index c5eddbf416..c1b661daae 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -20,6 +20,10 @@ export function copy(src: string, dest: string, callback: (err: Error) => void): export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void; export function copySync(src: string, dest: string, options?: CopyOptionsSync): void; +export function copyFile(src: string, dest: string, flags?: number): Promise; +export function copyFile(src: string, dest: string, callback: (err: Error) => void): void; +export function copyFile(src: string, dest: string, flags: number, callback: (err: Error) => void): void; + export function move(src: string, dest: string, options?: MoveOptions): Promise; export function move(src: string, dest: string, callback: (err: Error) => void): void; export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;