UNPKG

@jsonjoy.com/jit-router

Version:

High-performance JIT router for Node.js

16 lines (15 loc) 620 B
import { Codegen } from '@jsonjoy.com/util/lib/codegen'; import { JsExpression } from '@jsonjoy.com/util/lib/codegen/util/JsExpression'; import type { Match } from './router'; export type RouteMatcher<Data = unknown> = (route: string) => undefined | Match<Data>; export declare class RouterCodegenCtx { readonly codegen: Codegen<RouteMatcher>; constructor(); } export declare class RouterCodegenOpts { readonly slice: JsExpression; readonly offset: string; readonly depth: number; constructor(slice: JsExpression, offset: string, depth?: number); create(offset: string): RouterCodegenOpts; }