libmodulor
Version:
A TypeScript library to create platform-agnostic applications
11 lines (10 loc) • 1.07 kB
TypeScript
import { type Context, type Handler, Hono } from 'hono';
import type { BlankEnv, Env } from 'hono/types';
import type { AppManifest } from '../../../app/index.js';
import type { UCDef, UCHTTPContract, UCInput, UCManager, UCOPIBase } from '../../../uc/index.js';
import type { ServerRequestHandler, ServerRequestHandlerReq, ServerRequestHandlerRes } from '../server/ServerRequestHandler.js';
export declare function buildHandler<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(appManifest: AppManifest, ucd: UCDef<I, OPI0, OPI1>, contract: UCHTTPContract, serverRequestHandler: ServerRequestHandler, ucManager: UCManager, beforeExec?: (c: Context) => Promise<void>): Handler;
export declare function init<E extends Env = BlankEnv>(): Hono<E>;
export declare function mountHandler(contract: UCHTTPContract, hono: Hono, handler: Handler): void;
export declare function toReq(c: Context): ServerRequestHandlerReq;
export declare function toRes(c: Context): ServerRequestHandlerRes;