From 56eaecc401f05b6daeaed162c54f9ee88f1becac Mon Sep 17 00:00:00 2001 From: ByungHyun Jung <42543186+gustofbreak@users.noreply.github.com> Date: Fri, 14 Sep 2018 15:22:54 +0900 Subject: [PATCH] Make @types/next Document generic for defining custom props. (#28429) Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [ ] Add or edit tests to reflect the change. (Run with `npm test`.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If changing an existing definition: - [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> - [x] Increase the version number in the header if appropriate. - [x] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. I'm not familiar with writing these kind of testing code, so I didn't update that. Give me some guidance if necessary. Thanks. --- types/next/document.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/next/document.d.ts b/types/next/document.d.ts index 0b21fb53c8..e6ba38b6c9 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -57,6 +57,6 @@ export interface NextScriptProps { export class Head extends React.Component {} export class Main extends React.Component {} export class NextScript extends React.Component {} -export default class extends React.Component { +export default class Document extends React.Component { static getInitialProps(ctx: NextDocumentContext): Promise | DocumentProps; }