UNPKG

@yozora/tokenizer-admonition

Version:
42 lines (36 loc) 1.84 kB
import { IBlockToken, IBaseBlockTokenizerProps, IMatchBlockHookCreator, IParseBlockHookCreator, IBlockTokenizer } from '@yozora/core-tokenizer'; import { AdmonitionType, Admonition } from '@yozora/ast'; import FencedBlockTokenizer, { IFencedBlockHookContext, IFencedBlockToken } from '@yozora/tokenizer-fenced-block'; type T = AdmonitionType; type INode = Admonition; declare const uniqueName = "@yozora/tokenizer-admonition"; interface IToken extends IFencedBlockToken<T> { /** * */ children?: IBlockToken[]; } type IThis = IFencedBlockHookContext<T>; type ITokenizerProps = Partial<IBaseBlockTokenizerProps>; /** * A code fence is a sequence of at least three consecutive backtick characters * (`) or tildes (~). (Tildes and backticks cannot be mixed.) A fenced code * block begins with a code fence, indented no more than three spaces. * * @see https://github.com/syntax-tree/mdast#code * @see https://github.github.com/gfm/#code-fence */ declare const match: IMatchBlockHookCreator<T, IToken, IThis>; declare const parse: IParseBlockHookCreator<T, IToken, INode, IThis>; /** * Lexical Analyzer for Admonition. * @see https://github.com/syntax-tree/mdast#code * @see https://github.github.com/gfm/#code-fence */ declare class AdmonitionTokenizer extends FencedBlockTokenizer<T, INode, IThis> implements IBlockTokenizer<T, IToken, INode, IThis> { constructor(props?: ITokenizerProps); readonly match: IMatchBlockHookCreator<T, IToken, IThis>; readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis>; } export { AdmonitionTokenizer, uniqueName as AdmonitionTokenizerName, match as admonitionMatch, parse as admonitionParse, AdmonitionTokenizer as default }; export type { IThis as IAdmonitionHookContext, IToken as IAdmonitionToken, ITokenizerProps as IAdmonitionTokenizerProps };