/// import { BrsType, ValueKind } from "./brsTypes"; import { Location } from "./lexer"; export declare class BrsError extends Error { readonly location: Location; constructor(message: string, location: Location); /** * Formats the error into a human-readable string including filename, starting and ending line * and column, and the message associated with the error, e.g.: * * `lorem.brs(1,1-3): Expected '(' after sub name` * ``` */ format(): string; } /** Wraps up the metadata associated with a type mismatch error. */ export interface TypeMismatchMetadata { /** * The base message to use for this error. Should be as helpful as possible, e.g. * "Attempting to subtract non-numeric values". */ message: string; /** The value on the left-hand side of a binary operator, or the *only* value for a unary operator. */ left: TypeAndLocation; /** The value on the right-hand side of a binary operator. */ right?: TypeAndLocation; } export declare type TypeAndLocation = { /** The type of a value involved in a type mismatch. */ type: BrsType | ValueKind; /** The location at which the offending value was resolved. */ location: Location; }; /** * Creates a "type mismatch"-like error message, but with the appropriate types specified. * @return a type mismatch error that will be tracked by this module. */ export declare class TypeMismatch extends BrsError { constructor(mismatchMetadata: TypeMismatchMetadata); } /** * Logs a detected BRS error to console. * @param err the error to log to console */ export declare function logConsoleError(err: BrsError): void; /** * Produces a function that writes errors to the given error stream. * @param errorStream write stream to write errors to. * @returns function that writes to given write stream. */ export declare function getLoggerUsing(errorStream: NodeJS.WriteStream): (err: BrsError) => boolean;