@@ -142,7 +142,7 @@ type DefsMapi = {
142142 root : ( ) => string ;
143143 info : ( msg : string , data : any = null ) => Promise < void > ;
144144 error : ( msg : string , data : any = null ) => Promise < void > ;
145- collect : ( option ?: { startTime ?: string ; endTime ?: string ; limit ?: number } ) => Promise < string > ;
145+ collect : ( option ?: { startTime ?: string ; endTime ?: string ; limit ?: number } ) => Promise < string > ;
146146 } ;
147147 storage : {
148148 all : ( ) => Promise < any > ;
@@ -161,19 +161,25 @@ type DefsMapi = {
161161 } ;
162162 file : {
163163 fullPath : ( path : string ) => Promise < string > ;
164- exists : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < boolean > ;
165- isDirectory : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < boolean > ;
166- mkdir : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
167- list : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any [ ] > ;
168- listAll : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any [ ] > ;
169- write : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
170- writeBuffer : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
171- writeStream : ( path : string , stream : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
172- read : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any > ;
173- readBuffer : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any > ;
174- readStream : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < ReadableStream | null > ;
175- deletes : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
176- clean : ( paths : string [ ] , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
164+ exists : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < boolean > ;
165+ isDirectory : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < boolean > ;
166+ mkdir : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
167+ list : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < {
168+ name : string ,
169+ pathname : string ,
170+ isDirectory : boolean ,
171+ size : number ,
172+ lastModified : number ,
173+ } [ ] > ;
174+ listAll : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any [ ] > ;
175+ write : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
176+ writeBuffer : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
177+ writeStream : ( path : string , stream : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
178+ read : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any > ;
179+ readBuffer : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < any > ;
180+ readStream : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < ReadableStream | null > ;
181+ deletes : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
182+ clean : ( paths : string [ ] , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
177183 rename : (
178184 pathOld : string ,
179185 pathNew : string ,
@@ -182,7 +188,7 @@ type DefsMapi = {
182188 overwrite ?: boolean ;
183189 }
184190 ) => Promise < void > ;
185- copy : ( pathOld : string , pathNew : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
191+ copy : ( pathOld : string , pathNew : string , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
186192 temp : ( ext : string = "tmp" , prefix : string = "file" , suffix : string = "" ) => Promise < string > ;
187193 tempDir : ( prefix : string = "dir" ) => Promise < string > ;
188194 watchText : (
@@ -195,7 +201,7 @@ type DefsMapi = {
195201 ) => Promise < {
196202 stop : Function ;
197203 } > ;
198- appendText : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
204+ appendText : ( path : string , data : any , option ?: { isDataPath ?: boolean } ) => Promise < void > ;
199205 download : (
200206 url : string ,
201207 path ?: string | null ,
@@ -215,9 +221,15 @@ type DefsMapi = {
215221 openDirectory : ( options : { } = { } ) => Promise < string | null > ;
216222 openSave : ( options : { } = { } ) => Promise < string | null > ;
217223 ext : ( path : string ) => Promise < string > ;
224+ stat : ( path : string , option ?: { isDataPath ?: boolean } ) => Promise < {
225+ size : number ;
226+ isDirectory : boolean ;
227+ lastModified : number ;
228+ } > ;
218229 textToName : ( text : string , ext : string = "" , maxLimit : number = 100 ) => string ;
219230 pathToName : ( path : string , includeExt : boolean = true , maxLimit : number = 100 ) => string ;
220231 hubRootDefault : ( ) => Promise < string > ;
232+ hubRoot : ( ) => Promise < string > ;
221233 hubSave : (
222234 file : string ,
223235 option ?: {
@@ -327,8 +339,8 @@ type DefsMapi = {
327339 } ;
328340 misc : {
329341 getZipFileContent : ( path : string , pathInZip : string ) => Promise < string > ;
330- unzip : ( zipPath : string , dest : string , option ?: { process : Function } ) => Promise < void > ;
331- zip : ( zipPath : string , sourceDir : string , option ?: { end ?: ( archive : any ) => void } ) => Promise < void > ;
342+ unzip : ( zipPath : string , dest : string , option ?: { process : Function } ) => Promise < void > ;
343+ zip : ( zipPath : string , sourceDir : string , option ?: { end ?: ( archive : any ) => void ; } ) => Promise < void > ;
332344 request : ( option : {
333345 url : string ;
334346 method ?: "GET" | "POST" ;
@@ -378,3 +390,5 @@ declare global {
378390}
379391
380392export { } ;
393+
394+
0 commit comments