PUSH [===[---@meta string

]===]
DES 'string'
PUSH [===[
---@class stringlib
string = {}

]===]
DES 'string.byte'
PUSH [===[
---@param s  string|number
---@param i? integer
---@param j? integer
---@return integer ...
---@nodiscard
function string.byte(s, i, j) end

]===]
DES 'string.char'
PUSH [===[
---@param byte integer
---@param ... integer
---@return string
---@nodiscard
function string.char(byte, ...) end

]===]
DES 'string.dump'
PUSH [===[
]===]
if VERSION >= 5.3 or JIT then
PUSH [===[
---@param f      async fun(...):...
---@param strip? boolean
---@return string
---@nodiscard
function string.dump(f, strip) end
]===]
else
PUSH [===[
---@param f      async fun(...):...
---@return string
---@nodiscard
function string.dump(f) end
]===]
end
PUSH [===[

]===]
DES 'string.find'
PUSH [===[
---@param s       string|number
---@param pattern string|number
---@param init?   integer
---@param plain?  boolean
---@return integer|nil start
---@return integer|nil end
---@return any|nil ... captured
---@nodiscard
function string.find(s, pattern, init, plain) end

]===]
DES 'string.format'
PUSH [===[
---@param s string|number
---@param ... any
---@return string
---@nodiscard
function string.format(s, ...) end

]===]
DES 'string.gmatch'
PUSH [===[
]===]
if VERSION <= 5.3 then
PUSH [===[
---@param s       string|number
---@param pattern string|number
---@return fun():string, ...
---@nodiscard
function string.gmatch(s, pattern) end
]===]
else
PUSH [===[
---@param s       string|number
---@param pattern string|number
---@param init?   integer
---@return fun():string, ...
function string.gmatch(s, pattern, init) end
]===]
end
PUSH [===[

]===]
DES 'string.gsub'
PUSH [===[
---@param s       string|number
---@param pattern string|number
---@param repl    string|number|table|function
---@param n?      integer
---@return string
---@return integer count
function string.gsub(s, pattern, repl, n) end

]===]
DES 'string.len'
PUSH [===[
---@param s string|number
---@return integer
---@nodiscard
function string.len(s) end

]===]
DES 'string.lower'
PUSH [===[
---@param s string|number
---@return string
---@nodiscard
function string.lower(s) end

]===]
DES 'string.match'
PUSH [===[
---@param s       string|number
---@param pattern string|number
---@param init?   integer
---@return any ...
---@nodiscard
function string.match(s, pattern, init) end

---@version >5.3
]===]
DES 'string.pack'
PUSH [===[
---@param fmt string
---@param v1  string|number
---@param v2? string|number
---@param ... string|number
---@return string binary
---@nodiscard
function string.pack(fmt, v1, v2, ...) end

---@version >5.3
]===]
DES 'string.packsize'
PUSH [===[
---@param fmt string
---@return integer
---@nodiscard
function string.packsize(fmt) end

]===]
if VERSION <= 5.1 and not JIT then
PUSH [===[
]===]
DES 'string.rep<5.1'
PUSH [===[
---@param s    string|number
---@param n    integer
---@return string
---@nodiscard
function string.rep(s, n) end
]===]
else
PUSH [===[
]===]
DES 'string.rep>5.2'
PUSH [===[
---@param s    string|number
---@param n    integer
---@param sep? string|number
---@return string
---@nodiscard
function string.rep(s, n, sep) end
]===]
end
PUSH [===[

]===]
DES 'string.reverse'
PUSH [===[
---@param s string|number
---@return string
---@nodiscard
function string.reverse(s) end

]===]
DES 'string.sub'
PUSH [===[
---@param s  string|number
---@param i  integer
---@param j? integer
---@return string
---@nodiscard
function string.sub(s, i, j) end

---@version >5.3
]===]
DES 'string.unpack'
PUSH [===[
---@param fmt  string
---@param s    string
---@param pos? integer
---@return any ...
---@nodiscard
function string.unpack(fmt, s, pos) end

]===]
DES 'string.upper'
PUSH [===[
---@param s string|number
---@return string
---@nodiscard
function string.upper(s) end

return string
]===]