/** * VariableLineParser * * Parses variable lines from HTTP request content. * Handles REST Client @name directive and variable assignments. * * Supported syntax: * - @name requestId (REST Client named request) * - @key = value (variable assignment) * - @key = $.jsonpath (JSONPath for response variable extraction) */ import { VariableUpdate } from '../types'; /** * Type of variable line */ export type VariableLineType = 'name' | 'variable' | 'jsonpath' | 'invalid'; /** * Result from parsing a variable line */ export interface VariableLineResult { type: VariableLineType; /** Request ID for @name directive */ requestId?: string; /** Variable key */ key?: string; /** Variable value or JSONPath expression */ value?: string; /** Whether value is a JSONPath expression */ isJsonPath?: boolean; /** Error message for invalid lines */ error?: string; } export declare class VariableLineParser { /** * Check if a line is a variable line (starts with @) */ isVariableLine(line: string): boolean; /** * Parse a single variable line */ parse(line: string): VariableLineResult; /** * Parse multiple lines, returning results for variable lines only */ parseMultiple(lines: string[]): VariableLineResult[]; /** * Extract all variable lines from content */ extractFromContent(content: string): VariableLineResult[]; /** * Convert a parse result to VariableUpdate format * Returns null for name directives or invalid results */ toVariableUpdate(result: VariableLineResult): VariableUpdate | null; /** * Check if a line is a variable line (starts with @) */ static isVariableLine(line: string): boolean; /** * Parse a single variable line */ static parse(line: string): VariableLineResult; }