1 |
|
2 | import type { ErrorCode } from './types';
|
3 | export declare class AppError extends Error {
|
4 | code?: ErrorCode;
|
5 | cause?: Error;
|
6 | constructor(errorContext: ErrorContext, error?: NodeJS.ErrnoException);
|
7 | }
|
8 | export declare const SOURCE_MAP_INFO_URL = "https://github.com/danvk/source-map-explorer/blob/master/README.md#generating-source-maps";
|
9 | interface CommonErrorContext {
|
10 | code: 'NoBundles' | 'NoSourceMap' | 'CannotSaveFile' | 'CannotCreateTempFile' | 'CannotOpenCoverageFile' | 'NoCoverageMatches' | 'Unknown';
|
11 | }
|
12 | interface OneSourceSourceMapErrorContext {
|
13 | code: 'OneSourceSourceMap';
|
14 | filename: string;
|
15 | }
|
16 | interface UnmappedBytesErrorContext {
|
17 | code: 'UnmappedBytes';
|
18 | totalBytes: number;
|
19 | unmappedBytes: number;
|
20 | }
|
21 | interface InvalidMappingLineErrorContext {
|
22 | code: 'InvalidMappingLine';
|
23 | generatedLine: number;
|
24 | maxLine: number;
|
25 | }
|
26 | interface InvalidMappingColumnErrorContext {
|
27 | code: 'InvalidMappingColumn';
|
28 | generatedLine: number;
|
29 | generatedColumn: number;
|
30 | maxColumn: number;
|
31 | }
|
32 | interface CannotOpenTempFileErrorContext {
|
33 | code: 'CannotOpenTempFile';
|
34 | error: Buffer;
|
35 | tempFile: string;
|
36 | }
|
37 | export declare type ErrorContext = CommonErrorContext | OneSourceSourceMapErrorContext | UnmappedBytesErrorContext | InvalidMappingLineErrorContext | InvalidMappingColumnErrorContext | CannotOpenTempFileErrorContext;
|
38 | export declare function getErrorMessage(context: ErrorContext): string;
|
39 | export {};
|