@types/next
Advanced tools
Comparing version 6.0.1 to 6.0.2
import * as React from "react"; | ||
import { NextContext } from "."; | ||
export interface DocumentProps { | ||
__NEXT_DATA__?: any; | ||
dev?: boolean; | ||
chunks?: string[]; | ||
export interface RenderPageResponse { | ||
buildManifest: { [key: string]: any }; | ||
chunks: { | ||
names: string[]; | ||
filenames: string[]; | ||
}; | ||
html?: string; | ||
head?: Array<React.ReactElement<any>>; | ||
errorHtml?: string; | ||
styles?: Array<React.ReactElement<any>>; | ||
head: Array<React.ReactElement<any>>; | ||
errorHtml: string; | ||
} | ||
export interface PageProps { | ||
url: string; | ||
} | ||
export interface AnyPageProps extends PageProps { | ||
[key: string]: any; | ||
} | ||
export type Enhancer<E extends PageProps = AnyPageProps, P extends any = E> = (page: React.ComponentType<P>) => React.ComponentType<E>; | ||
/** | ||
@@ -21,7 +31,18 @@ * Context object used inside `Document` | ||
/** A callback that executes the actual React rendering logic (synchronously) */ | ||
renderPage( | ||
cb?: (enhancer: () => JSX.Element) => React.ComponentType<any> | ||
): { | ||
[key: string]: any | ||
renderPage<E extends PageProps = AnyPageProps, P extends any = E>(enhancer?: Enhancer<E, P>): RenderPageResponse; // tslint:disable-line:no-unnecessary-generics | ||
} | ||
export interface DocumentProps { | ||
__NEXT_DATA__?: any; | ||
dev?: boolean; | ||
chunks?: { | ||
names: string[]; | ||
filenames: string[]; | ||
}; | ||
html?: string; | ||
head?: Array<React.ReactElement<any>>; | ||
errorHtml?: string; | ||
styles?: Array<React.ReactElement<any>>; | ||
[key: string]: any; | ||
} | ||
@@ -33,3 +54,3 @@ | ||
export default class extends React.Component<DocumentProps> { | ||
static getInitialProps(ctx: NextContext): DocumentProps; | ||
static getInitialProps(ctx: NextDocumentContext): Promise<DocumentProps> | DocumentProps; | ||
} |
{ | ||
"name": "@types/next", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "TypeScript definitions for next", | ||
@@ -44,4 +44,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "9002ddb48b436483e49e6fd5d0de81e3cff25c235244dac4ea075cefb4cb0d20", | ||
"typesPublisherContentHash": "b426628122e9494467e6b7bff4a6148b18d75955c4f78453167978f81882aad4", | ||
"typeScriptVersion": "2.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 18 Jun 2018 22:47:05 GMT | ||
* Last updated: Thu, 21 Jun 2018 00:15:28 GMT | ||
* Dependencies: http, url, node-fetch, node, react | ||
@@ -14,0 +14,0 @@ * Global values: none |
14781
351