router working with navigation and links

This commit is contained in:
2026-03-03 19:58:37 -06:00
parent bf1f26d851
commit 0c7164b768
11 changed files with 72 additions and 73 deletions

View File

@@ -1,10 +1,13 @@
export type Router = {
replacePage: (path: string) => void;
pushPage: (path: string) => void;
current: HistoryState
replacePage: (path: Path) => void;
pushPage: (path: Path) => void;
current: Path
}
export type Path = `/${string}`;
export type HistoryState = {
currentPage: Path
};
export const DEFAULT : Router = {
current: window.location.pathname as Path,
pushPage: function(){},
replacePage: function(){}
};