@types/fs-extra
Advanced tools
Comparing version 9.0.11 to 9.0.13
@@ -17,7 +17,7 @@ // Type definitions for fs-extra 9.0 | ||
import * as fs from "fs"; | ||
import * as fs from 'fs'; | ||
import Stats = fs.Stats; | ||
import PathLike = fs.PathLike; | ||
export * from "fs"; | ||
export * from 'fs'; | ||
@@ -58,16 +58,33 @@ export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>; | ||
export function outputFile(file: string, data: any, options?: WriteFileOptions | string): Promise<void>; | ||
export function outputFile( | ||
file: string, | ||
data: any, | ||
options?: WriteFileOptions | BufferEncoding | string, | ||
): Promise<void>; | ||
export function outputFile(file: string, data: any, callback: (err: Error) => void): void; | ||
export function outputFile(file: string, data: any, options: WriteFileOptions | string, callback: (err: Error) => void): void; | ||
export function outputFileSync(file: string, data: any, options?: WriteFileOptions | string): void; | ||
export function outputFile( | ||
file: string, | ||
data: any, | ||
options: WriteFileOptions | string, | ||
callback: (err: Error) => void, | ||
): void; | ||
export function outputFileSync(file: string, data: any, options?: WriteFileOptions | BufferEncoding | string): void; | ||
export function readJson(file: string, options?: ReadOptions): Promise<any>; | ||
export function readJson(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>; | ||
export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; | ||
export function readJson(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void; | ||
export function readJSON(file: string, options?: ReadOptions): Promise<any>; | ||
export function readJson( | ||
file: string, | ||
options: ReadOptions | BufferEncoding | string, | ||
callback: (err: Error, jsonObject: any) => void, | ||
): void; | ||
export function readJSON(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>; | ||
export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; | ||
export function readJSON(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void; | ||
export function readJSON( | ||
file: string, | ||
options: ReadOptions | BufferEncoding | string, | ||
callback: (err: Error, jsonObject: any) => void, | ||
): void; | ||
export function readJsonSync(file: string, options?: ReadOptions): any; | ||
export function readJSONSync(file: string, options?: ReadOptions): any; | ||
export function readJsonSync(file: string, options?: ReadOptions | BufferEncoding | string): any; | ||
export function readJSONSync(file: string, options?: ReadOptions | BufferEncoding | string): any; | ||
@@ -78,20 +95,40 @@ export function remove(dir: string, callback: (err: Error) => void): void; | ||
export function outputJSON(file: string, data: any, options?: WriteOptions): Promise<void>; | ||
export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void; | ||
export function outputJSON(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>; | ||
export function outputJSON( | ||
file: string, | ||
data: any, | ||
options: WriteOptions | BufferEncoding | string, | ||
callback: (err: Error) => void, | ||
): void; | ||
export function outputJSON(file: string, data: any, callback: (err: Error) => void): void; | ||
export function outputJson(file: string, data: any, options?: WriteOptions): Promise<void>; | ||
export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void; | ||
export function outputJson(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>; | ||
export function outputJson( | ||
file: string, | ||
data: any, | ||
options: WriteOptions | BufferEncoding | string, | ||
callback: (err: Error) => void, | ||
): void; | ||
export function outputJson(file: string, data: any, callback: (err: Error) => void): void; | ||
export function outputJsonSync(file: string, data: any, options?: WriteOptions): void; | ||
export function outputJSONSync(file: string, data: any, options?: WriteOptions): void; | ||
export function outputJsonSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void; | ||
export function outputJSONSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void; | ||
export function writeJSON(file: string, object: any, options?: WriteOptions): Promise<void>; | ||
export function writeJSON(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>; | ||
export function writeJSON(file: string, object: any, callback: (err: Error) => void): void; | ||
export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void; | ||
export function writeJson(file: string, object: any, options?: WriteOptions): Promise<void>; | ||
export function writeJSON( | ||
file: string, | ||
object: any, | ||
options: WriteOptions | BufferEncoding | string, | ||
callback: (err: Error) => void, | ||
): void; | ||
export function writeJson(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>; | ||
export function writeJson(file: string, object: any, callback: (err: Error) => void): void; | ||
export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void; | ||
export function writeJson( | ||
file: string, | ||
object: any, | ||
options: WriteOptions | BufferEncoding | string, | ||
callback: (err: Error) => void, | ||
): void; | ||
export function writeJsonSync(file: string, object: any, options?: WriteOptions): void; | ||
export function writeJSONSync(file: string, object: any, options?: WriteOptions): void; | ||
export function writeJsonSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void; | ||
export function writeJSONSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void; | ||
@@ -133,6 +170,25 @@ export function ensureFile(path: string): Promise<void>; | ||
export function appendFile(file: PathLike | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; }, | ||
callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function appendFile( | ||
file: PathLike | number, | ||
data: any, | ||
options: { | ||
encoding?: BufferEncoding | string | undefined; | ||
mode?: number | string | undefined; | ||
flag?: string | undefined; | ||
}, | ||
callback: (err: NodeJS.ErrnoException) => void, | ||
): void; | ||
export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function appendFile(file: PathLike | number, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): Promise<void>; | ||
export function appendFile( | ||
file: PathLike | number, | ||
data: any, | ||
options?: | ||
| { | ||
encoding?: BufferEncoding | string | undefined; | ||
mode?: number | string | undefined; | ||
flag?: string | undefined; | ||
} | ||
| BufferEncoding | ||
| string, | ||
): Promise<void>; | ||
@@ -192,8 +248,21 @@ export function chmod(path: PathLike, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void; | ||
*/ | ||
export function mkdir(path: PathLike, options: Mode | fs.MakeDirectoryOptions | null, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function mkdir( | ||
path: PathLike, | ||
options: Mode | fs.MakeDirectoryOptions | null, | ||
callback: (err: NodeJS.ErrnoException) => void, | ||
): void; | ||
export function mkdir(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): Promise<void>; | ||
export function mkdirSync(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): void; | ||
export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; | ||
export function open(path: PathLike, flags: string | number, mode: Mode, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; | ||
export function open( | ||
path: PathLike, | ||
flags: string | number, | ||
callback: (err: NodeJS.ErrnoException, fd: number) => void, | ||
): void; | ||
export function open( | ||
path: PathLike, | ||
flags: string | number, | ||
mode: Mode, | ||
callback: (err: NodeJS.ErrnoException, fd: number) => void, | ||
): void; | ||
export function open(path: PathLike, flags: string | number, mode?: Mode | null): Promise<number>; | ||
@@ -209,19 +278,58 @@ | ||
export function read<TBuffer extends ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, | ||
callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void; | ||
export function read<TBuffer extends ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; | ||
export function read<TBuffer extends ArrayBufferView>( | ||
fd: number, | ||
buffer: TBuffer, | ||
offset: number, | ||
length: number, | ||
position: number | null, | ||
callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void, | ||
): void; | ||
export function read<TBuffer extends ArrayBufferView>( | ||
fd: number, | ||
buffer: TBuffer, | ||
offset: number, | ||
length: number, | ||
position: number | null, | ||
): Promise<{ bytesRead: number; buffer: TBuffer }>; | ||
export function readFile(file: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; | ||
export function readFile(file: PathLike | number, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; | ||
export function readFile(file: PathLike | number, options: { flag?: string; } | { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; | ||
export function readFile(file: PathLike | number, options: { flag?: string; } | { encoding: string; flag?: string; }): Promise<string>; | ||
export function readFile( | ||
file: PathLike | number, | ||
encoding: BufferEncoding | string, | ||
callback: (err: NodeJS.ErrnoException, data: string) => void, | ||
): void; | ||
export function readFile( | ||
file: PathLike | number, | ||
options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined }, | ||
callback: (err: NodeJS.ErrnoException, data: Buffer) => void, | ||
): void; | ||
export function readFile( | ||
file: PathLike | number, | ||
options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined }, | ||
): Promise<string>; | ||
// tslint:disable-next-line:unified-signatures | ||
export function readFile(file: PathLike | number, encoding: string): Promise<string>; | ||
export function readFile(file: PathLike | number, encoding: BufferEncoding | string): Promise<string>; | ||
export function readFile(file: PathLike | number): Promise<Buffer>; | ||
export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; | ||
export function readdir(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise<string[]>; | ||
export function readdir(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise<Buffer[]>; | ||
export function readdir(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false }): Promise<string[] | Buffer[]>; | ||
export function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<fs.Dirent[]>; | ||
export function readdir( | ||
path: PathLike, | ||
options: 'buffer' | { encoding: 'buffer'; withFileTypes?: false | undefined }, | ||
): Promise<Buffer[]>; | ||
export function readdir( | ||
path: PathLike, | ||
options?: | ||
| { encoding: BufferEncoding | string | null; withFileTypes?: false | undefined } | ||
| BufferEncoding | ||
| string | ||
| null, | ||
): Promise<string[]>; | ||
export function readdir( | ||
path: PathLike, | ||
options?: { encoding?: BufferEncoding | string | null | undefined; withFileTypes?: false | undefined }, | ||
): Promise<string[] | Buffer[]>; | ||
export function readdir( | ||
path: PathLike, | ||
options: { encoding?: BufferEncoding | string | null | undefined; withFileTypes: true }, | ||
): Promise<fs.Dirent[]>; | ||
@@ -232,3 +340,7 @@ export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void; | ||
export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; | ||
export function realpath(path: PathLike, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; | ||
export function realpath( | ||
path: PathLike, | ||
cache: { [path: string]: string }, | ||
callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any, | ||
): void; | ||
export function realpath(path: PathLike, cache?: { [path: string]: string }): Promise<string>; | ||
@@ -239,5 +351,10 @@ | ||
const native: { | ||
(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null): Promise<string>; | ||
(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>; | ||
(path: PathLike, options: { encoding: BufferEncoding | null } | string | undefined | null): Promise<string | Buffer>; | ||
(path: PathLike, options: { encoding: 'buffer' } | 'buffer'): Promise<Buffer>; | ||
( | ||
path: PathLike, | ||
options: { encoding: BufferEncoding | string | null } | BufferEncoding | string | undefined | null, | ||
): Promise<string>; | ||
(path: PathLike, options: { encoding: BufferEncoding | string | null } | string | undefined | null): Promise< | ||
string | Buffer | ||
>; | ||
(path: PathLike): Promise<string>; | ||
@@ -257,3 +374,11 @@ } & typeof fs.realpath.native; | ||
*/ | ||
export function rm(path: PathLike, options?: { force?: boolean, maxRetries?: number, recursive?: boolean, retryDelay?: number }): Promise<void>; | ||
export function rm( | ||
path: PathLike, | ||
options?: { | ||
force?: boolean | undefined; | ||
maxRetries?: number | undefined; | ||
recursive?: boolean | undefined; | ||
retryDelay?: number | undefined; | ||
}, | ||
): Promise<void>; | ||
@@ -271,3 +396,8 @@ /** | ||
export function symlink(target: PathLike, path: PathLike, type: SymlinkType | undefined, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function symlink( | ||
target: PathLike, | ||
path: PathLike, | ||
type: SymlinkType | undefined, | ||
callback: (err: NodeJS.ErrnoException) => void, | ||
): void; | ||
export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; | ||
@@ -288,3 +418,8 @@ export function symlink(target: PathLike, path: PathLike, type?: SymlinkType): Promise<void>; | ||
export function utimes(path: PathLike, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function utimes( | ||
path: PathLike, | ||
atime: number, | ||
mtime: number, | ||
callback: (err: NodeJS.ErrnoException) => void, | ||
): void; | ||
export function utimes(path: PathLike, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void; | ||
@@ -295,21 +430,72 @@ export function utimes(path: PathLike, atime: number, mtime: number): Promise<void>; | ||
export function write<TBuffer extends ArrayBufferView>( | ||
fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, | ||
callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void | ||
fd: number, | ||
buffer: TBuffer, | ||
offset: number, | ||
length: number, | ||
position: number | null, | ||
callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void, | ||
): void; | ||
export function write<TBuffer extends ArrayBufferView>( | ||
fd: number, buffer: TBuffer, offset: number, length: number, | ||
callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void | ||
fd: number, | ||
buffer: TBuffer, | ||
offset: number, | ||
length: number, | ||
callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void, | ||
): void; | ||
export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; | ||
export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; | ||
export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; | ||
export function write<TBuffer extends ArrayBufferView>(fd: number, buffer: TBuffer, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; | ||
export function write(fd: number, data: any, offset?: number, encoding?: string): Promise<{ bytesWritten: number, buffer: string }>; | ||
export function write( | ||
fd: number, | ||
data: any, | ||
callback: (err: NodeJS.ErrnoException, written: number, str: string) => void, | ||
): void; | ||
export function write( | ||
fd: number, | ||
data: any, | ||
offset: number, | ||
callback: (err: NodeJS.ErrnoException, written: number, str: string) => void, | ||
): void; | ||
export function write( | ||
fd: number, | ||
data: any, | ||
offset: number, | ||
encoding: BufferEncoding | string, | ||
callback: (err: NodeJS.ErrnoException, written: number, str: string) => void, | ||
): void; | ||
export function write<TBuffer extends ArrayBufferView>( | ||
fd: number, | ||
buffer: TBuffer, | ||
offset?: number, | ||
length?: number, | ||
position?: number | null, | ||
): Promise<{ bytesWritten: number; buffer: TBuffer }>; | ||
export function write( | ||
fd: number, | ||
data: any, | ||
offset?: number, | ||
encoding?: BufferEncoding | string, | ||
): Promise<{ bytesWritten: number; buffer: string }>; | ||
export function writeFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function writeFile(file: PathLike | number, data: any, options?: WriteFileOptions | string): Promise<void>; | ||
export function writeFile(file: PathLike | number, data: any, options: WriteFileOptions | string, callback: (err: NodeJS.ErrnoException) => void): void; | ||
export function writeFile( | ||
file: PathLike | number, | ||
data: any, | ||
options?: WriteFileOptions | BufferEncoding | string, | ||
): Promise<void>; | ||
export function writeFile( | ||
file: PathLike | number, | ||
data: any, | ||
options: WriteFileOptions | BufferEncoding | string, | ||
callback: (err: NodeJS.ErrnoException) => void, | ||
): void; | ||
export function writev(fd: number, buffers: NodeJS.ArrayBufferView[], position: number, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; | ||
export function writev(fd: number, buffers: NodeJS.ArrayBufferView[], cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; | ||
export function writev( | ||
fd: number, | ||
buffers: NodeJS.ArrayBufferView[], | ||
position: number, | ||
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, | ||
): void; | ||
export function writev( | ||
fd: number, | ||
buffers: NodeJS.ArrayBufferView[], | ||
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, | ||
): void; | ||
export function writev(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WritevResult>; | ||
@@ -337,3 +523,3 @@ | ||
export type SymlinkType = "dir" | "file" | "junction"; | ||
export type SymlinkType = 'dir' | 'file' | 'junction'; | ||
@@ -345,42 +531,42 @@ export type Mode = string | number; | ||
export interface CopyOptions { | ||
dereference?: boolean; | ||
overwrite?: boolean; | ||
preserveTimestamps?: boolean; | ||
errorOnExist?: boolean; | ||
filter?: CopyFilterSync | CopyFilterAsync; | ||
recursive?: boolean; | ||
dereference?: boolean | undefined; | ||
overwrite?: boolean | undefined; | ||
preserveTimestamps?: boolean | undefined; | ||
errorOnExist?: boolean | undefined; | ||
filter?: CopyFilterSync | CopyFilterAsync | undefined; | ||
recursive?: boolean | undefined; | ||
} | ||
export interface CopyOptionsSync extends CopyOptions { | ||
filter?: CopyFilterSync; | ||
filter?: CopyFilterSync | undefined; | ||
} | ||
export interface EnsureOptions { | ||
mode?: number; | ||
mode?: number | undefined; | ||
} | ||
export interface MoveOptions { | ||
overwrite?: boolean; | ||
limit?: number; | ||
overwrite?: boolean | undefined; | ||
limit?: number | undefined; | ||
} | ||
export interface ReadOptions { | ||
throws?: boolean; | ||
fs?: object; | ||
throws?: boolean | undefined; | ||
fs?: object | undefined; | ||
reviver?: any; | ||
encoding?: string; | ||
flag?: string; | ||
encoding?: BufferEncoding | string | undefined; | ||
flag?: string | undefined; | ||
} | ||
export interface WriteFileOptions { | ||
encoding?: string | null; | ||
flag?: string; | ||
mode?: number; | ||
encoding?: BufferEncoding | string | null | undefined; | ||
flag?: string | undefined; | ||
mode?: number | undefined; | ||
} | ||
export interface WriteOptions extends WriteFileOptions { | ||
fs?: object; | ||
fs?: object | undefined; | ||
replacer?: any; | ||
spaces?: number | string; | ||
EOL?: string; | ||
spaces?: number | string | undefined; | ||
EOL?: string | undefined; | ||
} | ||
@@ -387,0 +573,0 @@ |
{ | ||
"name": "@types/fs-extra", | ||
"version": "9.0.11", | ||
"version": "9.0.13", | ||
"description": "TypeScript definitions for fs-extra", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra", | ||
"license": "MIT", | ||
@@ -64,4 +65,4 @@ "contributors": [ | ||
}, | ||
"typesPublisherContentHash": "b44e87db09159a4c0033f6262309f823638763ff2d3c0532123188abc622ad04", | ||
"typesPublisherContentHash": "75e10d16a18d936a50e54414024604aa9484e8345b37c2027921869f254523ee", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Mon, 12 Apr 2021 08:31:24 GMT | ||
* Last updated: Tue, 21 Sep 2021 19:02:14 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
27909
489
0