PUSH [===[]===]
if VERSION <= 5.2 then DISABLE() end
PUSH [===[
---@meta utf8

---@version >5.3
]===]
DES 'utf8'
PUSH [===[
---@class utf8lib
]===]
DES 'utf8.charpattern'
PUSH [===[
---@field charpattern string
utf8 = {}

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

]===]
DES 'utf8.codes'
PUSH [===[
]===]
if VERSION <= 5.3 then
PUSH [===[
---@param s    string
---@return fun(s: string, p: integer):integer, integer
function utf8.codes(s) end
]===]
else
PUSH [===[
---@param s    string
---@param lax? boolean
---@return fun(s: string, p: integer):integer, integer
function utf8.codes(s, lax) end
]===]
end
PUSH [===[

]===]
DES 'utf8.codepoint'
PUSH [===[
]===]
if VERSION <= 5.3 then
PUSH [===[
---@param s    string
---@param i?   integer
---@param j?   integer
---@return integer code
---@return integer ...
---@nodiscard
function utf8.codepoint(s, i, j) end
]===]
else
PUSH [===[
---@param s    string
---@param i?   integer
---@param j?   integer
---@param lax? boolean
---@return integer code
---@return integer ...
---@nodiscard
function utf8.codepoint(s, i, j, lax) end
]===]
end
PUSH [===[

]===]
DES 'utf8.len'
PUSH [===[
]===]
if VERSION <= 5.3 then
PUSH [===[
---@param s    string
---@param i?   integer
---@param j?   integer
---@return integer?
---@return integer? errpos
---@nodiscard
function utf8.len(s, i, j) end
]===]
else
PUSH [===[
---@param s    string
---@param i?   integer
---@param j?   integer
---@param lax? boolean
---@return integer?
---@return integer? errpos
---@nodiscard
function utf8.len(s, i, j, lax) end
]===]
end
PUSH [===[

]===]
DES 'utf8.offset'
PUSH [===[
---@param s string
---@param n integer
---@param i? integer
---@return integer p
---@nodiscard
function utf8.offset(s, n, i) end

return utf8
]===]