diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-12 21:16:48 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-12 21:16:48 +0800 |
commit | 4e52738f7a315085505ffdbefe9ce6722ec3965f (patch) | |
tree | 978b9450f1a8871dbfa538a2b824d289a7a8c234 /meta/template/io.lua | |
parent | e2cd0ad08fdb756f251e3def4a4277d22ba54728 (diff) | |
download | lua-language-server-4e52738f7a315085505ffdbefe9ce6722ec3965f.zip |
暂存
Diffstat (limited to 'meta/template/io.lua')
-rw-r--r-- | meta/template/io.lua | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/template/io.lua b/meta/template/io.lua new file mode 100644 index 00000000..c0d1689c --- /dev/null +++ b/meta/template/io.lua @@ -0,0 +1,70 @@ +---@class io +---@field stdin file +---@field stdout file +---@field stderr file +io = {} + +---@alias openmode +---|>'"r"' +---| '"w"' +---| '"a"' +---| '"r+"' +---| '"w+"' +---| '"a+"' +---| '"rb"' +---| '"wb"' +---| '"ab"' +---| '"r+b"' +---| '"w+b"' +---| '"a+b"' + +---@param file file? +---@return boolean suc? +---@return exitcode exitcode? +---@return integer code? +function io.close(file) end + +function io.flush() end + +---@overload fun():file +---@param file string|file +function io.input(file) end + +---@param filename string? +---@vararg readmode +---@return fun():string|number +function io.lines(filename, ...) end + +---@overload fun():file +---@param file string|file +function io.output(file) end + +---@alias popenmode +---| '"r"' +---| '"w"' + +---@param prog string +---@param mode popenmode? +---@return file? +---@return string errmsg? +function io.popen(prog, mode) end + +---@vararg readmode +---@return string|number +---@return ... +function io.read(...) end + +---@return file +function io.tmpfile() end + +---@alias filetype +---| '"file"' +---| '"closed file"' +---| 'nil' +---@param file file +---@return filetype +function io.type(file) end + +---@return file +---@return string errmsg? +function io.write(...) end |