type.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import type MarkdownIt from 'markdown-it'
  2. import type { FilterPattern } from '@rollup/pluginutils'
  3. /**
  4. * key :componentName
  5. * value: root directory to the Component relative path
  6. */
  7. export interface WrapperComponentData { [name: string]: string }
  8. export type WrapperComponent = WrapperComponentData | boolean | string | string[] | null | undefined
  9. export interface Options {
  10. /**
  11. * Options passed to Markdown It
  12. */
  13. markdownItOptions?: MarkdownIt.Options
  14. /**
  15. * Plugins for Markdown It
  16. */
  17. markdownItUses?: (
  18. | MarkdownIt.PluginSimple
  19. | [MarkdownIt.PluginSimple | MarkdownIt.PluginWithOptions<any>, any]
  20. | any
  21. )[]
  22. /**
  23. * A function providing the Markdown It instance gets the ability to apply custom
  24. * settings/plugins
  25. */
  26. markdownItSetup?: (MarkdownIt: MarkdownIt) => void
  27. /**
  28. * Class names for wrapper div
  29. *
  30. * @default 'vite-plugin-react-markdown'
  31. */
  32. wrapperClasses?: string
  33. /**
  34. * Component name to wrapper with
  35. *
  36. * @default ViteReactMarkdown
  37. */
  38. wrapperComponentName?: string | null | undefined
  39. /**
  40. * Component Path to wrapper with
  41. * root directory to the Component relative path
  42. *
  43. * @default undefined
  44. */
  45. wrapperComponentPath?: string | null | undefined
  46. /**
  47. * used Component within .md file
  48. * @default undefined
  49. */
  50. wrapperComponent?: WrapperComponent
  51. include?: FilterPattern
  52. exclude?: FilterPattern
  53. }
  54. export interface ResolvedOptions extends Required<Options> {
  55. }