import type es from 'estree'; import type { Node, Value } from '../types'; import { RuntimeSourceError } from './base'; export declare class BuiltInFunctionError extends RuntimeSourceError { private readonly explanation; constructor(explanation: string); explain(): string; elaborate(): string; } export declare class InterruptedError extends RuntimeSourceError { explain(): string; elaborate(): string; } /** * General Error type to represent RuntimeErrors that aren't thrown by * Source */ export declare class ExceptionError extends RuntimeSourceError { readonly error: Error; private readonly _location; constructor(error: Error, location?: es.SourceLocation | null); get location(): es.SourceLocation; explain(): string; elaborate(): string; } export declare class MaximumStackLimitExceededError extends RuntimeSourceError { private readonly calls; static MAX_CALLS_TO_SHOW: number; private customGenerator; constructor(node: Node, calls: es.CallExpression[]); explain(): string; elaborate(): string; } /** * Error thrown when a value that isn't a function is called. Usually thrown by `callIfRightFuncAndArgs`. */ export declare class CallingNonFunctionValueError extends RuntimeSourceError { /** * Value being called */ private readonly callee; constructor( /** * Value being called */ callee: Value, /** * The {@link es.CallExpression| Call Expression} that is responsible for calling the * non-function value */ node: es.CallExpression); explain(): string; elaborate(): string; } /** * Error thrown when an attempt to access an undefined variable is made */ export declare class UndefinedVariableError extends RuntimeSourceError { readonly varname: string; constructor(varname: string, node: Node); explain(): string; elaborate(): string; } /** * Error thrown when a variable is accessed in the temporal dead zone */ export declare class UnassignedVariableError extends RuntimeSourceError { readonly varname: string; constructor(varname: string, node: Node); explain(): string; elaborate(): string; } /** * Error thrown when a function is called with the incorrect number of arguments. Usually thrown by * `callIfRightFuncAndArgs` */ declare abstract class InvalidNumberOfArgumentsError extends RuntimeSourceError { /** * Number of arguments the function was called with */ protected readonly received: number; /** * Number of arguments (either minimum or maximum) the function * was expecting */ protected readonly requirement: number; /** * Set this to true if the function can take in varying numbers of arguments (including both * rest arguments and default arguments) */ protected readonly isVarArgs: boolean; /** * Name of the function */ protected readonly funcName?: string | undefined; protected readonly calleeStr: string; constructor(node: es.CallExpression, /** * Number of arguments the function was called with */ received: number, /** * Number of arguments (either minimum or maximum) the function * was expecting */ requirement: number, /** * Set this to true if the function can take in varying numbers of arguments (including both * rest arguments and default arguments) */ isVarArgs: boolean, /** * Name of the function */ funcName?: string | undefined); elaborate(): string; } /** * Error thrown by {@link callIfFuncAndRightArgs} when a function is called with too few arguments. */ export declare class TooFewArgumentsError extends InvalidNumberOfArgumentsError { explain(): string; } /** * Error thrown by {@link callIfFuncAndRightArgs} when a function is called with too many arguments. */ export declare class TooManyArgumentsError extends InvalidNumberOfArgumentsError { explain(): string; elaborate(): string; } export declare class VariableRedeclarationError extends RuntimeSourceError { private readonly varname; private readonly writable; constructor(node: es.Declaration | es.ImportSpecifier | es.ImportDefaultSpecifier | es.ImportNamespaceSpecifier, varname: string, writable: boolean); explain(): string; elaborate(): string; } export declare class ConstAssignmentError extends RuntimeSourceError { private readonly varname; constructor(node: Node, varname: string); explain(): string; elaborate(): string; } export declare class GetPropertyError extends RuntimeSourceError { private readonly obj; private readonly prop; constructor(node: Node, obj: Value, prop: string); explain(): string; elaborate(): string; } export declare class GetInheritedPropertyError extends RuntimeSourceError { private readonly obj; private readonly prop; constructor(node: Node, obj: Value, prop: string); explain(): string; elaborate(): string; } export declare class SetPropertyError extends RuntimeSourceError { private readonly obj; private readonly prop; constructor(node: Node, obj: Value, prop: string); explain(): string; elaborate(): string; } export {};