index.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. export type {
  2. CompileContext,
  3. Encoding,
  4. Extension,
  5. Handle,
  6. OnEnterError,
  7. OnExitError,
  8. Options,
  9. Token,
  10. Transform,
  11. Value
  12. } from './lib/index.js'
  13. export {fromMarkdown} from './lib/index.js'
  14. /**
  15. * Interface of tracked data.
  16. *
  17. * When working on extensions that use more data, extend the corresponding
  18. * interface to register their types:
  19. *
  20. * ```ts
  21. * declare module 'mdast-util-from-markdown' {
  22. * interface CompileData {
  23. * // Register a new field.
  24. * mathFlowInside?: boolean | undefined
  25. * }
  26. * }
  27. * ```
  28. */
  29. export interface CompileData {
  30. /**
  31. * Whether we’re inside a hard break.
  32. */
  33. atHardBreak?: boolean | undefined
  34. /**
  35. * Current character reference type.
  36. */
  37. characterReferenceType?:
  38. | 'characterReferenceMarkerHexadecimal'
  39. | 'characterReferenceMarkerNumeric'
  40. | undefined
  41. /**
  42. * Whether a first list item value (`1` in `1. a`) is expected.
  43. */
  44. expectingFirstListItemValue?: boolean | undefined
  45. /**
  46. * Whether we’re in flow code.
  47. */
  48. flowCodeInside?: boolean | undefined
  49. /**
  50. * Whether we’re in a reference.
  51. */
  52. inReference?: boolean | undefined
  53. /**
  54. * Whether we’re expecting a line ending from a setext heading, which can be slurped.
  55. */
  56. setextHeadingSlurpLineEnding?: boolean | undefined
  57. /**
  58. * Current reference.
  59. */
  60. referenceType?: 'collapsed' | 'full' | undefined
  61. }
  62. declare module 'micromark-util-types' {
  63. interface TokenTypeMap {
  64. listItem: 'listItem'
  65. }
  66. interface Token {
  67. _spread?: boolean
  68. }
  69. }