import { BlockNode, Node, Root } from "./ast"; import { Environment } from "./environment"; import { Token, TokenStream } from "./token"; import { Tag } from "./tag"; export interface Parser { parse(stream: TokenStream): Root; /** * Parse a block of tokens from the given stream until an end * tag is found or the end of the stream is reached. * * @param stream - A template token stream. * @param end - A set of tag names that indicate the end of the * block. * @param token - The token to store on the block. Defaults to the * current token in the stream. */ parseBlock(stream: TokenStream, end: Set, token?: Token): BlockNode; /** * Like {@link parseBlock}, but read until the end of the stream. * Useful for the `liquid` tag. * * @param stream - A template token stream. */ parseLiquid(stream: TokenStream): BlockNode; } export declare class TemplateParser implements Parser { readonly environment: Environment; constructor(environment: Environment); parse(stream: TokenStream): Root; parseBlock(stream: TokenStream, end: Set, token?: Token): BlockNode; parseLiquid(stream: TokenStream): BlockNode; protected getTag(token: Token): Tag; protected parseStatement(stream: TokenStream): Node; }