@@ -33,10 +33,15 @@ module Node.FS.Aff
33
33
, readdirDirentBuffer'
34
34
, utimes
35
35
, readFile
36
+ , readFile'
36
37
, readTextFile
38
+ , readTextFile'
37
39
, writeFile
40
+ , writeFile'
38
41
, writeTextFile
42
+ , writeTextFile'
39
43
, appendFile
44
+ , appendFile'
40
45
, appendTextFile
41
46
, fdOpen
42
47
, fdRead
@@ -85,7 +90,7 @@ import Node.Buffer (Buffer)
85
90
import Node.Encoding (Encoding )
86
91
import Node.FS.Types (BufferLength , BufferOffset , ByteCount , FileDescriptor , FileMode , FilePosition , SymlinkType )
87
92
import Node.FS.Internal.AffUtils (toAff1 , toAff2 , toAff3 , toAff4 , toAff5 )
88
- import Node.FS.Options (CpOptions , FdReadOptions , FdWriteOptions , OpendirOptions , RealpathOptions , RmOptions , RmdirOptions )
93
+ import Node.FS.Options (AppendFileBufferOptions , CpOptions , FdReadOptions , FdWriteOptions , GlobDirentOptions , GlobFilePathOptions , MkdirOptions , OpendirOptions , ReadFileBufferOptions , ReadFileStringOptions , ReaddirBufferOptions , ReaddirDirentBufferOptions , ReaddirDirentOptions , ReaddirFilePathOptions , RealpathOptions , RmOptions , RmdirOptions , WriteFileBufferOptions , WriteFileStringOptions )
89
94
import Node.FS.Constants (AccessMode , CopyMode , FileFlags )
90
95
import Node.FS.Async as A
91
96
import Node.FS.Dir (Dir )
@@ -226,7 +231,7 @@ mkdir = toAff1 A.mkdir
226
231
-- |
227
232
-- | Makes a new directory with all of its options.
228
233
-- |
229
- mkdir' :: FilePath -> { recursive :: Boolean , mode :: Perms } -> Aff Unit
234
+ mkdir' :: FilePath -> MkdirOptions -> Aff Unit
230
235
mkdir' = toAff2 A .mkdir'
231
236
232
237
-- |
@@ -236,23 +241,23 @@ readdir :: FilePath -> Aff (Array FilePath)
236
241
readdir = toAff1 A .readdir
237
242
238
243
-- | Reads the contents of a directory with options.
239
- readdir' :: FilePath -> { recursive :: Boolean , encoding :: Encoding } -> Aff (Array FilePath )
244
+ readdir' :: FilePath -> ReaddirFilePathOptions -> Aff (Array FilePath )
240
245
readdir' = toAff2 A .readdir'
241
246
242
247
-- | Reads the contents of a directory and returns an Aff (Array Buffer).
243
248
readdirBuffer :: FilePath -> Aff (Array Buffer )
244
249
readdirBuffer = toAff1 A .readdirBuffer
245
250
246
251
-- | Reads the contents of a directory with options and returns Aff (Array Buffer).
247
- readdirBuffer' :: FilePath -> { recursive :: Boolean } -> Aff (Array Buffer )
252
+ readdirBuffer' :: FilePath -> ReaddirBufferOptions -> Aff (Array Buffer )
248
253
readdirBuffer' = toAff2 A .readdirBuffer'
249
254
250
255
-- | Reads the contents of a directory and returns an Aff (Array (Dirent DirentNameTypeString)).
251
256
readdirDirent :: FilePath -> Aff (Array (Dirent DirentNameTypeString ))
252
257
readdirDirent = toAff1 A .readdirDirent
253
258
254
259
-- | Reads the contents of a directory with options and returns Aff (Array (Dirent DirentNameTypeString)).
255
- readdirDirent' :: FilePath -> { recursive :: Boolean , encoding :: Encoding } -> Aff (Array (Dirent DirentNameTypeString ))
260
+ readdirDirent' :: FilePath -> ReaddirDirentOptions -> Aff (Array (Dirent DirentNameTypeString ))
256
261
readdirDirent' = toAff2 A .readdirDirent'
257
262
258
263
-- | Reads the contents of a directory.
@@ -264,7 +269,7 @@ readdirDirentBuffer = toAff1 A.readdirDirentBuffer
264
269
-- | Reads the contents of a directory.
265
270
readdirDirentBuffer'
266
271
:: FilePath
267
- -> { recursive :: Boolean }
272
+ -> ReaddirDirentBufferOptions
268
273
-> Aff (Array (Dirent DirentNameTypeBuffer ))
269
274
readdirDirentBuffer' = toAff2 A .readdirDirentBuffer'
270
275
@@ -280,30 +285,45 @@ utimes = toAff3 A.utimes
280
285
readFile :: FilePath -> Aff Buffer
281
286
readFile = toAff1 A .readFile
282
287
288
+ readFile' :: FilePath -> ReadFileBufferOptions -> Aff Buffer
289
+ readFile' = toAff2 A .readFile'
290
+
283
291
-- |
284
292
-- | Reads the entire contents of a text file with the specified encoding.
285
293
-- |
286
294
readTextFile :: Encoding -> FilePath -> Aff String
287
295
readTextFile = toAff2 A .readTextFile
288
296
297
+ readTextFile' :: FilePath -> ReadFileStringOptions -> Aff String
298
+ readTextFile' = toAff2 A .readTextFile'
299
+
289
300
-- |
290
301
-- | Writes a buffer to a file.
291
302
-- |
292
303
writeFile :: FilePath -> Buffer -> Aff Unit
293
304
writeFile = toAff2 A .writeFile
294
305
306
+ writeFile' :: FilePath -> Buffer -> WriteFileBufferOptions -> Aff Unit
307
+ writeFile' = toAff3 A .writeFile'
308
+
295
309
-- |
296
310
-- | Writes text to a file using the specified encoding.
297
311
-- |
298
312
writeTextFile :: Encoding -> FilePath -> String -> Aff Unit
299
313
writeTextFile = toAff3 A .writeTextFile
300
314
315
+ writeTextFile' :: FilePath -> String -> WriteFileStringOptions -> Aff Unit
316
+ writeTextFile' = toAff3 A .writeTextFile'
317
+
301
318
-- |
302
319
-- | Appends the contents of a buffer to a file.
303
320
-- |
304
321
appendFile :: FilePath -> Buffer -> Aff Unit
305
322
appendFile = toAff2 A .appendFile
306
323
324
+ appendFile' :: FilePath -> Buffer -> AppendFileBufferOptions -> Aff Unit
325
+ appendFile' = toAff3 A .appendFile'
326
+
307
327
-- |
308
328
-- | Appends text to a file using the specified encoding.
309
329
-- |
@@ -429,13 +449,13 @@ futimes = toAff3 A.futimes
429
449
glob :: Array FilePath -> Aff (Array FilePath )
430
450
glob = toAff1 A .glob
431
451
432
- glob' :: Array FilePath -> { cwd :: Maybe FilePath , exclude :: Maybe ( FilePath -> Boolean ) } -> Aff (Array FilePath )
452
+ glob' :: Array FilePath -> GlobFilePathOptions -> Aff (Array FilePath )
433
453
glob' = toAff2 A .glob'
434
454
435
455
globDirent :: Array FilePath -> Aff (Array (Dirent DirentNameTypeString ))
436
456
globDirent = toAff1 A .globDirent
437
457
438
- globDirent' :: Array FilePath -> { cwd :: Maybe FilePath , exclude :: Maybe ( Dirent DirentNameTypeString -> Boolean ) } -> Aff (Array (Dirent DirentNameTypeString ))
458
+ globDirent' :: Array FilePath -> GlobDirentOptions -> Aff (Array (Dirent DirentNameTypeString ))
439
459
globDirent' = toAff2 A .globDirent'
440
460
441
461
-- | Change permissions on a symbolic link. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_lchmod_path_mode_callback)
0 commit comments