diff --git a/types/node/fs.d.ts b/types/node/fs.d.ts index e9875a9237..ae0651487f 100644 --- a/types/node/fs.d.ts +++ b/types/node/fs.d.ts @@ -490,7 +490,7 @@ declare module "fs" { * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. */ - function link(existingPath: PathLike, newPath: PathLike): Promise; + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; } /** diff --git a/types/node/test/fs.ts b/types/node/test/fs.ts index 31ed761450..c45164fc4f 100644 --- a/types/node/test/fs.ts +++ b/types/node/test/fs.ts @@ -119,6 +119,10 @@ async function testPromisify() { const listDir: fs.Dirent[] = await rd('path', { withFileTypes: true }); const listDir2: Buffer[] = await rd('path', { withFileTypes: false, encoding: 'buffer' }); const listDir3: fs.Dirent[] = await rd('path', { encoding: 'utf8', withFileTypes: true }); + + const ln = util.promisify(fs.link); + // $ExpectType Promise + ln("abc", "def"); } { diff --git a/types/node/v10/fs.d.ts b/types/node/v10/fs.d.ts index a0e40b5f80..c55b5d2729 100644 --- a/types/node/v10/fs.d.ts +++ b/types/node/v10/fs.d.ts @@ -442,7 +442,7 @@ declare module "fs" { * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. */ - function link(existingPath: PathLike, newPath: PathLike): Promise; + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; } /** diff --git a/types/node/v11/fs.d.ts b/types/node/v11/fs.d.ts index f964fcb6f2..2bc621ed09 100644 --- a/types/node/v11/fs.d.ts +++ b/types/node/v11/fs.d.ts @@ -442,7 +442,7 @@ declare module "fs" { * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. */ - function link(existingPath: PathLike, newPath: PathLike): Promise; + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; } /** diff --git a/types/node/v8/base.d.ts b/types/node/v8/base.d.ts index 1886e6f1b9..25b4d35fea 100644 --- a/types/node/v8/base.d.ts +++ b/types/node/v8/base.d.ts @@ -3473,7 +3473,7 @@ declare module "fs" { * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function link(existingPath: PathLike, newPath: PathLike): Promise; + export function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; } /** diff --git a/types/node/v9/base.d.ts b/types/node/v9/base.d.ts index cd6ff2c534..07e1159f54 100644 --- a/types/node/v9/base.d.ts +++ b/types/node/v9/base.d.ts @@ -3877,7 +3877,7 @@ declare module "fs" { * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. */ - export function link(existingPath: PathLike, newPath: PathLike): Promise; + export function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; } /**