a7eb6695aa
Although it’s not intended for use in TypeScript, TypeScript still offers some nice features when it’s used in next.config.js (completion, hovers, `"checkJs": true`). ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
33 lines
763 B
TypeScript
33 lines
763 B
TypeScript
/* eslint-disable */
|
|
import { NextConfig } from 'next'
|
|
import { CompileOptions } from '@mdx-js/mdx'
|
|
import { RuleSetConditionAbsolute } from 'webpack'
|
|
|
|
type WithMDX = (config: NextConfig) => NextConfig
|
|
|
|
interface NextMDXOptions {
|
|
/**
|
|
* A webpack rule test to match files to treat as MDX.
|
|
*
|
|
* @default /\.mdx$/
|
|
* @example
|
|
* // Support both .md and .mdx files.
|
|
* /\.mdx?$/
|
|
*/
|
|
extension?: RuleSetConditionAbsolute
|
|
|
|
/**
|
|
* The options to pass to MDX.
|
|
*
|
|
* @see https://mdxjs.com/packages/mdx/#api
|
|
*/
|
|
options?: CompileOptions
|
|
}
|
|
|
|
/**
|
|
* Use [MDX](https://github.com/mdx-js/mdx) with [Next.js](https://github.com/vercel/next.js)
|
|
*/
|
|
declare function nextMDX(options?: NextMDXOptions): WithMDX
|
|
|
|
export = nextMDX
|
|
/* eslint=enable */
|