UNPKG

@jsonjoy.com/jit-router

Version:

High-performance JIT router for Node.js

16 lines (15 loc) 831 B
import { Printable } from 'sonic-forest/lib/print/types'; import { RadixTree } from 'sonic-forest/lib/radix/RadixTree'; import { RouterCodegenCtx, RouterCodegenOpts } from './codegen'; import { Destination, Route } from './router'; import { ExactStep, RegexStep, UntilStep } from './steps'; export declare class RoutingTreeNode implements Printable { readonly exact: Map<number, [step: ExactStep, destination: Destination][]>; readonly start: RadixTree<RoutingTreeNode>; readonly until: [step: UntilStep, destination: RoutingTreeNode][]; readonly regex: [step: RegexStep, destination: RoutingTreeNode | Destination][]; end?: Destination; add(route: Route, step: number, destination: Destination): void; codegen(ctx: RouterCodegenCtx, opts: RouterCodegenOpts): void; toString(tab: string): string; }