UNPKG

honestjs

Version:

HonestJS - a modern web framework built on top of Hono

17 lines (16 loc) 542 B
import type { HttpMethodOptions } from '../interfaces'; /** * Creates a decorator factory for HTTP method handlers * @param method - The HTTP method type (GET, POST, PUT, etc.) * @returns A method decorator factory that accepts a path and options * @example * ```ts * const Get = createHttpMethodDecorator(HttpMethod.GET); * * class Controller { * @Get('/users') * getUsers() { } * } * ``` */ export declare function createHttpMethodDecorator(method: string): (path?: string, options?: HttpMethodOptions) => MethodDecorator;