switch to single App component model (#157)

This commit is contained in:
Rich Harris
2018-05-04 22:46:41 -04:00
parent 9e4b79c6ff
commit 8ee5346900
6 changed files with 74 additions and 53 deletions

View File

@@ -3,11 +3,11 @@ import { Store } from '../interfaces';
export { Store };
export type Params = Record<string, string>;
export type Query = Record<string, string | true>;
export type RouteData = { params: Params, query: Query };
export type RouteData = { params: Params, query: Query, path: string };
export interface ComponentConstructor {
new (options: { target: Node, data: any, store: Store, hydrate: boolean }): Component;
preload: (data: { params: Params, query: Query }) => Promise<any>;
preload: (props: { params: Params, query: Query }) => Promise<any>;
};
export interface Component {
@@ -30,5 +30,5 @@ export type ScrollPosition = {
export type Target = {
url: URL;
route: Route;
data: RouteData;
props: RouteData;
};