DefinitelyTyped/types/recursive-readdir/recursive-readdir-tests.ts
Micah Zoltu 1eca915e24 Fixes definitions to match reality. (#19800)
Return type on ignore function was missing and Promise return type was missing from overloads that didn't take a callback.  Also extracts out a helper type definitions and provides slightly better variable naming for the transient `recursiveReadDir`.
2017-09-26 10:53:30 -07:00

14 lines
376 B
TypeScript

import * as fs from "fs";
import recursiveReaddir = require("recursive-readdir");
recursiveReaddir("some/path", (err, files) => {});
recursiveReaddir("some/path", ["foo.cs", "*.html"], (err, files) => {});
function apple(a: string, b: fs.Stats): boolean {
return true;
}
async function banana(): Promise<string[]> {
return recursiveReaddir("some/path", [apple]);
}