Skip to main content
Module

x/acorn/router.ts>RouteParameters

A focused RESTful server framework for Deno 🌰🦕
Latest
type alias RouteParameters
import { type RouteParameters } from "https://deno.land/x/acorn@0.5.1/router.ts";

The type alias to help infer what the route parameters are for a route based on the route string.

Type Parameters

Route extends string
definition: string extends Route ? ParamsDictionary : Route extends `${string}(${string}` ? ParamsDictionary : Route extends `${string}:${infer Rest}` ? (GetRouteParameter<Rest> extends never ? ParamsDictionary : GetRouteParameter<Rest> extends `${infer ParamName}?` ? [P in ParamName]?: string : [P in GetRouteParameter<Rest>]: string) & (Rest extends `${GetRouteParameter<Rest>}${infer Next}` ? RouteParameters<Next> : unknown) : ParamsDictionary