提交 5a014bdf 编写于 作者: L Lukáš Huvar 提交者: Joe Haddad

Adding TypeScript description to next export (#7547)

* Adding Typescript description to next fixes #7529

* Change default export

* Improve typing for next

* Remove dev server typings
上级 ac5a1c62
......@@ -49,9 +49,18 @@ import { isBlockedPage, isInternalUrl } from './utils'
type NextConfig = any
export type ServerConstructor = {
/**
* Where the Next project is located - @default '.'
*/
dir?: string
staticMarkup?: boolean
/**
* Hide error messages containing server information - @default false
*/
quiet?: boolean
/**
* Object what you would use in next.config.js - @default {}
*/
conf?: NextConfig
}
......
......@@ -14,8 +14,7 @@ import {
getRouteRegex,
getSortedRoutes
} from 'next-server/dist/lib/router/utils'
const React = require('react')
import React from 'react'
if (typeof React.Suspense === 'undefined') {
throw new Error(
......
export default function(options: any): any
import Server, { ServerConstructor } from 'next-server/dist/server/next-server'
type NextServerConstructor = Omit<ServerConstructor, 'staticMarkup'> & {
/**
* Whether to launch Next.js in dev mode - @default false
*/
dev?: boolean
}
declare function next(opts: NextServerConstructor): Server
export default next
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册