UNPKG

@iopa/router

Version:

Lightweight and fast router for IOPA applications

20 lines 634 B
import type { IRouterResult, UrlPattern } from '@iopa/types'; interface IHandlerSet<T> { handler: T; score: number; name: string; } export declare class Node<T> { methods: Record<string, IHandlerSet<T>>[]; children: Record<string, Node<T>>; patterns: UrlPattern[]; order: number; name: string; constructor(method?: string, handler?: T, children?: Record<string, Node<T>>); insert(method: string, path: string, handler: T): Node<T>; private _getHandlerSets; private _next; search(method: string, path: string): IRouterResult<T> | null; } export {}; //# sourceMappingURL=node.d.ts.map