export declare class JQHTMLParseError extends Error {
line: number;
column: number;
endLine?: number;
endColumn?: number;
source?: string;
filename?: string;
severity: 'error' | 'warning';
private base_message;
private _suggestion?;
constructor(message: string, line: number, column: number, source?: string, filename?: string);
/**
* Guidance printed after the code snippet. The message always carries the current
* suggestion exactly once: assigning one rebuilds the message from scratch, so a
* suggestion set after construction replaces the automatic one instead of being
* left out of the message or printed beside it.
*/
get suggestion(): string | undefined;
set suggestion(value: string | undefined);
private buildErrorMessage;
private getCodeSnippet;
}
export declare function unclosedError(type: string, name: string, line: number, column: number, source?: string, filename?: string): JQHTMLParseError;
export declare function mismatchedTagError(opening: string, closing: string, line: number, column: number, source?: string, filename?: string): JQHTMLParseError;
export declare function syntaxError(message: string, line: number, column: number, source?: string, filename?: string): JQHTMLParseError;
export declare function getSuggestion(error: string): string;
export declare class ErrorCollector {
private errors;
private maxErrors;
constructor(maxErrors?: number);
add(error: JQHTMLParseError): void;
hasErrors(): boolean;
getErrors(): JQHTMLParseError[];
throwIfErrors(): void;
}
/** Where a %> hidden in a // comment sits (1-based lines and columns). */
export interface HiddenCloseLocation {
line: number;
column: number;
close_column: number;
in_attribute?: boolean;
}
/**
* Add an explanation to a compile error for each %> that a // comment hid. A line
* comment in template code runs to the end of its line, so `<% a(); // note %>`
* does not close the tag; the block then runs on to a later %> (and usually fails
* to compile) or is never closed. Returns the error.
*/
export declare function add_hidden_close_note(error: any, hidden: HiddenCloseLocation[]): any;
//# sourceMappingURL=errors.d.ts.map