|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const fromMarkdown: (( |
|
value: Value, |
|
encoding: Encoding, |
|
options?: Options | null | undefined |
|
) => Root) & |
|
((value: Value, options?: Options | null | undefined) => Root) |
|
export type Encoding = import('micromark-util-types').Encoding |
|
export type Event = import('micromark-util-types').Event |
|
export type ParseOptions = import('micromark-util-types').ParseOptions |
|
export type Token = import('micromark-util-types').Token |
|
export type TokenizeContext = import('micromark-util-types').TokenizeContext |
|
export type Value = import('micromark-util-types').Value |
|
export type UnistParent = import('unist').Parent |
|
export type Point = import('unist').Point |
|
export type PhrasingContent = import('mdast').PhrasingContent |
|
export type StaticPhrasingContent = import('mdast').StaticPhrasingContent |
|
export type Content = import('mdast').Content |
|
export type Break = import('mdast').Break |
|
export type Blockquote = import('mdast').Blockquote |
|
export type Code = import('mdast').Code |
|
export type Definition = import('mdast').Definition |
|
export type Emphasis = import('mdast').Emphasis |
|
export type Heading = import('mdast').Heading |
|
export type HTML = import('mdast').HTML |
|
export type Image = import('mdast').Image |
|
export type ImageReference = import('mdast').ImageReference |
|
export type InlineCode = import('mdast').InlineCode |
|
export type Link = import('mdast').Link |
|
export type LinkReference = import('mdast').LinkReference |
|
export type List = import('mdast').List |
|
export type ListItem = import('mdast').ListItem |
|
export type Paragraph = import('mdast').Paragraph |
|
export type Root = import('mdast').Root |
|
export type Strong = import('mdast').Strong |
|
export type Text = import('mdast').Text |
|
export type ThematicBreak = import('mdast').ThematicBreak |
|
export type ReferenceType = import('mdast').ReferenceType |
|
export type CompileData = import('../index.js').CompileData |
|
export type Node = Root | Content |
|
export type Parent = Extract<Node, UnistParent> |
|
export type Fragment = Omit<UnistParent, 'type' | 'children'> & { |
|
type: 'fragment' |
|
children: Array<PhrasingContent> |
|
} |
|
|
|
|
|
|
|
export type Transform = (tree: Root) => Root | undefined | null | void |
|
|
|
|
|
|
|
export type Handle = (this: CompileContext, token: Token) => void |
|
|
|
|
|
|
|
export type Handles = Record<string, Handle> |
|
|
|
|
|
|
|
|
|
export type OnEnterError = ( |
|
this: Omit<CompileContext, 'sliceSerialize'>, |
|
left: Token | undefined, |
|
right: Token |
|
) => void |
|
|
|
|
|
|
|
|
|
export type OnExitError = ( |
|
this: Omit<CompileContext, 'sliceSerialize'>, |
|
left: Token, |
|
right: Token |
|
) => void |
|
|
|
|
|
|
|
|
|
export type TokenTuple = [Token, OnEnterError | undefined] |
|
|
|
|
|
|
|
|
|
|
|
export type Config = { |
|
|
|
|
|
|
|
canContainEols: Array<string> |
|
|
|
|
|
|
|
enter: Handles |
|
|
|
|
|
|
|
exit: Handles |
|
|
|
|
|
|
|
transforms: Array<Transform> |
|
} |
|
|
|
|
|
|
|
export type Extension = Partial<Config> |
|
|
|
|
|
|
|
export type CompileContext = { |
|
|
|
|
|
|
|
stack: Array<Node | Fragment> |
|
|
|
|
|
|
|
tokenStack: Array<TokenTuple> |
|
|
|
|
|
|
|
getData: <Key extends keyof import('../index.js').CompileData>( |
|
key: Key |
|
) => import('../index.js').CompileData[Key] |
|
|
|
|
|
|
|
setData: <Key_1 extends keyof import('../index.js').CompileData>( |
|
key: Key_1, |
|
value?: import('../index.js').CompileData[Key_1] | undefined |
|
) => void |
|
|
|
|
|
|
|
buffer: (this: CompileContext) => void |
|
|
|
|
|
|
|
resume: (this: CompileContext) => string |
|
|
|
|
|
|
|
enter: <Kind extends Node>( |
|
this: CompileContext, |
|
node: Kind, |
|
token: Token, |
|
onError?: OnEnterError |
|
) => Kind |
|
|
|
|
|
|
|
exit: (this: CompileContext, token: Token, onError?: OnExitError) => Node |
|
|
|
|
|
|
|
sliceSerialize: TokenizeContext['sliceSerialize'] |
|
|
|
|
|
|
|
config: Config |
|
} |
|
|
|
|
|
|
|
export type FromMarkdownOptions = { |
|
|
|
|
|
|
|
mdastExtensions?: Array<Extension | Array<Extension>> | null | undefined |
|
} |
|
|
|
|
|
|
|
export type Options = ParseOptions & FromMarkdownOptions |
|
|