UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

78 lines (77 loc) 2.83 kB
import type es from 'estree'; import { RuntimeSourceError } from '../errors/runtimeSourceError'; import { ErrorSeverity, ErrorType, Node, SourceError } from '../types'; export declare class ModuleInternalError extends RuntimeSourceError { moduleName: string; error?: any; constructor(moduleName: string, error?: any, node?: Node); explain(): string; elaborate(): string; } declare abstract class ImportError implements SourceError { node?: Node | undefined; type: ErrorType.IMPORT; severity: ErrorSeverity; get location(): es.SourceLocation; constructor(node?: Node | undefined); abstract explain(): string; abstract elaborate(): string; } export declare class ModuleConnectionError extends ImportError { private static message; private static elaboration; constructor(node?: Node); explain(): string; elaborate(): string; } export declare class ModuleNotFoundError extends ImportError { moduleName: string; constructor(moduleName: string, node?: Node); explain(): string; elaborate(): string; } export declare class UndefinedNamespaceImportError extends ImportError { readonly moduleName: string; constructor(moduleName: string, node?: Exclude<es.ModuleDeclaration, es.ExportDefaultDeclaration> | es.ImportDeclaration['specifiers'][number] | es.ExportSpecifier); explain(): string; elaborate(): string; } export declare class UndefinedImportError extends UndefinedNamespaceImportError { readonly symbol: string; constructor(symbol: string, moduleName: string, node?: es.ImportDeclaration['specifiers'][number] | es.ExportSpecifier); explain(): string; } export declare class UndefinedDefaultImportError extends UndefinedImportError { constructor(moduleName: string, node?: es.ImportDeclaration['specifiers'][number] | es.ExportSpecifier); explain(): string; } export declare class CircularImportError extends ImportError { filePathsInCycle: string[]; constructor(filePathsInCycle: string[]); explain(): string; elaborate(): string; } export declare abstract class InvalidFilePathError extends ImportError { filePath: string; constructor(filePath: string); abstract explain(): string; abstract elaborate(): string; } export declare class IllegalCharInFilePathError extends InvalidFilePathError { explain(): string; elaborate(): string; } export declare class ConsecutiveSlashesInFilePathError extends InvalidFilePathError { explain(): string; elaborate(): string; } export declare class DuplicateImportNameError extends ImportError { readonly name: string; readonly nodes: Node[]; readonly locString: string; get location(): es.SourceLocation; constructor(name: string, nodes: Node[]); explain(): string; elaborate(): string; } export {};