work in progress

This commit is contained in:
Rich Harris
2018-02-16 12:01:55 -05:00
parent 9a760c570f
commit f9828f9fd2
36 changed files with 667 additions and 7791 deletions

15
src/interfaces.ts Normal file
View File

@@ -0,0 +1,15 @@
export type Route = {
id: string;
type: 'page' | 'route';
file: string;
pattern: RegExp;
test: (url: string) => boolean;
exec: (url: string) => Record<string, string>;
parts: string[];
dynamic: string[];
};
export type Template = {
render: (data: Record<string, string>) => string;
stream: (res, data: Record<string, string | Promise<string>>) => void;
};