export const METHOD_NAME_ALL = 'ALL' as const export const METHOD_NAME_ALL_LOWERCASE = 'all' as const export const METHODS = ['get', 'post', 'put', 'delete', 'options', 'patch'] as const export interface Router { name: string add(method: string, path: string, handler: T): void match(method: string, path: string): Result | null } export interface Result { handlers: T[] params: Record } export class UnsupportedPathError extends Error {}