From c4d5b01acfe0cac31f94743a57e8e619178ba563 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 25 Aug 2020 09:43:54 +1000 Subject: feat: update to TypeScript 4.0 (#6514) --- std/node/_fs/_fs_access.ts | 6 +++--- std/node/_fs/_fs_common.ts | 8 +++++++- std/node/_fs/_fs_dir.ts | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'std/node/_fs') 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 { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + read(callback?: (...args: any[]) => void): Promise { 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 { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + close(callback?: (...args: any[]) => void): Promise { return new Promise((resolve, reject) => { try { if (callback) { -- cgit v1.2.3