1 | import * as React from "react";
|
2 |
|
3 | import { NextContext } from ".";
|
4 |
|
5 | export interface RenderPageResponse {
|
6 | buildManifest: { [key: string]: any };
|
7 | chunks: {
|
8 | names: string[];
|
9 | filenames: string[];
|
10 | };
|
11 | html?: string;
|
12 | head: Array<React.ReactElement<any>>;
|
13 | errorHtml: string;
|
14 | }
|
15 |
|
16 | export interface PageProps {
|
17 | url: string;
|
18 | }
|
19 |
|
20 | export interface AnyPageProps extends PageProps {
|
21 | [key: string]: any;
|
22 | }
|
23 |
|
24 | export type Enhancer<E extends PageProps = AnyPageProps, P extends any = E> = (page: React.ComponentType<P>) => React.ComponentType<E>;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export interface NextDocumentContext extends NextContext {
|
30 |
|
31 | renderPage<E extends PageProps = AnyPageProps, P extends any = E>(enhancer?: Enhancer<E, P>): RenderPageResponse;
|
32 | }
|
33 |
|
34 | export interface DocumentProps {
|
35 | __NEXT_DATA__?: any;
|
36 | dev?: boolean;
|
37 | chunks?: {
|
38 | names: string[];
|
39 | filenames: string[];
|
40 | };
|
41 | html?: string;
|
42 | head?: Array<React.ReactElement<any>>;
|
43 | errorHtml?: string;
|
44 | styles?: Array<React.ReactElement<any>>;
|
45 | [key: string]: any;
|
46 | }
|
47 |
|
48 | export interface HeadProps {
|
49 | nonce?: string;
|
50 | [key: string]: any;
|
51 | }
|
52 |
|
53 | export interface NextScriptProps {
|
54 | nonce?: string;
|
55 | }
|
56 |
|
57 | export class Head extends React.Component<HeadProps> {}
|
58 | export class Main extends React.Component {}
|
59 | export class NextScript extends React.Component<NextScriptProps> {}
|
60 | export default class extends React.Component<DocumentProps> {
|
61 | static getInitialProps(ctx: NextDocumentContext): Promise<DocumentProps> | DocumentProps;
|
62 | }
|