import React, { Component, ReactNode } from 'react'; import type { DocumentContext, DocumentInitialProps, DocumentProps } from '../shared/lib/utils'; import { HtmlContext } from '../shared/lib/html-context'; import type { HtmlProps } from '../shared/lib/html-context'; export { DocumentContext, DocumentInitialProps, DocumentProps }; export declare type OriginProps = { nonce?: string; crossOrigin?: string; children?: React.ReactNode; }; declare type DocumentFiles = { sharedFiles: readonly string[]; pageFiles: readonly string[]; allFiles: readonly string[]; }; declare type HeadHTMLProps = React.DetailedHTMLProps, HTMLHeadElement>; declare type HeadProps = OriginProps & HeadHTMLProps; /** * `Document` component handles the initial `document` markup and renders only on the server side. * Commonly used for implementing server side rendering for `css-in-js` libraries. */ export default class Document

extends Component { /** * `getInitialProps` hook returns the context object with the addition of `renderPage`. * `renderPage` callback executes `React` rendering logic synchronously to support server-rendering wrappers */ static getInitialProps(ctx: DocumentContext): Promise; render(): JSX.Element; } export declare function Html(props: React.DetailedHTMLProps, HTMLHtmlElement>): JSX.Element; export declare class Head extends Component { static contextType: React.Context; context: React.ContextType; getCssLinks(files: DocumentFiles): JSX.Element[] | null; getPreloadDynamicChunks(): (JSX.Element | null)[]; getPreloadMainLinks(files: DocumentFiles): JSX.Element[] | null; getBeforeInteractiveInlineScripts(): JSX.Element[]; getDynamicChunks(files: DocumentFiles): (JSX.Element | null)[]; getPreNextScripts(): JSX.Element; getScripts(files: DocumentFiles): JSX.Element[]; getPolyfillScripts(): JSX.Element[]; makeStylesheetInert(node: ReactNode): ReactNode[]; render(): JSX.Element; } export declare function Main(): JSX.Element; export declare class NextScript extends Component { static contextType: React.Context; context: React.ContextType; getDynamicChunks(files: DocumentFiles): (JSX.Element | null)[]; getPreNextScripts(): JSX.Element; getScripts(files: DocumentFiles): JSX.Element[]; getPolyfillScripts(): JSX.Element[]; static getInlineScriptSource(context: Readonly): string; render(): JSX.Element | null; }