docs api: minor corrections

This commit is contained in:
jgmdev 2022-11-30 01:11:13 -04:00
parent 9f917052ad
commit 563fa7f29e
7 changed files with 57 additions and 46 deletions

View File

@ -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.

View File

@ -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<string, string>
process.options = {}
---
---Create and start a new process
@ -233,3 +232,6 @@ function process:returncode() end
---
---@return boolean
function process:running() end
return process

View File

@ -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<integer, integer> list List of offsets where a match was found.
function regex:cmatch(subject, offset, options) end
return regex

View File

@ -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

View File

@ -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()

View File

@ -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
function system.path_compare(path1, path2) end
return system

View File

@ -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