UNPKG

@ts-bridge/cli

Version:

Bridge the gap between ES modules and CommonJS modules with an easy-to-use alternative to `tsc`.

58 lines 2.11 kB
import type { Diagnostic } from 'typescript'; /** * Get the error's `code` property if it has one. * * @param error - The error to get the code for. * @returns The error code, or `null`. */ export declare function getErrorCode(error: unknown): string | null; /** * An error thrown when a TypeScript build fails. This will format the * diagnostics with colors and context. */ export declare class TypeScriptError extends Error { /** * Create a new TypeScript error from the given message and diagnostic. This * will create a new error message with the diagnostic formatted with colors. * * @param message - The error message. * @param diagnostic - The TypeScript diagnostic. */ constructor(message: string, diagnostic: Diagnostic); /** * Create a new TypeScript error from the given message and diagnostics. This * will create a new error message with the diagnostics formatted with colors. * * @param message - The error message. * @param diagnostics - The TypeScript diagnostics. */ constructor(message: string, diagnostics: readonly Diagnostic[]); } /** * An error thrown when a Node.js operation fails. This will try and get a * human-readable error message from the error code. */ export declare class NodeError extends Error { /** * Create a new Node.js error from the given message and original error. This * will try and get a human-readable error message from the error code. * * @param message - The error message. * @param originalError - The original error. */ constructor(message: string, originalError: unknown); } /** * An error thrown when a worker fails. This will include the original error * message in the error message. */ export declare class WorkerError extends Error { /** * Create a new worker error from the given message and original error. * * @param message - The error message. * @param originalError - The original error. */ constructor(message: string, originalError: unknown); } //# sourceMappingURL=errors.d.ts.map