2024-02-16 05:54:43 +01:00
|
|
|
import type { NextConfig } from 'next'
|
|
|
|
import type { Options } from '@mdx-js/loader'
|
|
|
|
import type { RuleSetConditionAbsolute } from 'webpack'
|
2022-05-29 07:21:25 +02:00
|
|
|
|
|
|
|
type WithMDX = (config: NextConfig) => NextConfig
|
|
|
|
|
2024-02-16 05:54:43 +01:00
|
|
|
declare namespace nextMDX {
|
|
|
|
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
|
2022-05-29 07:21:25 +02:00
|
|
|
|
2024-02-16 05:54:43 +01:00
|
|
|
/**
|
|
|
|
* The options to pass to MDX.
|
|
|
|
*
|
|
|
|
* @see https://mdxjs.com/packages/mdx/#api
|
|
|
|
*/
|
|
|
|
options?: Options
|
|
|
|
}
|
2022-05-29 07:21:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Use [MDX](https://github.com/mdx-js/mdx) with [Next.js](https://github.com/vercel/next.js)
|
|
|
|
*/
|
2024-02-16 05:54:43 +01:00
|
|
|
declare function nextMDX(options?: nextMDX.NextMDXOptions): WithMDX
|
2022-05-29 07:21:25 +02:00
|
|
|
|
|
|
|
export = nextMDX
|