index.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import type {Root} from 'mdast'
  2. import type {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
  3. import type {Extension as MicromarkExtension} from 'micromark-util-types'
  4. import type {Plugin} from 'unified'
  5. import type {Options} from './lib/index.js'
  6. export type {Options} from './lib/index.js'
  7. /**
  8. * Add support for parsing from markdown.
  9. *
  10. * @this
  11. * Unified processor.
  12. * @param
  13. * Configuration (optional).
  14. * @returns
  15. * Nothing.
  16. */
  17. declare const remarkParse: Plugin<
  18. [(Readonly<Options> | null | undefined)?],
  19. string,
  20. Root
  21. >
  22. export default remarkParse
  23. // Add custom settings supported when `remark-parse` is added.
  24. declare module 'unified' {
  25. interface Settings extends Options {}
  26. interface Data {
  27. /**
  28. * List of `micromark` extensions to use.
  29. *
  30. * This type is registered by `remark-parse`.
  31. * Values can be registered by remark plugins that extend `micromark` and
  32. * `mdast-util-from-markdown`.
  33. * See {@link MicromarkExtension | `Extension`} from
  34. * {@link https://github.com/micromark/micromark/tree/main/packages/micromark-util-types | `micromark-util-types`}.
  35. */
  36. micromarkExtensions?: MicromarkExtension[]
  37. /**
  38. * List of `mdast-util-from-markdown` extensions to use.
  39. *
  40. * This type is registered by `remark-parse`.
  41. * Values can be registered by remark plugins that extend `micromark` and
  42. * `mdast-util-from-markdown`.
  43. * See {@link FromMarkdownExtension | `Extension`} from
  44. * {@link https://github.com/syntax-tree/mdast-util-from-markdown#extension | `mdast-util-from-markdown`}.
  45. */
  46. fromMarkdownExtensions?: Array<
  47. FromMarkdownExtension[] | FromMarkdownExtension
  48. >
  49. }
  50. }