Skip to content

Commit

Permalink
fix: ts types again/
Browse files Browse the repository at this point in the history
  • Loading branch information
soldair committed Feb 7, 2019
1 parent 5ddefa4 commit fcb7509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test.ts
Expand Up @@ -33,7 +33,9 @@ f.splice(0)


walkdir.async("").then((s)=>s.splice(0))

walkdir.async("",{}).then((s)=>s.splice(0))

walkdir.async("",{return_object:true}).then((a)=>{
a[Object.keys(a)[0]].isDirectory()
})
Expand Down
4 changes: 2 additions & 2 deletions walkdir.d.ts
Expand Up @@ -175,11 +175,11 @@ declare namespace walkdir {

//always sync:true but otherwise the same as walkdir
export function sync(path:string,options:walkdir.WalkOptions&{return_object:true},eventListener?:walkdir.WalkEventListener):{[path:string]:Stats};
export function sync(path:string,options?:walkdir.WalkOptions&{return_object:false|undefined},eventListener?:walkdir.WalkEventListener):string[];
export function sync(path:string,options?:walkdir.WalkOptions&{return_object?:false},eventListener?:walkdir.WalkEventListener):string[];
export function sync(path:string,options?:walkdir.WalkOptions&{return_object?:boolean},eventListener?:walkdir.WalkEventListener):string[]|{[path:string]:Stats};

// always sync:false. a promise of whatever is the same as walkdir.
export function async(path:string,options:walkdir.WalkOptions&{return_object:true},eventListener?:walkdir.WalkEventListener):Promise<{[path:string]:Stats}>;
export function async(path:string,options?:walkdir.WalkOptions&{return_object:false},eventListener?:walkdir.WalkEventListener):Promise<string[]>;
export function async(path:string,options?:walkdir.WalkOptions&{return_object?:false},eventListener?:walkdir.WalkEventListener):Promise<string[]>;
export function async(path:string,options?:walkdir.WalkOptions&{return_object?:boolean},eventListener?:walkdir.WalkEventListener):Promise<string[]>|Promise<{[path:string]:Stats}>;
}

0 comments on commit fcb7509

Please sign in to comment.