_app.d.ts 952 B

1234567891011121314151617
  1. import React from 'react';
  2. import { AppContextType, AppInitialProps, AppPropsType, NextWebVitalsMetric, AppType } from '../shared/lib/utils';
  3. import type { Router } from '../client/router';
  4. export { AppInitialProps, AppType };
  5. export { NextWebVitalsMetric };
  6. export declare type AppContext = AppContextType<Router>;
  7. export 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. */
  12. declare function appGetInitialProps({ Component, ctx, }: AppContext): Promise<AppInitialProps>;
  13. export 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. }