Unverified Commit a7eb6695 authored by Remco Haszing's avatar Remco Haszing Committed by GitHub

Add type definitions for next/mdx (#36815)

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: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent f7b81316
......@@ -49,6 +49,7 @@
"@babel/core": "7.15.0",
"@babel/eslint-parser": "7.15.0",
"@babel/parser": "7.12.11",
"@babel/generator": "7.15.0",
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
"@babel/preset-flow": "7.14.5",
"@babel/preset-react": "7.14.5",
......
/* 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 */
......@@ -14,6 +14,7 @@ importers:
specifiers:
'@babel/core': 7.15.0
'@babel/eslint-parser': 7.15.0
'@babel/generator': 7.15.0
'@babel/parser': 7.15.0
'@babel/plugin-proposal-object-rest-spread': 7.14.7
'@babel/preset-flow': 7.14.5
......@@ -162,6 +163,7 @@ importers:
devDependencies:
'@babel/core': 7.17.5
'@babel/eslint-parser': 7.15.0_zfufu2skozopumvzuksw2qh3pm
'@babel/generator': 7.15.0
'@babel/parser': 7.15.0
'@babel/plugin-proposal-object-rest-spread': 7.14.7_@babel+core@7.17.5
'@babel/preset-flow': 7.14.5_@babel+core@7.17.5
......@@ -10782,14 +10784,14 @@ packages:
dev: true
/expand-brackets/0.1.5:
resolution: {integrity: sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=}
resolution: {integrity: sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA==}
engines: {node: '>=0.10.0'}
dependencies:
is-posix-bracket: 0.1.1
dev: true
/expand-brackets/2.1.4:
resolution: {integrity: sha1-t3c14xXOMPa27/D4OwQVGiJEliI=}
resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==}
engines: {node: '>=0.10.0'}
dependencies:
debug: 2.6.9
......@@ -10880,13 +10882,13 @@ packages:
dev: true
/extend-shallow/2.0.1:
resolution: {integrity: sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=}
resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==}
engines: {node: '>=0.10.0'}
dependencies:
is-extendable: 0.1.1
/extend-shallow/3.0.2:
resolution: {integrity: sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=}
resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==}
engines: {node: '>=0.10.0'}
dependencies:
assign-symbols: 1.0.0
......@@ -10914,7 +10916,7 @@ packages:
tmp: 0.0.33
/extglob/0.3.2:
resolution: {integrity: sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=}
resolution: {integrity: sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg==}
engines: {node: '>=0.10.0'}
dependencies:
is-extglob: 1.0.0
......@@ -10950,7 +10952,7 @@ packages:
dev: true
/extsprintf/1.3.0:
resolution: {integrity: sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=}
resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}
engines: {'0': node >=0.6.0}
dev: true
......@@ -11119,7 +11121,7 @@ packages:
dev: true
/fill-range/4.0.0:
resolution: {integrity: sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=}
resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==}
engines: {node: '>=0.10.0'}
requiresBuild: true
dependencies:
......@@ -11301,7 +11303,7 @@ packages:
dev: true
/for-in/1.0.2:
resolution: {integrity: sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=}
resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==}
engines: {node: '>=0.10.0'}
/for-own/0.1.5:
......@@ -11381,7 +11383,7 @@ packages:
dev: true
/fragment-cache/0.2.1:
resolution: {integrity: sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=}
resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==}
engines: {node: '>=0.10.0'}
dependencies:
map-cache: 0.2.2
......@@ -11612,7 +11614,7 @@ packages:
get-intrinsic: 1.1.1
/get-value/2.0.6:
resolution: {integrity: sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=}
resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==}
engines: {node: '>=0.10.0'}
requiresBuild: true
......
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