
--------------------------------------------------------------------------------
-- LuaSocket MIME module
--------------------------------------------------------------------------------

---@type ltn12*
local ltn12 = require("ltn12")

---@type mime_core*
local core = require("mime.core")

---@class mime*: mime_core*
---@field encodet table encoding filter table
---@field decodet table Decoding filter table
---@field wrapt table Newline filter table
---@type mime*
local M = core

--- 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 newline 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 chunk string data block
---@param length? integer line length
---@param left? integer remaining length
---@return string output output
---@return integer left remaining length
function M.wrp(chunk, length, left) end

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

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

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

--- Create encoding filter
---@param name? 'base64'|'quoted-printable' encoding name
---@param opt1? any Option 1
---@param opt2? any Option 2
---@return function filter LTN12 filter
function M.encode(name, opt1, opt2) end

--- Create decoding filter
---@param name? 'base64'|'quoted-printable' decode name
---@param opt1? any Option 1
---@param opt2? any Option 2
---@return function filter LTN12 filter
function M.decode(name, opt1, opt2) end

--- Create newline filter
---@param name? 'text'|'base64'|'quoted-printable' newline mode
---@param opt1? any Option 1
---@param opt2? any Option 2
---@return function filter LTN12 filter
function M.wrap(name, opt1, opt2) end

--- Create an end-of-line normalization filter
---@param marker? string End of line mark, default CRLF
---@return function filter LTN12 filter
function M.normalize(marker) end

--- Create an SMTP dot escape filter
---@return function filter LTN12 filter
function M.stuff() end

return M
