UNPKG

798 BTypeScriptView Raw
1import MarkdownIt = require('.');
2import Ruler = require('./ruler');
3import StateBlock = require('./rules_block/state_block');
4import Token = require('./token');
5
6declare namespace ParserBlock {
7 type RuleBlock = (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean;
8}
9
10declare class ParserBlock {
11 /**
12 * [[Ruler]] instance. Keep configuration of block rules.
13 */
14 ruler: Ruler<ParserBlock.RuleBlock>;
15
16 /**
17 * Generate tokens for input range
18 */
19 tokenize(state: StateBlock, startLine: number, endLine: number): void;
20
21 /**
22 * Process input string and push block tokens into `outTokens`
23 */
24 parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void;
25
26 State: typeof StateBlock;
27}
28
29export = ParserBlock;