/** * Comment utilities that operate on the raw query string without parsing it. * * These intentionally do NOT share the lexer's scanner: the lexer is strict * (it throws on unterminated comments and unexpected characters), while these * utilities are lenient so they can be safely applied to any string - including * invalid SOQL - without throwing. Only two constructs are recognized: * string literals ('...' with backslash escapes, so comment markers inside * strings are never treated as comments) and the two comment forms. */ export interface SoqlComment { type: 'line' | 'block'; /** Full comment text, including the `//` or `/* *\/` delimiters */ text: string; /** Index of the first character of the comment in the input string */ start: number; /** Index just past the last character of the comment (exclusive) */ end: number; } /** * Returns all comments found in a query string, in order of appearance. * Does not parse or validate the query and never throws. * @param soql raw query string (does not need to be valid SOQL) * @returns comments with their type, text (including delimiters), and position */ export declare function getComments(soql: string): SoqlComment[]; /** * Returns `true` if the query string contains at least one comment. * Does not parse or validate the query and never throws. * @param soql raw query string (does not need to be valid SOQL) */ export declare function hasComments(soql: string): boolean; /** * Removes all comments from a query string without otherwise modifying it - * no parsing, no reformatting, no whitespace or keyword normalization. * If the string contains no comments, the original string is returned as-is, * so this is safe to call unconditionally on every query. * * A single space is inserted in place of a removed comment when it directly * touched non-whitespace on both sides (e.g. `SELECT Id/*c*\/FROM` becomes * `SELECT Id FROM`) so adjacent tokens are never merged. Whitespace that * surrounded a comment is left as-is. * @param soql raw query string (does not need to be valid SOQL) * @returns the query with comments removed, or the original string if there were none */ export declare function stripComments(soql: string): string;