From d31294e091cc71b52dfcfc673ae38334107364fa Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 17 May 2017 22:57:47 +0200 Subject: [PATCH] feat(fs-extra): add `SymlinkType` --- types/fs-extra/fs-extra-tests.ts | 2 +- types/fs-extra/index.d.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index 9c43bbf64d..00b526783d 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -172,7 +172,7 @@ fs.ensureLink(path, path).then(() => { }); fs.ensureLink(path, path, errorCallback); fs.ensureLinkSync(path, path); -fs.ensureSymlink(path, path).then(() => { +fs.ensureSymlink(path, path, "file").then(() => { // stub }); fs.ensureSymlink(path, path, errorCallback); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index dbf4ac65a3..0fcbf9a509 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -83,8 +83,8 @@ export function ensureLink(src: string, dest: string): Promise; export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void; export function ensureLinkSync(src: string, dest: string): void; -export function ensureSymlink(src: string, dest: string, type?: string): Promise; -export function ensureSymlink(src: string, dest: string, type: string, callback: (err: Error) => void): void; +export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise; +export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void; export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void; export function ensureSymlinkSync(src: string, dest: string, type?: string): void; @@ -262,6 +262,8 @@ export type CopyFilterFunction = (src: string) => boolean; export type CopyFilter = CopyFilterFunction | RegExp; +export type SymlinkType = "dir" | "file"; + export interface CopyOptions { dereference?: boolean; overwrite?: boolean;