/
index.d.ts
65 lines (55 loc) · 1.53 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />
import React from 'react'
import {
NextPageContext,
NextComponentType,
NextApiResponse,
NextApiRequest,
NextApiHandler,
// @ts-ignore This path is generated at build time and conflicts otherwise
} from '../dist/next-server/lib/utils'
// @ts-ignore This path is generated at build time and conflicts otherwise
import next from '../dist/server/next'
// Extend the React types with missing properties
declare module 'react' {
// <html amp=""> support
interface HtmlHTMLAttributes<T> extends React.HTMLAttributes<T> {
amp?: string
}
// <link nonce=""> support
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
nonce?: string
}
// <style jsx> and <style jsx global> support for styled-jsx
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
jsx?: boolean
global?: boolean
}
}
/**
* `Page` type, use it as a guide to create `pages`.
*/
export type NextPage<P = {}, IP = P> = NextComponentType<NextPageContext, IP, P>
/**
* `Config` type, use it for export const config
*/
export type PageConfig = {
amp?: boolean | 'hybrid'
api?: {
/**
* The byte limit of the body. This is the number of bytes or any string
* format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`.
*/
bodyParser?: { sizeLimit?: number | string } | false
}
}
export {
NextPageContext,
NextComponentType,
NextApiResponse,
NextApiRequest,
NextApiHandler,
}
export default next