@@ -17,7 +17,7 @@ io = {}
1717---
1818--- Equivalent to `file:close()`. Without a file, closes the default output
1919--- file.
20- --- @overload fun ()
20+ --- @overload fun (): void
2121--- @param file file
2222function io .close (file ) end
2323
@@ -33,9 +33,9 @@ function io.flush() end
3333---
3434--- In case of errors this function raises the error, instead of returning an
3535--- error code.
36- --- @overload fun (): number
37- --- @param file file
38- --- @return number
36+ --- @overload fun (): file
37+ --- @param file file | string
38+ --- @return file
3939function io .input (file ) end
4040
4141---
@@ -73,14 +73,15 @@ function io.lines(filename, ...) end
7373--- some systems to open the file in binary mode.
7474--- @overload fun ( filename : string ): file
7575--- @param filename string
76- --- @param mode string
76+ --- @param mode string | ' "r" ' | ' "w" ' | ' "a" ' | ' "r+" ' | ' "w+" ' | ' "a+" ' | ' "rb" ' | ' "wb" ' | ' "ab" ' | ' "rb+" ' | ' "wb+" ' | ' "ab+" '
7777--- @return file
7878function io .open (filename , mode ) return file end
7979
8080---
8181--- Similar to `io.input`, but operates over the default output file.
82- --- @overload fun ()
83- --- @param file file
82+ --- @overload fun (): file
83+ --- @param file file | string
84+ --- @return file
8485function io .output (file ) end
8586
8687---
@@ -89,10 +90,10 @@ function io.output(file) end
8990--- Starts program `prog` in a separated process and returns a file handle that
9091--- you can use to read data from this program (if `mode` is "`r`", the default)
9192--- or to write data to this program (if `mode` is "`w`").
92- --- @overload fun ( prog : file ): any
93- --- @param prog file
94- --- @param mode string
95- --- @return any
93+ --- @overload fun ( prog : string ): file
94+ --- @param prog string
95+ --- @param mode string | ' "r" ' | ' "w" '
96+ --- @return file
9697function io .popen (prog , mode ) end
9798
9899---
@@ -191,7 +192,7 @@ function file:read(...) end
191192--- file (and returns 0); and the call `file:seek("end")` sets the position
192193--- to the end of the file, and returns its size.
193194--- @overload fun ()
194- --- @param whence string
195+ --- @param whence string | ' "set" ' | ' "cur" ' | ' "end" '
195196--- @param offset number
196197function file :seek (whence , offset ) end
197198
@@ -208,7 +209,7 @@ function file:seek(whence, offset) end
208209--- For the last two cases, `size` specifies the size of the buffer, in
209210--- bytes. The default is an appropriate size.
210211--- @overload fun ( mode : string )
211- --- @param mode string
212+ --- @param mode string | ' "no" ' | ' "full" ' | ' "line" '
212213--- @param size number
213214function file :setvbuf (mode , size ) end
214215
0 commit comments