rvx
Version:
A signal based rendering library
51 lines (42 loc) • 1.19 kB
text/typescript
import { Expression, get } from "../core/signals.js";
import { join } from "./path.js";
import { Query, QueryInit } from "./query.js";
import { Router } from "./router.js";
/**
* A router that is located at a specific path and navigates within that path.
*/
export class ChildRouter implements Router {
/**
* Create a new child router.
*
* @param parent The parent router.
* @param mountPath The path this router is mounted at.
* @param path An expression to get the normalized rest path.
*/
constructor(parent: Router, mountPath: string, path: Expression<string>) {
this.
this.
this.
}
get root(): Router {
return this.
}
get parent(): Router | undefined {
return this.
}
get path(): string {
return get(this.
}
get query(): Query | undefined {
return this.
}
push(path: string, query?: QueryInit): void {
this.
}
replace(path: string, query?: QueryInit): void {
this.
}
}