import ts from 'typescript'; export type PartialDiagnostic = Omit & { file?: ts.SourceFile; start?: number; length?: number; /** If we should populate `file`, `source`, `start` and `length` with this node information */ node?: ts.Node; /** @default Error */ category?: ts.DiagnosticCategory; }; /** * A KitaError instance is thrown when something goes wrong during the parsing, resolving or generation process. * * All errors that you can expect to be thrown by Kita are subclasses of this class. */ export declare abstract class KitaError extends Error { /** This property can be mutated at runtime by the user to indicate that the error has been resolved or handled. */ suppress: boolean; /** * The error type. * * @example 'validator' | 'parser' */ type?: string; /** * The error code. * * This is a 3 digit number, where the first digit is the category of the error, and the last 2 digits are the error * code. * * | Code | Category | * | ---- | ------------------------- | * | 1 | General | * | 2 | Config | * | 3 | Parser | * | 4 | Validator | * | 5 | Formatter | * | 6 | ts-html-plugin (external) | */ readonly code: number; readonly diagnostic: ts.Diagnostic & { __kita: true; }; constructor(diagnostic: PartialDiagnostic); static createDiagnostic(diagnostic: PartialDiagnostic): ts.Diagnostic & { __kita: true; }; } /** A KitaError instance is thrown when something goes wrong during the parsing, resolving or generation process. */ export declare class UnknownKitaError extends KitaError { readonly data?: unknown; constructor(message: string, data?: unknown); } export declare class UnknownNodeError extends KitaError { constructor(node: ts.Node, messageText: string); } //# sourceMappingURL=base.d.ts.map