import { IHttpServerComponent as http } from '@well-known-components/interfaces'; import { Key } from 'path-to-regexp'; import { Middleware } from './middleware'; import { RoutedContext } from './router'; export type LayerOptions = Partial<{ name: string; sensitive: boolean; strict: boolean; ignoreCaptures: boolean; end: boolean; prefix: string; }>; /** * Initialize a new routing Layer with given `method`, `path`, and `middleware`. * * @param path - Path string or regular expression. * @param methods - Array of HTTP verbs. * @param middleware - Layer callback/middleware or series of. * @param opts - Layer options * * @public */ export declare class Layer { opts: LayerOptions; name: string | null; methods: http.HTTPMethod[]; paramNames: Key[]; stack: Middleware, Path>>[]; path: string; regexp: RegExp; constructor(path: Path, methods: ReadonlyArray, middleware: Middleware, Path>> | Middleware, Path>>[], opts?: LayerOptions); /** * Returns whether request `path` matches route. * * @param path - */ match(path: string): boolean; /** * Returns map of URL parameters for given `path` and `paramNames`. * * @param path - * @param captures - * @param existingParams - */ params(captures: Array, existingParams: Record): object; /** * Returns array of regexp url path captures. * * @param path - */ captures(path: string): Array; /** * Prefix route path. * * @param prefix - */ setPrefix(prefix: string): this; }