add server- and client-side store management (#178)

This commit is contained in:
Rich Harris
2018-03-17 13:45:59 -04:00
parent 67a81a3cac
commit 9812cbd71c
8 changed files with 67 additions and 15 deletions

View File

@@ -1,9 +1,12 @@
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 interface ComponentConstructor {
new (options: { target: Node, data: any, hydrate: boolean }): Component;
new (options: { target: Node, data: any, store: Store, hydrate: boolean }): Component;
preload: (data: { params: Params, query: Query }) => Promise<any>;
};