UNPKG

e2ed

Version:

E2E testing framework over Playwright

37 lines (36 loc) 967 B
import type { Url, ZeroOrOneArg } from './types/internal'; /** * Abstract route with base methods. */ export declare abstract class Route<RouteParams> { /** * Type of route parameters. */ readonly __PARAMS_KEY: RouteParams; /** * Immutable route parameters. */ readonly routeParams: RouteParams; constructor(...args: ZeroOrOneArg<RouteParams>); /** * Returns route params from the passed url. * @throws {Error} If the route does not match on the url. */ static getParamsFromUrlOrThrow?(url: Url): unknown; /** * Returns the url of the route. */ getUrl(): Url; /** * Returns `true` if url matches the page with given parameters, and `false` otherwise. */ isMatchUrl(url: Url): boolean; /** * Returns the origin of the route. */ abstract getOrigin(): Url; /** * Returns the path-part of the route. */ abstract getPath(): string; }