import type { Token } from './tokenizer'; import { ParserBase } from './base'; import type { LiquidTagEnvelope, LiquidOpenWhitespace, LiquidCloseWhitespace } from './factories'; import { RawMarkupKinds } from '../ast'; import type { LiquidRawTag, LiquidNode, TextNode, LiquidVariableOutput } from '../ast'; import type { TagDefinitionRaw } from '../environment'; /** * Interface capturing what raw-tag free functions need from the * DocumentParser. The parser class satisfies this contract, keeping * the coupling explicit and narrow. */ export interface RawParserDelegate extends ParserBase { rawParseHtml: boolean; parseLiquidVariableOutput(): LiquidVariableOutput; parseLiquidTag(): LiquidRawTag | import('../ast').LiquidTag; } export declare function parseRawTag(parser: RawParserDelegate, def: TagDefinitionRaw, envelope: LiquidTagEnvelope, closeToken: Token): LiquidRawTag; export declare function parseLiquidInRange(parser: RawParserDelegate, _bodyStart: number, bodyEnd: number): (LiquidNode | TextNode)[]; export declare function parseRawTagBody(parser: RawParserDelegate, def: TagDefinitionRaw, tagName: string, bodyStart: number, bodyEnd: number): (LiquidNode | TextNode)[]; /** * Result of scanning for a raw tag's end tag in the source string. * * We scan the source directly (rather than the token stream) because the * tokenizer doesn't know about raw-tag semantics. Content inside a raw * tag body may contain `{%` sequences that the tokenizer greedily enters * as LiquidTag mode, mangling the tokens around the real end tag. */ export interface EndTagScanResult { /** Source offset where the end tag starts (the `{`). */ tagStart: number; /** Source offset where the end tag ends (after `%}`). */ tagEnd: number; /** Opening whitespace-strip marker: `'-'` or `''`. */ wsStart: LiquidOpenWhitespace; /** Closing whitespace-strip marker: `'-'` or `''`. */ wsEnd: LiquidCloseWhitespace; } export declare function scanForEndTag(parser: ParserBase, endTagName: string): EndTagScanResult | null; export declare function rawMarkupKindForTag(tagName: string, bodySource?: string): RawMarkupKinds;