-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.js.flow
48 lines (42 loc) · 1.71 KB
/
next.js.flow
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
41
42
43
44
45
46
47
48
/* @flow */
declare module "next" {
declare type NextApp = {
prepare(): Promise<void>;
getRequestHandler(): any;
render(req: any, res: any, pathname: string, query: any): any;
renderToHTML(req: any, res: any, pathname: string, query: string): string;
renderError(err: Error, req: any, res: any, pathname: any, query: any): any;
renderErrorToHTML(err: Error, req: any, res: any, pathname: string, query: any): string;
};
declare module.exports: (...opts: any) => NextApp
}
declare module "next/head" {
declare module.exports: Class<React$Component<void, any, any>>;
}
declare module "next/link" {
declare module.exports: Class<React$Component<void, {href: string, prefetch?: bool}, any>>;
}
declare module "next/error" {
declare module.exports: Class<React$Component<void, {statusCode: number}, any>>;
}
declare module "next/router" {
declare module.exports: {
route: string;
pathname: string;
query: Object;
onRouteChangeStart: ?((url: string) => void);
onRouteChangeComplete: ?((url: string) => void);
onRouteChangeError: ?((err: Error & {cancelled: boolean}, url: string) => void);
push(url: string, as: ?string): Promise<boolean>;
replace(url: string, as: ?string): Promise<boolean>;
};
}
declare module "next/document" {
declare export var Head: Class<React$Component<void, any, any>>;
declare export var Main: Class<React$Component<void, any, any>>;
declare export var NextScript: Class<React$Component<void, any, any>>;
declare export default Class<React$Component<void, any, any>> & {
getInitialProps: (ctx: {pathname: string, query: any, req?: any, res?: any, jsonPageRes?: any, err?: any}) => Promise<any>;
renderPage(cb: Function): void;
};
}