---@meta mime.core

--------------------------------------------------------------------------------
-- LuaSocket MIME C core module
--------------------------------------------------------------------------------

---@class mime_core*
---@field _VERSION string version
---@type mime_core*
local M = {}

--- Base64 encoding block filter.
---@param chunk string data block
---@param context? string context
---@return string output output
---@return string context new context
function M.b64(chunk, context) end

--- Base64 decoding block filter.
---@param chunk string data block
---@param context? string context
---@return string output output
---@return string context new context
function M.unb64(chunk, context) end

--- Quoted-printable encoding block filter.
---@param chunk string data block
---@param context? string context
---@param marker? string end of line mark
---@return string output output
---@return string context new context
function M.qp(chunk, context, marker) end

--- Quoted-printable decoding block filter.
---@param chunk string data block
---@param context? string context
---@return string output output
---@return string context new context
function M.unqp(chunk, context) end

--- Text wrapping filter.
---@param left integer remaining length of current line
---@param chunk? string data block
---@param length? integer Line length, default 76
---@return string? output output
---@return integer left remaining length
function M.wrp(left, chunk, length) end

--- Quoted-printable newline filter.
---@param left integer remaining length of current line
---@param chunk? string data block
---@param length? integer Line length, default 76
---@return string? output output
---@return integer left remaining length
function M.qpwrp(left, chunk, length) end

--- End of line normalization filter.
---@param context integer context state
---@param chunk? string data block
---@param marker? string end of line mark
---@return string? output output
---@return integer context new context
function M.eol(context, chunk, marker) end

--- SMTP dot escape filter.
---@param context integer context state
---@param chunk? string data block
---@return string? output output
---@return integer context new context
function M.dot(context, chunk) end

return M
