Skip to content

Rescript Docs

A collection of rescript ffi libraries - DefinitlyTyped for ReScript.

HonoJwt.payload

Represents the payload structure for JWT tokens.

type payload = {sub: string, role: string, exp: float}
Reference

ArrayAsync.forEachAsync

forEachAsync is a function that applies an asynchronous function to each element of an array, discarding the results.

@param arr - The input array.
@param fn - An asynchronous function that takes an element and its index as parameters and returns a promise.
@return A promise that resolves when all the promises returned by fn have been fulfilled.

let forEachAsync: (array<'a>, ('a, int) => promise<unit>) => promise<unit>
Reference

HonoBasicAuth.basicAuth

Creates a basic authentication middleware for Hono applications.

This middleware implements HTTP Basic Authentication, requiring clients to provide
valid credentials in the Authorization header to access protected routes.

@param options - The authentication configuration containing username and password
@returns A Hono middleware handler that can be used with the use method

let basicAuth: basicAuthOptions => Hono.useHandle
Reference