From b1d624e14dfd0ade1dce4184ec87a2cc098b2605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Sat, 15 Feb 2020 09:57:40 +0100 Subject: [PATCH] fix(fs-extra): missing `createSymlink` Missed: - `createSymlink` - `createSymlinkSync` see: jprichardson/node-fs-extra#758 see: cucumber/cucumber-js#1286 Thanks! --- types/fs-extra/fs-extra-tests.ts | 4 ++++ types/fs-extra/index.d.ts | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index 025c0e0c55890a..4a4b44fedcd8f9 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -235,3 +235,7 @@ fs.mkdtemp("foo"); fs.copyFile("src", "dest").then(); fs.copyFile("src", "dest", fs.constants.COPYFILE_EXCL).then(); fs.copyFile("src", "dest", errorCallback); + +fs.createSymlink("src", "dest", "dir").then(); +fs.createSymlink("src", "dest", "file").then(); +fs.createSymlink("src", "dest", "dir", errorCallback); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 32bc2dcd76af2f..09a067b863b01b 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fs-extra 8.0 +// Type definitions for fs-extra 8.1 // Project: https://github.com/jprichardson/node-fs-extra // Definitions by: Alan Agius , // midknight41 , @@ -7,6 +7,7 @@ // Justin Rockwood , // Sang Dang , // Florian Keller +// Piotr Błażejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -35,6 +36,10 @@ export function createFile(file: string): Promise; export function createFile(file: string, callback: (err: Error) => void): void; export function createFileSync(file: string): void; +export function createSymlink(src: string, dest: string, type: SymlinkType): Promise; +export function createSymlink(src: string, dest: string, type: SymlinkType, callback?: (err: Error) => void): void; +export function createSymlinkSync(src: string, dest: string, type: SymlinkType): void; + export function ensureDir(path: string, options?: EnsureOptions | number): Promise; export function ensureDir(path: string, options?: EnsureOptions | number, callback?: (err: Error) => void): void; export function ensureDirSync(path: string, options?: EnsureOptions | number): void;