From 563fa7f29e0e03ee415c42e55f9f9fdb9a6976d2 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 30 Nov 2022 01:11:13 -0400 Subject: [PATCH] docs api: minor corrections --- docs/api/globals.lua | 2 +- docs/api/process.lua | 34 ++++++++++++++++++---------------- docs/api/regex.lua | 9 ++++++--- docs/api/renderer.lua | 19 ++++++++++--------- docs/api/string.lua | 8 ++++---- docs/api/system.lua | 20 +++++++++++--------- docs/api/utf8extra.lua | 11 +++++++---- 7 files changed, 57 insertions(+), 46 deletions(-) diff --git a/docs/api/globals.lua b/docs/api/globals.lua index b32ff9af..75d290a0 100644 --- a/docs/api/globals.lua +++ b/docs/api/globals.lua @@ -10,7 +10,7 @@ ARGS = {} ARCH = "Architecture-OperatingSystem" ---The current operating system. ----@type string | "'Windows'" | "'Mac OS X'" | "'Linux'" | "'iOS'" | "'Android'" +---@type string | "Windows" | "Mac OS X" | "Linux" | "iOS" | "Android" PLATFORM = "Operating System" ---The current text or ui scale. diff --git a/docs/api/process.lua b/docs/api/process.lua index c384a346..84eafc69 100644 --- a/docs/api/process.lua +++ b/docs/api/process.lua @@ -81,27 +81,27 @@ process.REDIRECT_DISCARD = 3 process.REDIRECT_STDOUT = 4 ---@alias process.errortype ----|>'process.ERROR_PIPE' ----| 'process.ERROR_WOULDBLOCK' ----| 'process.ERROR_TIMEDOUT' ----| 'process.ERROR_INVAL' ----| 'process.ERROR_NOMEM' +---| `process.ERROR_PIPE` +---| `process.ERROR_WOULDBLOCK` +---| `process.ERROR_TIMEDOUT` +---| `process.ERROR_INVAL` +---| `process.ERROR_NOMEM` ---@alias process.streamtype ----|>'process.STREAM_STDIN' ----| 'process.STREAM_STDOUT' ----| 'process.STREAM_STDERR' +---| `process.STREAM_STDIN` +---| `process.STREAM_STDOUT` +---| `process.STREAM_STDERR` ---@alias process.waittype ----|>'process.WAIT_INFINITE' ----| 'process.WAIT_DEADLINE' +---| `process.WAIT_INFINITE` +---| `process.WAIT_DEADLINE` ---@alias process.redirecttype ----|>'process.REDIRECT_DEFAULT' ----| 'process.REDIRECT_PIPE' ----| 'process.REDIRECT_PARENT' ----| 'process.REDIRECT_DISCARD' ----| 'process.REDIRECT_STDOUT' +---| `process.REDIRECT_DEFAULT` +---| `process.REDIRECT_PIPE` +---| `process.REDIRECT_PARENT` +---| `process.REDIRECT_DISCARD` +---| `process.REDIRECT_STDOUT` --- --- Options that can be passed to process.start() @@ -112,7 +112,6 @@ process.REDIRECT_STDOUT = 4 ---@field public stdout process.redirecttype ---@field public stderr process.redirecttype ---@field public env table -process.options = {} --- ---Create and start a new process @@ -233,3 +232,6 @@ function process:returncode() end --- ---@return boolean function process:running() end + + +return process diff --git a/docs/api/regex.lua b/docs/api/regex.lua index 02d8c796..2e7707ef 100644 --- a/docs/api/regex.lua +++ b/docs/api/regex.lua @@ -31,9 +31,9 @@ regex.NOTEMPTY = 0x00000004 regex.NOTEMPTY_ATSTART = 0x00000008 ---@alias regex.modifiers ----|>'"i"' # Case insesitive matching ----| '"m"' # Multiline matching ----| '"s"' # Match all characters with dot (.) metacharacter even new lines +---| "i" # Case insesitive matching +---| "m" # Multiline matching +---| "s" # Match all characters with dot (.) metacharacter even new lines --- ---Compiles a regular expression pattern that can be used to search in strings. @@ -55,3 +55,6 @@ function regex.compile(pattern, options) end --- ---@return table list List of offsets where a match was found. function regex:cmatch(subject, offset, options) end + + +return regex diff --git a/docs/api/renderer.lua b/docs/api/renderer.lua index fe42ed65..e912d645 100644 --- a/docs/api/renderer.lua +++ b/docs/api/renderer.lua @@ -14,19 +14,17 @@ renderer = {} ---@field public g number Green ---@field public b number Blue ---@field public a number Alpha -renderer.color = {} --- ---Represent options that affect a font's rendering. ---@class renderer.fontoptions ----@field public antialiasing "'none'" | "'grayscale'" | "'subpixel'" ----@field public hinting "'slight'" | "'none'" | '"full"' --- @field public bold boolean --- @field public italic boolean --- @field public underline boolean --- @field public smoothing boolean --- @field public strikethrough boolean -renderer.fontoptions = {} +---@field public antialiasing "none" | "grayscale" | "subpixel" +---@field public hinting "slight" | "none" | "full" +---@field public bold boolean +---@field public italic boolean +---@field public underline boolean +---@field public smoothing boolean +---@field public strikethrough boolean --- ---@class renderer.font @@ -154,3 +152,6 @@ function renderer.draw_rect(x, y, width, height, color) end --- ---@return number x function renderer.draw_text(font, text, x, y, color) end + + +return renderer diff --git a/docs/api/string.lua b/docs/api/string.lua index 0872b462..9ac07510 100644 --- a/docs/api/string.lua +++ b/docs/api/string.lua @@ -101,14 +101,14 @@ function string.unext(s, charpos, index) end ---@param s string ---@param idx? integer ---@param substring string ----return string new_string +---@return string new_string function string.uinsert(s, idx, substring) end ---Equivalent to utf8.remove() ---@param s string ---@param start? integer ---@param stop? integer ----return string new_string +---@return string new_string function string.uremove(s, start, stop) end ---Equivalent to utf8.width() @@ -130,12 +130,12 @@ function string.uwidthindex(s, location, ambi_is_double, default_width) end ---Equivalent to utf8.title() ---@param s string ----return string new_string +---@return string new_string function string.utitle(s) end ---Equivalent to utf8.fold() ---@param s string ----return string new_string +---@return string new_string function string.ufold(s) end ---Equivalent to utf8.ncasecmp() diff --git a/docs/api/system.lua b/docs/api/system.lua index 82f56e36..49687523 100644 --- a/docs/api/system.lua +++ b/docs/api/system.lua @@ -6,8 +6,8 @@ system = {} ---@alias system.fileinfotype ----|>'"file"' # It is a file. ----| '"dir"' # It is a directory. +---| "file" # It is a file. +---| "dir" # It is a directory. --- ---@class system.fileinfo @@ -15,7 +15,6 @@ system = {} ---@field public size number Size in bytes. ---@field public type system.fileinfotype Type of file ---@field public symlink boolean The directory is a symlink. This field is only set on Linux and on directories. -system.fileinfo = {} --- ---Core function used to retrieve the current event been triggered by SDL. @@ -66,7 +65,7 @@ function system.wait_event(timeout) end --- ---Change the cursor type displayed on screen. --- ----@param type string | "'arrow'" | "'ibeam'" | "'sizeh'" | "'sizev'" | "'hand'" +---@param type string | "arrow" | "ibeam" | "sizeh" | "sizev" | "hand" function system.set_cursor(type) end --- @@ -76,10 +75,10 @@ function system.set_cursor(type) end function system.set_window_title(title) end ---@alias system.windowmode ----|>'"normal"' ----| '"minimized"' ----| '"maximized"' ----| '"fullscreen"' +---| "normal" +---| "minimized" +---| "maximized" +---| "fullscreen" --- ---Change the window mode. @@ -314,4 +313,7 @@ function system.load_native_plugin(name, path) end ---@param path1 string ---@param path2 string ---@return boolean compare_result True if path1 < path2 -function system.path_compare(path1, path2) end \ No newline at end of file +function system.path_compare(path1, path2) end + + +return system diff --git a/docs/api/utf8extra.lua b/docs/api/utf8extra.lua index 1ff4dcb6..ae9a440e 100644 --- a/docs/api/utf8extra.lua +++ b/docs/api/utf8extra.lua @@ -131,7 +131,7 @@ function utf8extra.next(s, charpos, index) end ---@param s string ---@param idx? integer ---@param substring string ----return string new_string +---@return string new_string function utf8extra.insert(s, idx, substring) end ---Delete a substring in s. If neither start nor stop is given, delete the last @@ -141,7 +141,7 @@ function utf8extra.insert(s, idx, substring) end ---@param s string ---@param start? integer ---@param stop? integer ----return string new_string +---@return string new_string function utf8extra.remove(s, start, stop) end ---Calculate the width of UTF-8 string s. if ambi_is_double is given, the @@ -174,14 +174,14 @@ function utf8extra.widthindex(s, location, ambi_is_double, default_width) end ---is a number, it's treat as a code point and return a convert code point ---(number). utf8.lower/utf8.pper has the same extension. ---@param s string ----return string new_string +---@return string new_string function utf8extra.title(s) end ---Convert UTF-8 string s to folded case, used to compare by ignore case. if s ---is a number, it's treat as a code point and return a convert code point ---(number). utf8.lower/utf8.pper has the same extension. ---@param s string ----return string new_string +---@return string new_string function utf8extra.fold(s) end ---Compare a and b without case, -1 means a < b, 0 means a == b and 1 means a > b. @@ -189,3 +189,6 @@ function utf8extra.fold(s) end ---@param b string ---@return integer result function utf8extra.ncasecmp(a, b) end + + +return utf8extra