index.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import type {Root} from 'mdast'
  2. import type {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'
  3. import type {Plugin} from 'unified'
  4. import type {Options} from './lib/index.js'
  5. export type {Options} from './lib/index.js'
  6. /**
  7. * Add support for serializing to markdown.
  8. *
  9. * @this
  10. * Unified processor.
  11. * @param
  12. * Configuration (optional).
  13. * @returns
  14. * Nothing.
  15. */
  16. declare const remarkStringify: Plugin<
  17. [(Readonly<Options> | null | undefined)?],
  18. Root,
  19. string
  20. >
  21. export default remarkStringify
  22. // Add custom settings supported when `remark-stringify` is added.
  23. declare module 'unified' {
  24. interface Settings extends Options {}
  25. interface Data {
  26. /**
  27. * List of `mdast-util-to-markdown` extensions to use.
  28. *
  29. * This type is registered by `remark-stringify`.
  30. * Values can be registered by remark plugins that extend
  31. * `mdast-util-to-markdown`.
  32. * See {@link ToMarkdownExtension | `Options`} from
  33. * {@link https://github.com/syntax-tree/mdast-util-to-markdown#options | `mdast-util-to-markdown`}.
  34. */
  35. toMarkdownExtensions?: ToMarkdownExtension[]
  36. }
  37. }