[@types/ignore-walk] Fix return type of walk and walk.sync (#39190)

This commit is contained in:
Matthew Peveler 2019-10-16 21:29:53 +02:00 committed by Andrew Branch
parent 5018a8e150
commit 4bc49b8a36
2 changed files with 5 additions and 3 deletions

View File

@ -7,11 +7,13 @@ walk({
});
walk().then((results) => {
console.log(results[0]);
console.log(results);
});
walk.sync({path: '/path/to/file'});
walk.sync();
const results = walk.sync();
console.log(results[0]);
const walker = new walk.WalkerSync();
console.log((walker.start().result as string[]).filter(entry => entry.substring(0, 5) !== '.git/'));

View File

@ -8,9 +8,9 @@
import { EventEmitter } from 'events';
import { Stats } from 'fs';
declare function walk(options?: walk.WalkerOptions, callback?: (results: Set<string>) => void): Promise<Set<string>>;
declare function walk(options?: walk.WalkerOptions, callback?: (results: string[]) => void): Promise<string[]>;
declare namespace walk {
function sync(options?: WalkerOptions): WalkerSync;
function sync(options?: WalkerOptions): string[];
interface WalkerOptions {
path?: string;