Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
export type HonoRequest = {
|
|
path: string;
|
|
method: string;
|
|
};
|
|
export type Context = {
|
|
req: HonoRequest;
|
|
res: Response;
|
|
error: Error | undefined;
|
|
};
|
|
export type Next = () => Promise<void>;
|
|
export type Handler = (c: Context, next: Next) => Promise<Response> | Response;
|
|
export type MiddlewareHandler = (c: Context, next: Next) => Promise<Response | void>;
|
|
export type HandlerInterface = {
|
|
(...handlers: (Handler | MiddlewareHandler)[]): HonoInstance;
|
|
(path: string, ...handlers: (Handler | MiddlewareHandler)[]): HonoInstance;
|
|
};
|
|
export type OnHandlerInterface = {
|
|
(method: string | string[], path: string | string[], ...handlers: (Handler | MiddlewareHandler)[]): HonoInstance;
|
|
};
|
|
export type MiddlewareHandlerInterface = {
|
|
(...handlers: MiddlewareHandler[]): HonoInstance;
|
|
(path: string, ...handlers: MiddlewareHandler[]): HonoInstance;
|
|
};
|
|
export interface HonoInstance {
|
|
get: HandlerInterface;
|
|
post: HandlerInterface;
|
|
put: HandlerInterface;
|
|
delete: HandlerInterface;
|
|
options: HandlerInterface;
|
|
patch: HandlerInterface;
|
|
all: HandlerInterface;
|
|
on: OnHandlerInterface;
|
|
use: MiddlewareHandlerInterface;
|
|
}
|
|
export type Hono = new (...args: unknown[]) => HonoInstance;
|
|
//# sourceMappingURL=types.d.ts.map |