@jsonjoy.com/jit-router
Version:
High-performance HTTP router with JIT compilation.
16 lines • 880 B
TypeScript
import type { Printable } from 'sonic-forest/lib/print/types';
import { RadixTree } from 'sonic-forest/lib/radix/RadixTree';
import type { RouterCodegenCtx, RouterCodegenOpts } from './codegen';
import { Destination, type 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;
}
//# sourceMappingURL=tree.d.ts.map