import { AnyMap } from "../types"; import { ErrorDescriptor } from "./errors-list"; export declare const ERROR_PREFIX = "ABLDR"; export declare class TealError extends Error { static isTealError(other: any): other is TealError; readonly errorDescriptor: ErrorDescriptor; readonly number: number; readonly parent?: Error; private readonly _isTealError; constructor(errorDescriptor: ErrorDescriptor, messageArguments?: AnyMap, parentError?: Error); } export declare class BuilderError extends Error { static isBuilderError(other: any): other is BuilderError; readonly errorDescriptor: ErrorDescriptor; readonly number: number; readonly parent?: Error; private readonly _isBuilderError; constructor(errorDescriptor: ErrorDescriptor, messageArguments?: AnyMap, parentError?: Error); } /** * This function applies error messages templates like this: * * - Template is a string which contains a variable tags. A variable tag is a * a variable name surrounded by %. Eg: %plugin1% * - A variable name is a string of alphanumeric ascii characters. * - Every variable tag is replaced by its value. * - %% is replaced by %. * - Values can't contain variable tags. * - If a variable is not present in the template, but present in the values * object, an error is thrown. * * @param template The template string. * @param values A map of variable names to their values. */ export declare function applyErrorMessageTemplate(template: string, values: { [templateVar: string]: any; }): string; /** * Replaces all the instances of [[toReplace]] by [[replacement]] in [[str]]. */ export declare function replaceAll(str: string, toReplace: string, replacement: string): string;