From 3c51c3be85bb0d1bdb87ea0d6632f1c256912f27 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 6 Oct 2019 21:37:45 +0200 Subject: build: Add some required modules for node --- node_modules/@mrmlnc/readdir-enhanced/types.d.ts | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 node_modules/@mrmlnc/readdir-enhanced/types.d.ts (limited to 'node_modules/@mrmlnc/readdir-enhanced/types.d.ts') diff --git a/node_modules/@mrmlnc/readdir-enhanced/types.d.ts b/node_modules/@mrmlnc/readdir-enhanced/types.d.ts new file mode 100644 index 0000000..2f4e622 --- /dev/null +++ b/node_modules/@mrmlnc/readdir-enhanced/types.d.ts @@ -0,0 +1,67 @@ +/// + +import fs = require('fs'); + +declare namespace re { + interface Entry extends fs.Stats { + path: string; + depth: number; + } + + type FilterFunction = (stat: Entry) => boolean; + type Callback = (err: NodeJS.ErrnoException, result: T) => void; + type CallbackString = Callback; + type CallbackEntry = Callback; + + interface FileSystem { + readdir?: (path: string, callback: Callback) => void; + lstat?: (path: string, callback: Callback) => void; + stat?: (path: string, callback: Callback) => void; + } + + interface Options { + filter?: string | RegExp | FilterFunction; + deep?: boolean | number | RegExp | FilterFunction; + sep?: string; + basePath?: string; + fs?: FileSystem; + } + + function stat(root: string, options?: Options): Promise; + function stat(root: string, callback: CallbackEntry): void; + function stat(root: string, options: Options, callback: CallbackEntry): void; + + function async(root: string, options?: Options): Promise; + function async(root: string, callback: CallbackString): void; + function async(root: string, options: Options, callback: CallbackString): void; + + function readdirAsyncStat(root: string, options?: Options): Promise; + function readdirAsyncStat(root: string, callback: CallbackEntry): void; + function readdirAsyncStat(root: string, options: Options, callback: CallbackEntry): void; + + namespace async { + function stat(root: string, options?: Options): Promise; + function stat(root: string, callback: CallbackEntry): void; + function stat(root: string, options: Options, callback: CallbackEntry): void; + } + + function stream(root: string, options?: Options): NodeJS.ReadableStream; + function readdirStreamStat(root: string, options?: Options): NodeJS.ReadableStream; + + namespace stream { + function stat(root: string, options?: Options): NodeJS.ReadableStream; + } + + function sync(root: string, options?: Options): string[]; + function readdirSyncStat(root: string, options?: Options): Entry[]; + + namespace sync { + function stat(root: string, options?: Options): Entry[]; + } +} + +declare function re(root: string, options?: re.Options): Promise; +declare function re(root: string, callback: re.CallbackString): void; +declare function re(root: string, options: re.Options, callback: re.CallbackString): void; + +export = re; -- cgit v1.2.3