2018-07-25 11:42:40 +00:00
|
|
|
// @flow
|
2017-02-05 10:39:51 +00:00
|
|
|
|
|
|
|
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" {
|
2017-12-03 22:58:46 +00:00
|
|
|
declare module.exports: Class<React$Component<any, any>>;
|
2017-02-05 10:39:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare module "next/link" {
|
2017-12-03 22:58:46 +00:00
|
|
|
declare module.exports: Class<React$Component<{href: string, prefetch?: bool}, any>>;
|
2017-02-05 10:39:51 +00:00
|
|
|
}
|
|
|
|
|
2017-02-08 19:59:33 +00:00
|
|
|
declare module "next/error" {
|
2017-12-03 22:58:46 +00:00
|
|
|
declare module.exports: Class<React$Component<{statusCode: number}, any>>;
|
2017-02-08 19:59:33 +00:00
|
|
|
}
|
|
|
|
|
2017-02-05 10:39:51 +00:00
|
|
|
declare module "next/document" {
|
2017-12-03 22:58:46 +00:00
|
|
|
declare export var Head: Class<React$Component<any, any>>;
|
|
|
|
declare export var Main: Class<React$Component<any, any>>;
|
|
|
|
declare export var NextScript: Class<React$Component<any, any>>;
|
|
|
|
declare export default Class<React$Component<any, any>> & {
|
2017-03-15 02:37:29 +00:00
|
|
|
getInitialProps: (ctx: {pathname: string, query: any, req?: any, res?: any, jsonPageRes?: any, err?: any}) => Promise<any>;
|
2017-02-05 10:39:51 +00:00
|
|
|
renderPage(cb: Function): void;
|
|
|
|
};
|
|
|
|
}
|