renderer-options.ts 716 B

1234567891011121314151617181920
  1. import type { ComponentType } from 'react';
  2. import type { SpecialComponents } from 'react-markdown/lib/ast-to-react';
  3. import type { NormalComponents } from 'react-markdown/lib/complex-types';
  4. import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
  5. import type { PluggableList } from 'unified';
  6. export type RendererOptions = Omit<ReactMarkdownOptions, 'remarkPlugins' | 'rehypePlugins' | 'components' | 'children'> & {
  7. remarkPlugins: PluggableList,
  8. rehypePlugins: PluggableList,
  9. components?:
  10. | Partial<
  11. Omit<NormalComponents, keyof SpecialComponents>
  12. & SpecialComponents
  13. & {
  14. [elem: string]: ComponentType<any>,
  15. }
  16. >
  17. | undefined
  18. };