Commit 5a014bdf authored by Lukáš Huvar's avatar Lukáš Huvar Committed by 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
parent ac5a1c62
...@@ -49,9 +49,18 @@ import { isBlockedPage, isInternalUrl } from './utils' ...@@ -49,9 +49,18 @@ import { isBlockedPage, isInternalUrl } from './utils'
type NextConfig = any type NextConfig = any
export type ServerConstructor = { export type ServerConstructor = {
/**
* Where the Next project is located - @default '.'
*/
dir?: string dir?: string
staticMarkup?: boolean staticMarkup?: boolean
/**
* Hide error messages containing server information - @default false
*/
quiet?: boolean quiet?: boolean
/**
* Object what you would use in next.config.js - @default {}
*/
conf?: NextConfig conf?: NextConfig
} }
......
...@@ -14,8 +14,7 @@ import { ...@@ -14,8 +14,7 @@ import {
getRouteRegex, getRouteRegex,
getSortedRoutes getSortedRoutes
} from 'next-server/dist/lib/router/utils' } from 'next-server/dist/lib/router/utils'
import React from 'react'
const React = require('react')
if (typeof React.Suspense === 'undefined') { if (typeof React.Suspense === 'undefined') {
throw new Error( 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment