import type { ErrorPayload } from 'vite'; export type BuiltinErrorTypes = 'BetterError' | 'InternalError' | 'AggregateError'; /** * Generic object representing an error with all possible data * Compatible with Gracile, Astro's and Vite's errors */ export interface ErrorWithMetadata { [name: string]: unknown; name: string; title?: string; type?: BuiltinErrorTypes & T; message: string; stack: string; hint?: string; id?: string; frame?: string; plugin?: string; pluginCode?: string; fullCode?: string; loc?: { file?: string; line?: number; column?: number; }; cause?: unknown; } interface ErrorProperties { title?: string | undefined; name: string; message?: string | undefined; location?: ErrorLocation | undefined; hint?: string | undefined; stack?: string | undefined; frame?: string | undefined; } export interface ErrorLocation { file?: string | undefined; line?: number | undefined; column?: number | undefined; } export declare class BetterError extends Error { loc: ErrorLocation | undefined; title: string | undefined; hint: string | undefined; frame: string | undefined; type: BuiltinErrorTypes | ConsumerErrorTypes; constructor(properties: ErrorProperties, options?: ErrorOptions); setLocation(location: ErrorLocation): void; setName(name: string): void; setMessage(message: string): void; setHint(hint: string): void; setFrame(source: string, location: ErrorLocation): void; static is(error: unknown): error is BetterError; } export declare class AggregateError extends BetterError { type: BuiltinErrorTypes; errors: BetterError[]; constructor(properties: ErrorProperties & { errors: BetterError[]; }, options?: ErrorOptions); static is(error: unknown): error is AggregateError; } export declare function isBetterError(error: unknown): error is BetterError; export type SSRError = Error & ErrorPayload['err']; export {}; //# sourceMappingURL=errors.d.ts.map