mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[@types/ignore-walk] Fix return type of walk and walk.sync (#39190)
This commit is contained in:
parent
5018a8e150
commit
4bc49b8a36
@ -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/'));
|
||||
|
||||
4
types/ignore-walk/index.d.ts
vendored
4
types/ignore-walk/index.d.ts
vendored
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user