This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2021-09-21 09:19:26 +00:00
|
|
|
import { TemplateResult } from "lit";
|
2021-09-21 09:31:37 +00:00
|
|
|
|
2020-12-01 16:41:27 +00:00
|
|
|
import { Route } from "./Route";
|
|
|
|
|
|
|
|
export class RouteMatch {
|
|
|
|
route: Route;
|
2021-08-03 15:52:21 +00:00
|
|
|
arguments: { [key: string]: string };
|
2020-12-01 16:41:27 +00:00
|
|
|
fullUrl?: string;
|
|
|
|
|
|
|
|
constructor(route: Route) {
|
|
|
|
this.route = route;
|
|
|
|
this.arguments = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
render(): TemplateResult {
|
|
|
|
return this.route.render(this.arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
toString(): string {
|
2021-08-03 15:52:21 +00:00
|
|
|
return `<RouteMatch url=${this.fullUrl} route=${this.route} arguments=${JSON.stringify(
|
|
|
|
this.arguments,
|
|
|
|
)}>`;
|
2020-12-01 16:41:27 +00:00
|
|
|
}
|
|
|
|
}
|