Skip to content

Commit

Permalink
Move PluginOptions to avoid reference to mdast-util-to-hast
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Mar 14, 2022
1 parent 85feb96 commit baf0ac6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lib/complex-types.ts
@@ -1,6 +1,8 @@
import type {ReactNode, ComponentType, ComponentPropsWithoutRef} from 'react'
import type {Position} from 'unist'
import type {Element} from 'hast'
import type {PluggableList} from 'unified'
import type {Options as RemarkRehypeOptions} from 'remark-rehype'

/* File for types which are not handled correctly in JSDoc mode */

Expand All @@ -26,3 +28,9 @@ export type NormalComponents = {
| keyof JSX.IntrinsicElements
| ComponentType<ComponentPropsWithoutRef<TagName> & ReactMarkdownProps>
}

export interface PluginOptions {
remarkPlugins?: PluggableList
rehypePlugins?: PluggableList
remarkRehypeOptions?: RemarkRehypeOptions
}
6 changes: 1 addition & 5 deletions lib/react-markdown.js
Expand Up @@ -3,17 +3,13 @@
* @typedef {import('react').ReactElement<{}>} ReactElement
* @typedef {import('unified').PluggableList} PluggableList
* @typedef {import('hast').Root} Root
* @typedef {import('./complex-types').PluginOptions} PluginOptions
* @typedef {import('./rehype-filter.js').Options} FilterOptions
* @typedef {import('./ast-to-react.js').Options} TransformOptions
*
* @typedef CoreOptions
* @property {string} children
*
* @typedef PluginOptions
* @property {PluggableList} [remarkPlugins=[]]
* @property {PluggableList} [rehypePlugins=[]]
* @property {import('remark-rehype').Options} [remarkRehypeOptions={}]
*
* @typedef LayoutOptions
* @property {string} [className]
*
Expand Down

0 comments on commit baf0ac6

Please sign in to comment.