update readme.md to add design/architeture notes

This commit is contained in:
Géry Debongnie
2019-01-27 13:31:02 +01:00
parent 5570df8bf0
commit 8b6ce52cd7
4 changed files with 131 additions and 18 deletions
+8 -2
View File
@@ -1,5 +1,8 @@
import { EventBus, Callback } from "../core/event_bus";
//------------------------------------------------------------------------------
// Types and helpers
//------------------------------------------------------------------------------
export type Query = { [key: string]: string };
function clearSlashes(s: string): string {
@@ -9,12 +12,15 @@ function clearSlashes(s: string): string {
type RouterEvent = "query_changed";
export interface IRouter {
navigate(query: Query);
on(event: RouterEvent, owner: any, callback: Callback);
navigate(query: Query): void;
on(event: RouterEvent, owner: any, callback: Callback): void;
getQuery(): Query;
formatURL(path: string, query: Query): string;
}
//------------------------------------------------------------------------------
// Router
//------------------------------------------------------------------------------
export class Router extends EventBus implements IRouter {
currentQuery: Query;