error.d.ts 913B

123456789101112131415161718192021222324
  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. */
  6. export 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. */
  15. export declare class FatalError extends Error {
  16. message: string;
  17. innerError: Error | undefined;
  18. static NAME: string;
  19. constructor(message: string, innerError?: Error | undefined);
  20. }
  21. export declare function isError(possibleError: any): possibleError is Error;
  22. export declare function showWarningOnce(message: string): void;
  23. export declare function showRuleCrashWarning(message: string, ruleName: string, fileName: string): void;