@next/mdx 16.0.1-canary.2 → 16.0.1-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +12 -15
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import type { RuleSetConditionAbsolute } from 'webpack'
4
4
 
5
5
  type WithMDX = (config: NextConfig) => NextConfig
6
6
 
7
+ type PluggableListName = 'remarkPlugins' | 'rehypePlugins' | 'recmaPlugins'
8
+
7
9
  declare namespace nextMDX {
8
10
  interface NextMDXOptions {
9
11
  /**
@@ -21,21 +23,16 @@ declare namespace nextMDX {
21
23
  *
22
24
  * @see https://mdxjs.com/packages/mdx/#api
23
25
  */
24
- options?: Options & {
25
- remarkPlugins?:
26
- | (
27
- | string
28
- | [name: string, options: any]
29
- | NonNullable<Options['remarkPlugins']>[number]
30
- )[]
31
- | Options['remarkPlugins']
32
- rehypePlugins?:
33
- | (
34
- | string
35
- | [name: string, options: any]
36
- | NonNullable<Options['rehypePlugins']>[number]
37
- )[]
38
- | Options['rehypePlugins']
26
+ options?: {
27
+ [Key in keyof Options]: Key extends PluggableListName
28
+ ?
29
+ | (
30
+ | string
31
+ | [name: string, ...options: any[]]
32
+ | NonNullable<Options[Key]>[number]
33
+ )[]
34
+ | Options[Key]
35
+ : Options[Key]
39
36
  }
40
37
  }
41
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/mdx",
3
- "version": "16.0.1-canary.2",
3
+ "version": "16.0.1-canary.3",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "repository": {