UNPKG

934 BTypeScriptView Raw
1import React from 'react';
2import { AppContextType, AppInitialProps, AppPropsType, NextWebVitalsMetric } from '../next-server/lib/utils';
3import { Router } from '../client/router';
4export { AppInitialProps };
5export { NextWebVitalsMetric };
6export declare type AppContext = AppContextType<Router>;
7export declare type AppProps<P = {}> = AppPropsType<Router, P>;
8/**
9 * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.
10 * This allows for keeping state between navigation, custom error handling, injecting additional data.
11 */
12declare function appGetInitialProps({ Component, ctx, }: AppContext): Promise<AppInitialProps>;
13export default class App<P = {}, CP = {}, S = {}> extends React.Component<P & AppProps<CP>, S> {
14 static origGetInitialProps: typeof appGetInitialProps;
15 static getInitialProps: typeof appGetInitialProps;
16 render(): JSX.Element;
17}