diff --git a/lib/complex-types.ts b/lib/complex-types.ts index c639e7ae..aedaaf11 100644 --- a/lib/complex-types.ts +++ b/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 */ @@ -26,3 +28,9 @@ export type NormalComponents = { | keyof JSX.IntrinsicElements | ComponentType & ReactMarkdownProps> } + +export interface PluginOptions { + remarkPlugins?: PluggableList + rehypePlugins?: PluggableList + remarkRehypeOptions?: RemarkRehypeOptions +} diff --git a/lib/react-markdown.js b/lib/react-markdown.js index 6dbb085c..f3c56265 100644 --- a/lib/react-markdown.js +++ b/lib/react-markdown.js @@ -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] *