-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmain.tsx
40 lines (37 loc) · 1.11 KB
/
main.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { RouteMatch } from 'react-router';
import Cookies from 'universal-cookie';
import NotFoundError from './src/errors/not-found';
import RedirectError from './src/errors/redirect';
import ServerError from './src/errors/server';
export { Redirect, HttpStatus } from './src/components/Paw';
export { getTextFromHtml } from './src/plugins/html-to-text';
export { NotFoundError, RedirectError, ServerError };
type LoadDataParams = {
match: RouteMatch,
getCookies: () => Cookies,
getSearchParams: () => URLSearchParams,
[key: string]: any,
};
type LoadData = (args: LoadDataParams) => any;
export interface IRoute {
path?: string;
loadData?: LoadData;
component?: () => Promise<{ default: React.ComponentType<any>; }>;
skeleton?: React.ComponentType<any>,
error?: React.ComponentType<any>,
delay?: number,
timeout?: number,
selfManageNewProps?: boolean,
layout?: () => Promise<{ default: React.ComponentType<any>; }> | React.ComponentType<any>,
props?: {
[key: string]: any;
};
seo?: {
[key: string]: any;
};
routes?: IRoute[];
index?: boolean;
cache?: false | {
maxAge: number,
},
}