diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 21:12:38 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 21:12:38 +0800 |
commit | eb96b02d0e37bf0bd1da37704089683d200981c3 (patch) | |
tree | dfd17bfc850f0b5d7f3c92afd2ec7102ccb0edc8 /meta/template/io.lua | |
parent | e9a96590fafd4ab39c71294b48e808739553187e (diff) | |
download | lua-language-server-eb96b02d0e37bf0bd1da37704089683d200981c3.zip |
更新meta
Diffstat (limited to 'meta/template/io.lua')
-rw-r--r-- | meta/template/io.lua | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/meta/template/io.lua b/meta/template/io.lua index 3669dd16..adf64ebc 100644 --- a/meta/template/io.lua +++ b/meta/template/io.lua @@ -1,5 +1,6 @@ ---@meta +---#DES 'io' ---@class io* ---@field stdin file* ---@field stdout file* @@ -7,72 +8,84 @@ io = {} ---@alias openmode ----|>'"r"' ----| '"w"' ----| '"a"' ----| '"r+"' ----| '"w+"' ----| '"a+"' ----| '"rb"' ----| '"wb"' ----| '"ab"' ----| '"r+b"' ----| '"w+b"' ----| '"a+b"' +---|>'"r"' # ---#DESENUM 'openmode.r' +---| '"w"' # ---#DESENUM 'openmode.w' +---| '"a"' # ---#DESENUM 'openmode.a' +---| '"r+"' # ---#DESENUM 'openmode.r+' +---| '"w+"' # ---#DESENUM 'openmode.w+' +---| '"a+"' # ---#DESENUM 'openmode.a+' +---| '"rb"' # ---#DESENUM 'openmode.rb' +---| '"wb"' # ---#DESENUM 'openmode.wb' +---| '"ab"' # ---#DESENUM 'openmode.ab' +---| '"r+b"' # ---#DESENUM 'openmode.r+b' +---| '"w+b"' # ---#DESENUM 'openmode.w+b' +---| '"a+b"' # ---#DESENUM 'openmode.a+b' +---#DES 'io.close' ---@param file? file* ---@return boolean? suc ---@return exitcode? exitcode ---@return integer? code function io.close(file) end +---#DES 'io.flush' function io.flush() end +---#DES 'io.input' ---@overload fun():file* ---@param file string|file* function io.input(file) end +---#DES 'io.lines' ---@param filename string? ---@vararg readmode ---@return fun():string|number function io.lines(filename, ...) end +---#DES 'io.open' ---@param filename string ---@param mode openmode ---@return file*? ---@return string? errmsg function io.open(filename, mode) end +---#DES 'io.output' ---@overload fun():file* ---@param file string|file* function io.output(file) end ---@alias popenmode ----| '"r"' ----| '"w"' +---| '"r"' # ---#DESENUM 'popenmode.r' +---| '"w"' # ---#DESENUM 'popenmode.w' +---#DES 'io.popen' ---@param prog string ---@param mode? popenmode ---@return file*? ---@return string? errmsg function io.popen(prog, mode) end +---#DES 'io.read' ---@vararg readmode ---@return string|number ---@return ... function io.read(...) end +---#DES 'io.tmpfile' ---@return file* function io.tmpfile() end ---@alias filetype ----| '"file"' ----| '"closed file"' ----| 'nil' +---| '"file"' # ---#DESENUM 'filetype.file' +---| '"closed file"' # ---#DESENUM 'filetype.closed file' +---| 'nil' # ---#DESENUM 'filetype.nil' + +---#DES 'io.type' ---@param file file* ---@return filetype function io.type(file) end +---#DES 'io.write' ---@return file* ---@return string? errmsg function io.write(...) end |