import { LWCErrorInfo } from '../shared/types'; import { CompilerDiagnosticOrigin, CompilerDiagnostic, CompilerError } from './utils'; export { CompilerDiagnosticOrigin, CompilerDiagnostic, CompilerError } from './utils'; export * from './error-info'; export interface ErrorConfig { messageArgs?: any[]; origin?: CompilerDiagnosticOrigin; } export declare function generateErrorMessage(errorInfo: LWCErrorInfo, args?: any[]): string; /** * Generates a compiler diagnostic. This function is used to look up the specified errorInfo * and generate a friendly and consistent diagnostic object. Diagnostic contains * info about the error's code and its origin (filename, line, column) when applicable. * * @param {LWCErrorInfo} errorInfo The object holding the error metadata. * @param {ErrorConfig} config A config object providing any message arguments and origin info needed to create the error. * @return {CompilerDiagnostic} */ export declare function generateCompilerDiagnostic(errorInfo: LWCErrorInfo, config?: ErrorConfig): CompilerDiagnostic; /** * Generates a compiler error. This function is used to look up the specified errorInfo * and generate a friendly and consistent error object. Error object contains info about * the error's code and its origin (filename, line, column) when applicable. * * @param {LWCErrorInfo} errorInfo The object holding the error metadata. * @param {ErrorConfig} config A config object providing any message arguments and origin info needed to create the error. * @return {CompilerError} */ export declare function generateCompilerError(errorInfo: LWCErrorInfo, config?: ErrorConfig): CompilerError; export declare function invariant(condition: boolean, errorInfo: LWCErrorInfo, args?: any[]): void; /** * Normalizes a received error into a CompilerError. Adds any provided additional origin info. * @param errorInfo * @param error * @param origin * * @return {CompilerError} */ export declare function normalizeToCompilerError(errorInfo: LWCErrorInfo, error: any, origin?: CompilerDiagnosticOrigin): CompilerError; /** * Normalizes a received error into a CompilerDiagnostic. Adds any provided additional origin info. * @param error * @param origin * * @return {CompilerDiagnostic} */ export declare function normalizeToDiagnostic(errorInfo: LWCErrorInfo, error: any, origin?: CompilerDiagnosticOrigin): CompilerDiagnostic;