UNPKG

@diplodoc/markdown-translation

Version:
21 lines (20 loc) 850 B
import { TokenSubType, TokenType } from './token'; export type Configuration = { specification?: Specification; }; export type Specification = Array<SpecificationEntry>; export type SpecificationEntry = [RegExp, TokenType, TokenSubType] | [RegExp, TokenType]; export type TokenizerGenerator = Generator<Token | null, void, Token | undefined>; export declare class Tokenizer implements TokenizerGenerator { private input; private cursor; private specification; constructor(input: string, configuration?: Configuration); tokenize(this: TokenizerGenerator & this): Token[]; [Symbol.iterator](this: TokenizerGenerator & this): Generator<Token, void, unknown>; next(): IteratorResult<Token | null>; return(): IteratorResult<Token | null, any>; throw(): IteratorResult<Token>; private match; private done; }