export interface IDiagnosticReporterOptions { stackSize?: number; } export type GenericDiagnostic = { kind: K; details: { message: string; createdAt: Date; } & T; }; export type DiagnosticKind = 'error' | 'warning' | 'info'; export type DiagnosticListener = (diagnostic: { kind: T; } & Diagnostic extends infer U ? U : never) => void | Promise; export type DiagnosticEvent = 'diagnostic' | `diagnostic.${DiagnosticKind}`; export type GetEventListener = E extends 'diagnostic' ? DiagnosticListener : E extends `diagnostic.${infer K}` ? K extends DiagnosticKind ? DiagnosticListener : never : never; export type Diagnostic = ErrorDiagnostic | WarningDiagnostic | InfoDiagnostic; export type ErrorDiagnosticSeverity = 'fatal' | 'error' | 'silly'; export type ErrorDiagnostic = GenericDiagnostic<'error', { name: string; severity: ErrorDiagnosticSeverity; error: Error; }>; export type WarningDiagnostic = GenericDiagnostic<'warning', { origin?: string; }>; export type InfoDiagnostic = GenericDiagnostic<'info', { origin?: string; params?: T; }>; export interface IDiagnosticReporter { stack: { readonly size: number; readonly items: Diagnostic[]; }; report(diagnostic: Diagnostic): IDiagnosticReporter; onDiagnostic(listener: DiagnosticListener): IDiagnosticReporter; on(kind: T, listener: DiagnosticListener): IDiagnosticReporter; } declare const createDiagnosticReporter: (options?: IDiagnosticReporterOptions) => IDiagnosticReporter; export { createDiagnosticReporter }; //# sourceMappingURL=diagnostic.d.ts.map