Skip to content

Commit 019d18d

Browse files
committed
enhance os library annotations
1 parent 45eccb2 commit 019d18d

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

  • crates/emmylua_code_analysis/resources/std

crates/emmylua_code_analysis/resources/std/os.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ os = {}
2222
---@return number
2323
function os.clock() end
2424

25-
---@class std.osdate
25+
---@class std.osdateparam
26+
---@field year integer|string four digits
27+
---@field month integer|string 1-12
28+
---@field day integer|string 1-31
29+
---@field hour (integer|string)? 0-23
30+
---@field min (integer|string)? 0-59
31+
---@field sec (integer|string)? 0-61, due to leap seconds
32+
---@field wday (integer|string)? 1-7, Sunday is 1
33+
---@field yday (integer|string)? 1-366
34+
---@field isdst boolean? daylight saving flag, a boolean.
35+
36+
---@class std.osdate : std.osdateparam
2637
---@field year integer|string four digits
2738
---@field month integer|string 1-12
2839
---@field day integer|string 1-31
@@ -65,11 +76,11 @@ function os.clock() end
6576
---
6677
--- On non-POSIX systems, this function may be not thread safe because of its
6778
--- reliance on C function `gmtime` and C function `localtime`.
68-
---@overload fun(fmt:"*t", time: number):table
69-
---@overload fun(fmt:"!*t", time: number):table
79+
---@overload fun(fmt:"*t", time: number):std.osdate
80+
---@overload fun(fmt:"!*t", time: number):std.osdate
7081
---@param format string
7182
---@param time? number
72-
---@return string|std.osdate
83+
---@return string
7384
function os.date(format, time) end
7485

7586
---
@@ -182,17 +193,6 @@ function os.rename(oldname, newname) end
182193
---@return string|nil
183194
function os.setlocale(locale, category) end
184195

185-
---@class std.osdateparam
186-
---@field year integer|string four digits
187-
---@field month integer|string 1-12
188-
---@field day integer|string 1-31
189-
---@field hour (integer|string)? 0-23
190-
---@field min (integer|string)? 0-59
191-
---@field sec (integer|string)? 0-61, due to leap seconds
192-
---@field wday (integer|string)? 1-7, Sunday is 1
193-
---@field yday (integer|string)? 1-366
194-
---@field isdst boolean? daylight saving flag, a boolean.
195-
196196
---
197197
--- Returns the current time when called without arguments, or a time
198198
--- representing the date and time specified by the given table. This table

0 commit comments

Comments
 (0)