mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
node: Fix missing CustomPromisify for fs.link. (#39675)
* node: Fix missing CustomPromisify for fs.link. * node: Fix missing CustomPromisify for fs.link. Backporting fix to node v8 - v11.
This commit is contained in:
committed by
Jesse Trinity
parent
f74064b512
commit
5fad4d66bc
2
types/node/fs.d.ts
vendored
2
types/node/fs.d.ts
vendored
@@ -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<void>;
|
||||
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<void>
|
||||
ln("abc", "def");
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
2
types/node/v10/fs.d.ts
vendored
2
types/node/v10/fs.d.ts
vendored
@@ -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<void>;
|
||||
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
types/node/v11/fs.d.ts
vendored
2
types/node/v11/fs.d.ts
vendored
@@ -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<void>;
|
||||
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
types/node/v8/base.d.ts
vendored
2
types/node/v8/base.d.ts
vendored
@@ -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<void>;
|
||||
export function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
types/node/v9/base.d.ts
vendored
2
types/node/v9/base.d.ts
vendored
@@ -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<void>;
|
||||
export function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user