Sign in

    #mizchi/npm_typed/hono

    MoonBit bindings for Hono, a fast and lightweight web framework.

    #Installation

    moon add mizchi/js moon add mizchi/npm_typed npm install hono

    Add to your moon.pkg:

    import { "mizchi/js", "mizchi/js_core" @core, "mizchi/js_web/http", "mizchi/npm_typed/hono", }

    #Features

    • Hono core (routing, middleware, context)
    • JSX rendering (hono/jsx)
    • CSS-in-JS (hono/css)
    • Cookie helpers (hono/cookie)
    • JWT helpers (hono/jwt)
    • CORS middleware (hono/cors)
    • RPC client (hono/client)
    • Testing utilities (hono/testing)

    #Usage

    #Basic Example

    async fn main {
    let app : @hono.Hono[Unit, Unit] = @hono.Hono::new()
    app.get("/", fn(c) { c.text("Hello, Hono!") }) |> ignore
    // serve with @hono/node-server or deploy to Cloudflare Workers
    }

    For ESM environments, use the HonoJsx API which handles module initialization automatically:

    async fn create_app() -> @hono.Hono[Unit, Unit] {
    let hono_jsx = @hono.import_hono_jsx()
    let hono_css = @hono.import_hono_css()

    let app = @hono.Hono::new()
    app.get("/", fn(c) {
    let content = hono_jsx.jsx("div", [
    hono_jsx.jsx("h1", ["Hello, World!"]),
    ])
    c.html_jsx(content)
    })
    }

    #JSX with Legacy API

    The legacy API (jsx, h, fragment) is simpler but requires initialization in ESM:

    async fn create_app() -> @hono.Hono[Unit, Unit] {
    // Required for ESM: initialize Fragment before using fragment()
    @hono.init_jsx_runtime()

    let app = @hono.Hono::new()
    app.get("/", fn(c) {
    let content = @hono.jsx("div", [
    @hono.jsx("h1", ["Hello, World!"]),
    ])
    c.html_jsx(content)
    })
    }

    #ESM Migration Notes

    This package uses #module directive for ESM compatibility. Most functions work automatically, but Fragment requires special handling because it's a value export (not a function).

    #Why init_jsx_runtime() is needed

    • #module directive only works with function exports
    • Fragment is a Symbol value exported from hono/jsx/jsx-runtime
    • init_jsx_runtime() dynamically imports and stores Fragment in globalThis

    #Recommendation

    For new code, prefer the HonoJsx API which encapsulates all initialization:

    let hono_jsx = @hono.import_hono_jsx()
    hono_jsx.fragment([child1, child2]) // No manual init needed

    #Example

    See src/examples/hono_app for a complete example with:
    • Routing
    • JSX rendering
    • CSS-in-JS styling
    • Cookie-based authentication
    • CORS middleware

    type FC[T] = (T) -> JSXNode

    Component function type

    Handler

    type Handler[Env, ExecutionContext] = async (Context[Env, ExecutionContext]) ->
    Response

    Handler function type: (Context) -> Response | Promise[Response]

    Middleware

    Middleware function type

    CssClassName

    pub trait CssClassName {
    fn value(Self) ->
    Any

    }

    CSS class name trait - accepts String or CssClass Used for jsx class attribute

    HonoNode

    pub trait HonoNode {
    fn toHonoNode(Self) ->
    Any

    }

    HonoNode trait for JSX children
    impl HonoNode for Bool
    impl HonoNode for Int
    impl HonoNode for Double
    impl HonoNode for String
    impl HonoNode for Array[T]

    ClientEndpoint

    pub type ClientEndpoint

    ClientEndpoint represents a path endpoint that can be called with HTTP methods

    ClientEndpoint::as_any

    ClientEndpoint::delete_

    Make a DELETE request to the endpoint Original: endpoint.$delete(options)

    ClientEndpoint::get_

    Make a GET request to the endpoint Original: endpoint.$get(options)

    ClientEndpoint::patch_

    Make a PATCH request to the endpoint Original: endpoint.$patch(options)

    ClientEndpoint::post_

    Make a POST request to the endpoint Original: endpoint.$post(options)

    ClientEndpoint::put_

    Make a PUT request to the endpoint Original: endpoint.$put(options)

    ClientEndpoint::url_

    Get the URL for the endpoint Original: endpoint.$url(options)

    ClientResponse

    pub type ClientResponse

    ClientResponse type wrapping Response

    ClientResponse::arrayBuffer

    #alias(array_buffer)
    async fn ClientResponse::arrayBuffer(self : ClientResponse) ->
    Any

    Parse response as array buffer

    ClientResponse::as_any

    ClientResponse::blob

    Parse response as blob

    ClientResponse::headers

    Get headers from response

    ClientResponse::json

    Parse response as JSON

    ClientResponse::ok

    fn ClientResponse::ok(self : ClientResponse) -> Bool

    Check if response is ok

    ClientResponse::status

    fn ClientResponse::status(self : ClientResponse) -> Int

    Get response status

    ClientResponse::text

    async fn ClientResponse::text(self : ClientResponse) -> String

    Parse response as text

    Context

    pub(all) struct Context[Env, ExecutionContext] {
    req : HonoRequest
    env : Env
    executionCtx : ExecutionContext
    }

    Context object passed to handlers Type parameters: Env (environment bindings), ExecutionContext

    Context::as_any

    fn[Env, ExecutionContext] Context::as_any(self : Context[Env, ExecutionContext]) ->
    Any

    Context::body

    fn[Env, ExecutionContext] Context::body(self : Context[Env, ExecutionContext], body : String, status? : Int, headers? :
    Any
    ) ->
    Response

    Return a Response with body https://hono.dev/docs/api/context#body

    Context::executionCtx

    #alias(execution_ctx)
    fn[Env, ExecutionContext] Context::executionCtx(self : Context[Env, ExecutionContext]) -> ExecutionContext

    Get execution context (c.executionCtx) Alias for executionCtx field

    Context::getValue

    #alias(get_value)
    fn[Env, ExecutionContext] Context::getValue(self : Context[Env, ExecutionContext], key : String) ->
    Any

    Get a value from context

    Context::header

    fn[Env, ExecutionContext] Context::header(self : Context[Env, ExecutionContext], name : String, value : String) -> Unit

    Set response header https://hono.dev/docs/api/context#header

    Context::html

    fn[Env, ExecutionContext] Context::html(self : Context[Env, ExecutionContext], html : String, status? : Int) ->
    Response

    Return HTML response https://hono.dev/docs/api/context#html

    Context::html_jsx

    fn[Env, ExecutionContext] Context::html_jsx(self : Context[Env, ExecutionContext], node : JSXNode, status? : Int) ->
    Response

    Extend Context with JSX html method

    Context::json

    fn[Env, ExecutionContext, T] Context::json(self : Context[Env, ExecutionContext], data : T, status? : Int) ->
    Response

    Return JSON response https://hono.dev/docs/api/context#json

    Context::notFound

    #alias(not_found)
    fn[Env, ExecutionContext] Context::notFound(self : Context[Env, ExecutionContext]) ->
    Response

    Return 404 Not Found https://hono.dev/docs/api/context#notfound

    Context::redirect

    fn[Env, ExecutionContext] Context::redirect(self : Context[Env, ExecutionContext], url : String, status? : Int) ->
    Response

    Redirect to URL https://hono.dev/docs/api/context#redirect

    Context::render

    fn[Env, ExecutionContext] Context::render(self : Context[Env, ExecutionContext], content : String) ->
    Response

    Render content using the renderer set by setRenderer https://hono.dev/docs/api/context#render-setrenderer

    Context::res

    fn[Env, ExecutionContext] Context::res(self : Context[Env, ExecutionContext]) ->
    Response

    Get the Response object https://hono.dev/docs/api/context#res

    Context::set

    fn[Env, ExecutionContext] Context::set(self : Context[Env, ExecutionContext], key : String, value :
    Any
    ) -> Unit

    Set a value in context https://hono.dev/docs/api/context#set-get

    Context::setRenderer

    #alias(set_renderer)
    fn[Env, ExecutionContext] Context::setRenderer(self : Context[Env, ExecutionContext], renderer : (String) ->
    Response
    ) -> Unit

    Set a custom renderer for templates https://hono.dev/docs/api/context#setrenderer

    Context::status

    fn[Env, ExecutionContext] Context::status(self : Context[Env, ExecutionContext], code : Int) -> Unit

    Set status code https://hono.dev/docs/api/context#status

    Context::stream_jsx

    async fn[Env, ExecutionContext] Context::stream_jsx(self : Context[Env, ExecutionContext], hono_jsx : HonoJsx, node : JSXNode, status? : Int) ->
    Response

    Extend Context with streaming JSX response

    Context::text

    fn[Env, ExecutionContext] Context::text(self : Context[Env, ExecutionContext], text : String, status? : Int) ->
    Response

    Return text response https://hono.dev/docs/api/context#text

    Context::var_

    fn[Env, ExecutionContext] Context::var_(self : Context[Env, ExecutionContext], key : String) ->
    Any

    Get a variable from context https://hono.dev/docs/api/context#var

    CorsMiddleware

    #external
    pub type CorsMiddleware

    CORS middleware type

    CorsMiddleware::as_any

    CssClass

    #external
    pub type CssClass

    CSS class - wraps the JS css object to preserve callbacks for Style component

    CssClass::as_any

    CssClass::to_string

    fn CssClass::to_string(self : CssClass) -> String

    Get the class name string from CssClass

    Hono

    #external
    pub type Hono[Env, ExecutionContext]

    Hono application instance Type parameters: Env (environment bindings), ExecutionContext

    Hono::all

    fn[Env, ExecutionContext] Hono::all(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    ALL method handler

    Hono::as_any

    fn[Env, ExecutionContext] Hono::as_any(self : Hono[Env, ExecutionContext]) ->
    Any

    Hono::basePath

    #alias(base_path)
    fn[Env, ExecutionContext] Hono::basePath(self : Hono[Env, ExecutionContext], path : String) -> Hono[Env, ExecutionContext]

    Set base path https://hono.dev/docs/api/hono#basepath

    Hono::cors

    fn[Env, ExecutionContext] Hono::cors(self : Hono[Env, ExecutionContext], path : String, origin? : String, allowMethods? : Array[String], allowHeaders? : Array[String], maxAge? : Int, credentials? : Bool, exposeHeaders? : Array[String]) -> Hono[Env, ExecutionContext]

    Apply CORS middleware to Hono app for a specific path

    Hono::cors_all

    fn[Env, ExecutionContext] Hono::cors_all(self : Hono[Env, ExecutionContext], origin? : String, allowMethods? : Array[String], allowHeaders? : Array[String], maxAge? : Int, credentials? : Bool, exposeHeaders? : Array[String]) -> Hono[Env, ExecutionContext]

    Apply CORS middleware to all paths

    Hono::delete

    fn[Env, ExecutionContext] Hono::delete(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    DELETE route handler

    Hono::fetch

    fn[Env, ExecutionContext] Hono::fetch(self : Hono[Env, ExecutionContext], request :
    Request
    ) ->
    Promise
    [
    Response
    ]

    Handle requests https://hono.dev/docs/api/hono#fetch

    Hono::fire

    fn[Env, ExecutionContext] Hono::fire(self : Hono[Env, ExecutionContext]) -> Hono[Env, ExecutionContext]

    Fire requests (for testing) https://hono.dev/docs/api/hono#fire

    Hono::get

    fn[Env, ExecutionContext] Hono::get(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    GET route handler https://hono.dev/docs/api/hono#get-post-put-delete

    Hono::mount

    fn[Env, ExecutionContext] Hono::mount(self : Hono[Env, ExecutionContext], path : String, app : Hono[Env, ExecutionContext]) -> Hono[Env, ExecutionContext]

    Mount another application https://hono.dev/docs/api/hono#mount

    Hono::new

    async fn[Env, ExecutionContext] Hono::new(strict? : Bool) -> Hono[Env, ExecutionContext]

    Create a new Hono instance (async) Example with strict mode disabled:
    let app = Hono::new()

    let app_strict = Hono::new(strict=false)

    Hono::notFound

    #alias(not_found)
    fn[Env, ExecutionContext] Hono::notFound(self : Hono[Env, ExecutionContext], handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    Custom 404 handler https://hono.dev/docs/api/hono#notfound

    Hono::onError

    #alias(on_error)
    fn[Env, ExecutionContext] Hono::onError(self : Hono[Env, ExecutionContext], handler : (
    Any
    , Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    Error handler https://hono.dev/docs/api/hono#onerror

    Hono::options

    fn[Env, ExecutionContext] Hono::options(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    OPTIONS route handler

    Hono::patch

    fn[Env, ExecutionContext] Hono::patch(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    PATCH route handler

    Hono::post

    fn[Env, ExecutionContext] Hono::post(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    POST route handler

    Hono::put

    fn[Env, ExecutionContext] Hono::put(self : Hono[Env, ExecutionContext], path : String, handler : async (Context[Env, ExecutionContext]) ->
    Response
    ) -> Hono[Env, ExecutionContext]

    PUT route handler

    Hono::route

    fn[Env, ExecutionContext] Hono::route(self : Hono[Env, ExecutionContext], path : String, app : Hono[Env, ExecutionContext]) -> Hono[Env, ExecutionContext]

    Route grouping https://hono.dev/docs/api/hono#route

    Hono::use_

    fn[Env, ExecutionContext] Hono::use_(self : Hono[Env, ExecutionContext], path : String, middleware : (Context[Env, ExecutionContext], () ->
    Promise
    [
    Response
    ]) ->
    Promise
    [
    Response
    ]) -> Hono[Env, ExecutionContext]

    Apply middleware https://hono.dev/docs/api/hono#use

    Hono::useall

    fn[Env, ExecutionContext] Hono::useall(self : Hono[Env, ExecutionContext], middleware : (Context[Env, ExecutionContext], () ->
    Promise
    [
    Response
    ]) ->
    Promise
    [
    Response
    ]) -> Hono[Env, ExecutionContext]

    Apply middleware to all paths

    HonoClient

    pub type HonoClient

    HonoClient type for making RPC requests

    HonoClient::as_any

    HonoClient::path

    fn HonoClient::path(self : HonoClient, path : String) -> ClientEndpoint

    Access a path on the client Original: client[path] or client.path

    HonoContext

    #external
    pub type HonoContext[T]

    Context type

    HonoContext::as_any

    fn[T] HonoContext::as_any(self : HonoContext[T]) ->
    Any

    HonoCss

    #external
    pub type HonoCss

    HonoCss::css

    fn HonoCss::css(self : HonoCss, template : String, args? : Array[
    Any
    ]) -> CssClass

    Create a CSS class using tagged template syntax.

    Template format uses ${@0}, ${@1}, etc. as placeholders for interpolation. Returns a CssClass that can be used with jsx class attribute.

    Example

    // Simple usage without interpolation
    let cls = hono_css.css("color: red")

    // With interpolation

    let color = "blue"

    let size = 16

    let cls = hono_css.css("color: ${@0}; font-size: ${@1}px", args=[
    @core.any(color),
    @core.any(size),
    ])

    HonoCss::cx

    fn HonoCss::cx(self : HonoCss, classes : Array[CssClass]) -> CssClass

    Combine multiple CSS classes

    HonoCss::keyframes

    fn HonoCss::keyframes(self : HonoCss, template : String, args? : Array[
    Any
    ]) -> CssClass

    Create keyframes animation using tagged template syntax.

    Template format uses ${@0}, ${@1}, etc. as placeholders for interpolation. Returns a CssClass for the animation.

    Example

    // Simple usage
    let anim = hono_css.keyframes("from { opacity: 0 } to { opacity: 1 }")

    // With interpolation

    let start = 0.5

    let end = 1.0

    let anim = hono_css.keyframes(
    "from { transform: scale(${@0}) } to { transform: scale(${@1}) }",
    args=[@core.any(start), @core.any(end)],
    )

    HonoCss::style_component

    fn HonoCss::style_component(self : HonoCss, nonce? : String) -> JSXNode

    Style component - renders collected CSS in head Must be included in the document head for CSS to work

    HonoJsx

    #external
    pub type HonoJsx

    HonoJsx::context_provider

    fn[T] HonoJsx::context_provider(self : HonoJsx, ctx : HonoContext[T], children : Array[&HonoNode], value~ : T) -> JSXNode

    Context Provider

    HonoJsx::create_context

    fn[T] HonoJsx::create_context(self : HonoJsx, defaultValue : T?) -> HonoContext[T]

    Create a context

    HonoJsx::fragment

    fn HonoJsx::fragment(self : HonoJsx, children : Array[&HonoNode], key? : String) -> JSXNode

    Fragment - groups elements without extra DOM nodes

    HonoJsx::h

    fn HonoJsx::h(self : HonoJsx, tag : String, children : Array[&HonoNode], props? : Map[String,
    Any
    ], style? : Map[String, String], class? : &CssClassName, id? : String, key? : String) -> JSXNode

    Alias for jsx

    HonoJsx::html

    fn HonoJsx::html(self : HonoJsx, template : String) -> HtmlEscapedString

    Create HTML from template string (escaped)

    HonoJsx::jsx

    fn HonoJsx::jsx(self : HonoJsx, tag : String, children : Array[&HonoNode], props? : Map[String,
    Any
    ], style? : Map[String, String], class? : &CssClassName, id? : String, key? : String) -> JSXNode

    Create a JSX element using HonoJsx instance

    HonoJsx::jsx_component

    fn[T] HonoJsx::jsx_component(self : HonoJsx, tag : (T) -> JSXNode, props : T, children? : Array[&HonoNode], key? : String) -> JSXNode

    Create element with component function

    HonoJsx::memo

    fn[T] HonoJsx::memo(self : HonoJsx, component : (T) -> JSXNode) -> ((T) -> JSXNode)

    Memo - memoize a component

    HonoJsx::raw

    fn HonoJsx::raw(self : HonoJsx, html : String) -> JSXNode

    Raw HTML - insert unescaped HTML

    HonoJsx::render_to_readable_stream

    fn HonoJsx::render_to_readable_stream(self : HonoJsx, node : JSXNode) ->
    Any

    Render JSX to ReadableStream (streaming)

    HonoJsx::use_context

    fn[T] HonoJsx::use_context(self : HonoJsx, ctx : HonoContext[T]) -> T

    Use context value

    HonoRequest

    pub(all) struct HonoRequest {
    url : String
    bodyUsed : Bool
    }

    HonoRequest type - wrapper around Request

    HonoRequest::arrayBuffer

    #alias(array_buffer)
    async fn HonoRequest::arrayBuffer(self : HonoRequest) ->
    Any

    Parse request body as array buffer https://hono.dev/docs/api/request#arraybuffer

    HonoRequest::as_any

    HonoRequest::blob

    Parse request body as blob https://hono.dev/docs/api/request#blob

    HonoRequest::formData

    #alias(form_data)
    async fn HonoRequest::formData(self : HonoRequest) ->
    FormData

    Parse request body as form data https://hono.dev/docs/api/request#formdata

    HonoRequest::header

    fn HonoRequest::header(self : HonoRequest, key : String) -> String?

    Get header value https://hono.dev/docs/api/request#header

    HonoRequest::json

    Parse request body as JSON https://hono.dev/docs/api/request#json

    HonoRequest::method_

    fn HonoRequest::method_(self : HonoRequest) -> String

    Get request method

    HonoRequest::param

    fn HonoRequest::param(self : HonoRequest, key : String) -> String?

    Get path parameter https://hono.dev/docs/api/request#param

    HonoRequest::paramAll

    #alias(param_all)
    fn HonoRequest::paramAll(self : HonoRequest) ->
    Any

    Get all path parameters

    HonoRequest::parseBody

    #alias(parse_body)
    async fn HonoRequest::parseBody(self : HonoRequest, options? :
    Any
    ) ->
    Any

    Parse request body of multipart/form-data or application/x-www-form-urlencoded https://hono.dev/docs/api/request#parsebody

    HonoRequest::path

    fn HonoRequest::path(self : HonoRequest) -> String

    Get request path

    HonoRequest::query

    fn HonoRequest::query(self : HonoRequest, key : String) -> String?

    Get query parameter https://hono.dev/docs/api/request#query

    HonoRequest::queryAll

    #alias(query_all)
    fn HonoRequest::queryAll(self : HonoRequest) ->
    Any

    Get all query parameters

    HonoRequest::text

    async fn HonoRequest::text(self : HonoRequest) -> String

    Parse request body as text https://hono.dev/docs/api/request#text

    HtmlEscapedString

    #external
    pub type HtmlEscapedString

    HTML tagged template helper result

    HtmlEscapedString::as_any

    JSXNode

    #external
    pub type JSXNode

    JSX Node type
    impl HonoNode for JSXNode

    JSXNode::as_any

    fn JSXNode::as_any(self : JSXNode) ->
    Any

    JwtAlgorithm

    pub(all) enum JwtAlgorithm {
    HS256
    HS384
    HS512
    RS256
    RS384
    RS512
    PS256
    PS384
    PS512
    ES256
    ES384
    ES512
    EdDSA
    }

    JWT Algorithm types

    JwtDecoded

    pub struct JwtDecoded {
    header :
    Any

    payload :
    Any

    }

    Decoded JWT result

    JwtPayload

    pub(all) struct JwtPayload {
    sub : String?
    iss : String?
    aud : String?
    exp : Int?
    nbf : Int?
    iat : Int?
    jti : String?
    }

    JWT Payload type

    JwtPayload::default

    fn JwtPayload::default() -> JwtPayload

    Default JWT payload

    context_provider

    fn[T] context_provider(ctx : HonoContext[T], children : Array[&HonoNode], value~ : T) -> JSXNode

    Context Provider (legacy - prefer HonoJsx::context_provider)

    cors

    fn cors(origin? : String, allowMethods? : Array[String], allowHeaders? : Array[String], maxAge? : Int, credentials? : Bool, exposeHeaders? : Array[String]) -> CorsMiddleware

    Create CORS middleware https://hono.dev/docs/middleware/builtin/cors

    create_context

    fn[T] create_context(defaultValue : T?) -> HonoContext[T]

    fn[Env, ExecutionContext] delete_cookie(c : Context[Env, ExecutionContext], name : String, path? : String, secure? : Bool, domain? : String) -> String?

    Delete a cookie https://hono.dev/docs/helpers/cookie#deletecookie

    fragment

    fn fragment(children : Array[&HonoNode], key? : String) -> JSXNode

    Fragment (legacy - prefer HonoJsx::fragment) Note: Requires init_jsx_runtime() to be called first

    get_all_cookies

    fn[Env, ExecutionContext] get_all_cookies(c : Context[Env, ExecutionContext]) -> Map[String, String]

    Get all cookies as a Map
    fn[Env, ExecutionContext] get_cookie(c : Context[Env, ExecutionContext], name : String, prefix? : String) -> String?

    Get a cookie value by name https://hono.dev/docs/helpers/cookie#getcookie
    async fn[Env, ExecutionContext] get_signed_cookie(c : Context[Env, ExecutionContext], secret : String, name : String) -> String?

    Get a signed cookie (async) https://hono.dev/docs/helpers/cookie#getsignedcookie
    fn hc(base_url : String) -> HonoClient

    Create a Hono RPC client https://hono.dev/docs/guides/rpc

    html

    fn html(template : String) -> HtmlEscapedString

    import_hono_css

    async fn import_hono_css() -> HonoCss

    Import hono/css module

    import_hono_jsx

    async fn import_hono_jsx() -> HonoJsx

    Import hono/jsx/jsx-runtime module

    init_jsx_runtime

    async fn init_jsx_runtime() -> Unit

    Initialize the JSX runtime (must be called before using legacy jsx/fragment) This must be called before using the legacy fragment function in ESM environments.

    jsx

    #alias(h)
    fn jsx(tag : String, children : Array[&HonoNode], props? : Map[String,
    Any
    ], style? : Map[String, String], class? : &CssClassName, id? : String, key? : String) -> JSXNode

    Create a JSX element (legacy - prefer HonoJsx::jsx) class parameter accepts String or CssClass via CssClassName trait

    jsx_component

    fn[T] jsx_component(tag : (T) -> JSXNode, props : T, children? : Array[&HonoNode], key? : String) -> JSXNode

    Create element with component function (legacy)

    jwt_decode

    fn jwt_decode(token : String) -> JwtDecoded

    Decode a JWT token without verification https://hono.dev/docs/helpers/jwt#decode

    jwt_sign

    async fn jwt_sign(payload :
    Any
    , secret : String, alg? : JwtAlgorithm) -> String

    Sign a JWT token https://hono.dev/docs/helpers/jwt#sign

    jwt_sign_payload

    async fn jwt_sign_payload(payload : JwtPayload, secret : String, alg? : JwtAlgorithm) -> String

    Sign a JWT token with structured payload

    jwt_verify

    async fn jwt_verify(token : String, secret : String, alg? : JwtAlgorithm) ->
    Any

    Verify a JWT token Returns the payload if valid, throws on invalid token https://hono.dev/docs/helpers/jwt#verify

    memo

    fn[T] memo(component : (T) -> JSXNode) -> ((T) -> JSXNode)

    mount_auth

    fn[Env, ExecutionContext] mount_auth(app : Hono[Env, ExecutionContext], auth :
    Auth
    ) -> Hono[Env, ExecutionContext]

    Mount auth routes on Hono app at /api/auth/*

    raw

    fn raw(html : String) -> JSXNode

    render_to_readable_stream

    fn render_to_readable_stream(node : JSXNode) ->
    Any

    render_to_string

    fn render_to_string(node : JSXNode) -> String

    Render JSX to string
    fn[Env, ExecutionContext] set_cookie(c : Context[Env, ExecutionContext], name : String, value : String, domain? : String, expires? :
    Any
    , httpOnly? : Bool, maxAge? : Int, path? : String, secure? : Bool, sameSite? : String, priority? : String, prefix? : String, partitioned? : Bool) -> Unit

    Set a cookie https://hono.dev/docs/helpers/cookie#setcookie
    async fn[Env, ExecutionContext] set_signed_cookie(c : Context[Env, ExecutionContext], name : String, value : String, secret : String, domain? : String, expires? :
    Any
    , httpOnly? : Bool, maxAge? : Int, path? : String, secure? : Bool, sameSite? : String, priority? : String, prefix? : String, partitioned? : Bool) -> Unit

    Set a signed cookie (async) https://hono.dev/docs/helpers/cookie#setsignedcookie

    test_client

    fn[Env, ExecutionContext] test_client(app : Hono[Env, ExecutionContext]) -> HonoClient

    Create a test client for a Hono application Original: testClient(app)

    toHonoHandler

    fn[Env, ExecutionContext] toHonoHandler(auth :
    Auth
    ) -> (async (Context[Env, ExecutionContext]) ->
    Response
    )

    Convert auth handler to Hono handler

    use_context

    fn[T] use_context(ctx : HonoContext[T]) -> T