UNPKG

913 BTypeScriptView Raw
1/**
2 * Generic error typing for EcmaScript errors
3 * Define `Error` here to avoid using `Error` from @types/node.
4 * Using the `node` version causes a compilation error when this code is used as an npm library if @types/node is not already imported.
5 */
6export declare class Error {
7 name?: string;
8 message: string;
9 stack?: string;
10 constructor(message?: string);
11}
12/**
13 * Used to exit the program and display a friendly message without the callstack.
14 */
15export declare class FatalError extends Error {
16 message: string;
17 innerError: Error | undefined;
18 static NAME: string;
19 constructor(message: string, innerError?: Error | undefined);
20}
21export declare function isError(possibleError: any): possibleError is Error;
22export declare function showWarningOnce(message: string): void;
23export declare function showRuleCrashWarning(message: string, ruleName: string, fileName: string): void;