/** * General text-parsing utilities used across validators, completions, and hover providers. */ /** * Returns all start offsets of `search` within `text`. * @param text - Source text to search. * @param search - Substring to find. * @returns Array of start offsets where the substring occurs. */ export declare function findAllOccurrences(text: string, search: string): number[]; /** * Counts the number of top-level arguments in a function call starting at `openParenPos`. * Runs on sanitized text so commas inside strings/comments don't produce false positives. * * Returns 0 for empty `()`, `commas + 1` otherwise, or -1 if no closing paren is found. * @param text - Sanitized source text. * @param openParenPos - Index of the opening parenthesis. * @returns Argument count, or -1 if the argument list is unclosed. */ export declare function countFunctionArguments(text: string, openParenPos: number): number; export interface ArgumentSpan { value: string; start: number; end: number; } /** * Extracts each top-level argument's text and absolute position from a function call. * Returns null when the argument list is not properly closed. * @param text - Source text. * @param openParenPos - Index of the opening parenthesis. * @returns Array of ArgumentSpan objects, or null if the list is unclosed. */ export declare function extractFunctionArguments(text: string, openParenPos: number): ArgumentSpan[] | null; /** * Infers the literal type of a trimmed argument string. * Returns null for variables, expressions, or nested calls. * @param arg - Trimmed argument string. * @returns Literal type string, or null if not a literal. */ export declare function inferLiteralType(arg: string): 'string' | 'number' | 'boolean' | null; /** * Returns the word boundaries around a character position in a line. * @param line - The line text. * @param character - The character offset within the line. * @returns Start and end offsets of the word, or null if none. */ export declare function getWordRangeAtPosition(line: string, character: number): { start: number; end: number; } | null; /** * Walk backward from the cursor to find the enclosing function call name * and the current parameter index (0-based comma count). * @param textUpToCursor - Document text from start up to the cursor position. * @returns Function context object, or null if not inside a function call. */ export declare function findFunctionContext(textUpToCursor: string): { functionName: string; paramIndex: number; argValues: string[]; } | null; //# sourceMappingURL=text.d.ts.map