UNPKG

@chubbyts/chubbyts-framework

Version:

A minimal, highly performant middleware PSR-15 inspired function based microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.

27 lines (26 loc) 890 B
import type { Route } from './route.js'; /** * ```ts * import type { Route } from '@chubbyts/chubbyts-framework/dist/router/route'; * import type { RoutesByName } from '@chubbyts/chubbyts-framework/dist/router/routes-by-name'; * * const route: Route = ...; * * const routesByName: RoutesByName = new Map([ * ['routeName', route], * ]) * ``` */ export type RoutesByName = Map<string, Route>; /** * ```ts * import type { Route } from '@chubbyts/chubbyts-framework/dist/router/route'; * import type { RoutesByName } from '@chubbyts/chubbyts-framework/dist/router/routes-by-name'; * import { createRoutesByName } from '@chubbyts/chubbyts-framework/dist/router/routes-by-name'; * * const routes: Array<Route> = []; * * const routesByName: RoutesByName = createRoutesByName(routes); * ``` */ export declare const createRoutesByName: (routes: Array<Route>) => RoutesByName;