| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import type {Data, Literal} from 'mdast'
- export {mathFromMarkdown, mathToMarkdown} from './lib/index.js'
- export type {ToOptions} from './lib/index.js'
- /**
- * Math (flow).
- */
- export interface Math extends Literal {
- /**
- * Node type of math (flow).
- */
- type: 'math'
- /**
- * Custom information relating to the node.
- */
- meta?: string | null | undefined
- /**
- * Data associated with the mdast math (flow).
- */
- data?: MathData | undefined
- }
- /**
- * Info associated with mdast math (flow) nodes by the ecosystem.
- */
- export interface MathData extends Data {}
- /**
- * Math (text).
- */
- export interface InlineMath extends Literal {
- /**
- * Node type of math (text).
- */
- type: 'inlineMath'
- /**
- * Data associated with the mdast math (text).
- */
- data?: InlineMathData | undefined
- }
- /**
- * Info associated with mdast math (text) nodes by the ecosystem.
- */
- export interface InlineMathData extends Data {}
- // Add custom data tracked to turn markdown into a tree.
- declare module 'mdast-util-from-markdown' {
- interface CompileData {
- /**
- * Whether we’re in math (flow).
- */
- mathFlowInside?: boolean | undefined
- }
- }
- // Add custom data tracked to turn a tree into markdown.
- declare module 'mdast-util-to-markdown' {
- interface ConstructNameMap {
- /**
- * Math (flow).
- *
- * ```markdown
- * > | $$
- * ^^
- * > | a
- * ^
- * > | $$
- * ^^
- * ```
- */
- mathFlow: 'mathFlow'
- /**
- * Math (flow) meta flag.
- *
- * ```markdown
- * > | $$a
- * ^
- * | b
- * | $$
- * ```
- */
- mathFlowMeta: 'mathFlowMeta'
- }
- }
- // Add nodes to tree.
- declare module 'mdast' {
- interface BlockContentMap {
- math: Math
- }
- interface PhrasingContentMap {
- inlineMath: InlineMath
- }
- interface RootContentMap {
- inlineMath: InlineMath
- math: Math
- }
- }
|