UNPKG

@riddance/host

Version:

13 lines (12 loc) 609 B
import { type HandlerConfiguration, type Handler as HttpFunction } from '../http.js'; import { type FullConfiguration, type Metadata } from './meta.js'; export type HttpHandler = { meta: Metadata | undefined; config: FullConfiguration | undefined; method: Method; pathPattern: string; entry: HttpFunction; }; export declare function pathToRegExp(path: string): RegExp; export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; export declare function registerHttpHandler(method: Method, path: string, configOrHandler: HandlerConfiguration | HttpFunction, fn?: HttpFunction): void;