[79a0317] | 1 | declare module 'pretty-error' {
|
---|
| 2 | namespace PrettyError {
|
---|
| 3 | function start(): any;
|
---|
| 4 | function stop(): any;
|
---|
| 5 |
|
---|
| 6 | class ParsedError {
|
---|
| 7 | constructor(error: Error);
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | interface ConfigObject {
|
---|
| 11 | skipPackages?: boolean | string[];
|
---|
| 12 | skipPaths?: boolean | string[];
|
---|
| 13 | skip?: boolean | PrettyError.Callback | PrettyError.Callback[];
|
---|
| 14 | maxItems?: number;
|
---|
| 15 | skipNodeFiles?: boolean | any; // assuming this is optional
|
---|
| 16 | filters?: boolean | PrettyError.Callback | PrettyError.Callback[];
|
---|
| 17 | parsedErrorFilters?:
|
---|
| 18 | | boolean
|
---|
| 19 | | PrettyError.Callback
|
---|
| 20 | | PrettyError.Callback[];
|
---|
| 21 | aliases?: boolean | Object;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | type Callback = (traceLine: Object | any, lineNumber: number) => boolean;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | class PrettyError {
|
---|
| 28 | constructor();
|
---|
| 29 |
|
---|
| 30 | start(): PrettyError;
|
---|
| 31 | stop(): any;
|
---|
| 32 | config(configObject: PrettyError.ConfigObject): PrettyError;
|
---|
| 33 | withoutColors(): PrettyError;
|
---|
| 34 | withColors(): PrettyError;
|
---|
| 35 | skipPackage(...packages: string[]): PrettyError;
|
---|
| 36 | unskipPackage(...packages: string[]): PrettyError;
|
---|
| 37 | unskipAllPackages(): PrettyError;
|
---|
| 38 | skipPath(...paths: string[]): PrettyError;
|
---|
| 39 | unskipPath(...paths: string[]): PrettyError;
|
---|
| 40 | unskipAllPaths(): PrettyError;
|
---|
| 41 | skip(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 42 | unskip(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 43 | unskipAll(): PrettyError;
|
---|
| 44 | skipNodeFiles(): any;
|
---|
| 45 | unskipNodeFiles(): any;
|
---|
| 46 | filter(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 47 | removeFilter(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 48 | removeAllFilters(): PrettyError;
|
---|
| 49 | filterParsedError(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 50 | removeParsedErrorFilter(callbacks: PrettyError.Callback): PrettyError;
|
---|
| 51 | removeAllParsedErrorFilters(): PrettyError;
|
---|
| 52 | setMaxItems(maxItems: number): PrettyError;
|
---|
| 53 | alias(stringOrRx: string, alias: string): PrettyError;
|
---|
| 54 | removeAlias(stringOrRx: string): PrettyError;
|
---|
| 55 | removeAllAliases(): PrettyError;
|
---|
| 56 | appendStyle(toAppend: Object): PrettyError;
|
---|
| 57 | render(
|
---|
| 58 | e: PrettyError.ParsedError,
|
---|
| 59 | logIt?: boolean,
|
---|
| 60 | useColors?: boolean
|
---|
| 61 | ): string;
|
---|
| 62 | getObject(e: Object): Object;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | export = PrettyError;
|
---|
| 66 | }
|
---|