diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-08-25 09:43:54 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 19:43:54 -0400 |
commit | c4d5b01acfe0cac31f94743a57e8e619178ba563 (patch) | |
tree | 1987fe2e23c4db59a44159f4c7d21ecc61be4ad3 /std/node/_fs | |
parent | 9b0f9c876529696c8008dda8b3606e34d3fe98dc (diff) |
feat: update to TypeScript 4.0 (#6514)
Diffstat (limited to 'std/node/_fs')
-rw-r--r-- | std/node/_fs/_fs_access.ts | 6 | ||||
-rw-r--r-- | std/node/_fs/_fs_common.ts | 8 | ||||
-rw-r--r-- | std/node/_fs/_fs_dir.ts | 6 |
3 files changed, 14 insertions, 6 deletions
diff --git a/std/node/_fs/_fs_access.ts b/std/node/_fs/_fs_access.ts index df84eac9c..8fb8cc7e6 100644 --- a/std/node/_fs/_fs_access.ts +++ b/std/node/_fs/_fs_access.ts @@ -8,9 +8,9 @@ import { notImplemented } from "../_utils.ts"; //TODO - 'path' can also be a Buffer. Neither of these polyfills //is available yet. See https://github.com/denoland/deno/issues/3403 export function access( - path: string | URL, // eslint-disable-line @typescript-eslint/no-unused-vars - modeOrCallback: number | Function, // eslint-disable-line @typescript-eslint/no-unused-vars - callback?: CallbackWithError, // eslint-disable-line @typescript-eslint/no-unused-vars + _path: string | URL, + _modeOrCallback: number | ((...args: unknown[]) => void), + _callback?: CallbackWithError, ): void { notImplemented("Not yet available"); } diff --git a/std/node/_fs/_fs_common.ts b/std/node/_fs/_fs_common.ts index 165b9aeca..5d3f02a5d 100644 --- a/std/node/_fs/_fs_common.ts +++ b/std/node/_fs/_fs_common.ts @@ -47,7 +47,13 @@ export function isFileOptions( } export function getEncoding( - optOrCallback?: FileOptions | WriteFileOptions | Function | Encodings | null, + optOrCallback?: + | FileOptions + | WriteFileOptions + // eslint-disable-next-line @typescript-eslint/no-explicit-any + | ((...args: any[]) => any) + | Encodings + | null, ): Encodings | null { if (!optOrCallback || typeof optOrCallback === "function") { return null; diff --git a/std/node/_fs/_fs_dir.ts b/std/node/_fs/_fs_dir.ts index 7f2085b3b..20239d4f3 100644 --- a/std/node/_fs/_fs_dir.ts +++ b/std/node/_fs/_fs_dir.ts @@ -17,7 +17,8 @@ export default class Dir { return this.dirPath; } - read(callback?: Function): Promise<Dirent | null> { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + read(callback?: (...args: any[]) => void): Promise<Dirent | null> { return new Promise((resolve, reject) => { if (!this.asyncIterator) { this.asyncIterator = Deno.readDir(this.path)[Symbol.asyncIterator](); @@ -55,7 +56,8 @@ export default class Dir { * directories, and therefore does not need to close directories when * finished reading. */ - close(callback?: Function): Promise<void> { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + close(callback?: (...args: any[]) => void): Promise<void> { return new Promise((resolve, reject) => { try { if (callback) { |