@motorcycle/router
Version:
Standard Router Driver for Motorcycle.js
18 lines (17 loc) • 562 B
TypeScript
import { Location, Path, RouteDefinitions } from './types';
import { Stream } from 'most';
export declare class RouterSource {
private _history$;
private _previousRoutes;
constructor(history$: Stream<Location>, previousRoutes: Array<Path>);
history(): Stream<Location>;
path(path: Path): RouterSource;
define(routes: RouteDefinitions): Stream<DefineReturn>;
createHref(path: Path): Path;
}
export interface DefineReturn {
location: Location;
createHref: (path: Path) => Path;
path: string | null;
value: any | null;
}