import { ComponentType, default as React } from 'react' import { IncomingMessage, ServerResponse } from 'http' export interface RenderOptions { container: string routes?: Route[] App?: AppComponentType } export interface Route { path: string | '*' component: ComponentType } export interface AppProps { Component: ComponentType | null pageProps: PageProps } export interface RouterProps { url: string routes: Route[] component: ComponentType | null pageProps: any App: AppComponentType } export interface GetInitialPropsParams { Component: ComponentType | null url: string res?: ServerResponse req?: IncomingMessage } export interface LinkProps extends React.HTMLAttributes { to: string } export type AppComponentType = ComponentType declare global { namespace React { interface ComponentClass { getInitialProps?: (...args: any[]) => any } interface FunctionComponent { getInitialProps?: (...args: any[]) => any } } interface Window { __APP_DATA__: { pageProps: object } } }