UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

79 lines (78 loc) 2.9 kB
import type es from 'estree'; import { ErrorSeverity, ErrorType, SourceError } from '../errors/base'; import { RuntimeSourceError } from '../errors/runtimeSourceError'; import type { Node } from '../types'; export declare class ModuleInternalError extends RuntimeSourceError { moduleName: string; error?: any | undefined; constructor(moduleName: string, error?: any | undefined, 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 {};