From fcb750934fbc7121170d168bc13c265ad1c3aadd Mon Sep 17 00:00:00 2001 From: Ryan Day Date: Thu, 7 Feb 2019 15:14:39 -0800 Subject: [PATCH] fix: ts types again/ --- test.ts | 2 ++ walkdir.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test.ts b/test.ts index 980966f..bf643e5 100644 --- a/test.ts +++ b/test.ts @@ -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() }) diff --git a/walkdir.d.ts b/walkdir.d.ts index 314cb67..1c04f38 100644 --- a/walkdir.d.ts +++ b/walkdir.d.ts @@ -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; + export function async(path:string,options?:walkdir.WalkOptions&{return_object?:false},eventListener?:walkdir.WalkEventListener):Promise; export function async(path:string,options?:walkdir.WalkOptions&{return_object?:boolean},eventListener?:walkdir.WalkEventListener):Promise|Promise<{[path:string]:Stats}>; }