import { EnhancedPosition , PathPosition , Position } from "@azure-tools/datastore" ; export type LogLevel = "debug" | "verbose" | "information" | "warning" | "error" | "fatal" ; /**
 * Represent a location in a document.
 */ export interface SourceLocation { readonly document : string ; readonly position : Position | PathPosition ; } export interface LogInfo { /**
     * Log level
     */ readonly level : LogLevel ; /**
     * Message.
     */ readonly message : string ; /**
     * Reprensent the diagnostic code describing the type of issue.
     * Diagnostic codes could be documented to help user understand how to resolve this type of issue
     */ readonly code ? : string ; /**
     * location where the problem was found.
     */ readonly source ? : SourceLocation [ ] ; /**
     * Additional details.
     */ readonly details ? : Error | unknown ; } export interface AutorestDiagnostic { level : Extract < LogLevel , "error" | "warning" > ; /**
     * Reprensent the diagnostic code describing the type of issue.
     * Diagnostic codes could be documented to help user understand how to resolve this type of issue
     */ readonly code : string ; /**
     * Message.
     */ readonly message : string ; /**
     * location where the problem was found.
     */ readonly source ? : SourceLocation [ ] ; /**
     * Additional details.
     */ readonly details ? : Error | unknown ; } export interface AutorestError extends Omit < AutorestDiagnostic , "level" > { } export interface AutorestWarning extends Omit < AutorestDiagnostic , "level" > { } export interface Progress { /**
     * Current step.
     */ current : number ; /**
     * Total number of steps.
     */ total : number ; /**
     * Optional name
     */ name ? : string ; } export interface ProgressTracker { update ( progress ) : void ; stop ( ) : void ; } /**
 * AutorestLogger is an interface for the autorest logger that can be passed around in plugins.
 * This can be used to log information, debug logs or track errors and warnings.
 */ export interface IAutorestLogger { debug ( message ) : void ; verbose ( message ) : void ; info ( message ) : void ; fatal ( message ) : void ; /**
     * Track an error that occurred.
     */ trackError ( error ) : void ; /**
     * Track an warning that occurred.
     */ trackWarning ( error ) : void ; log ( log ) : void ; startProgress ( initialName ? ) : ProgressTracker ; } export interface AutorestLogger extends IAutorestLogger { with ( ... processors ) : AutorestLogger ; diagnostics : AutorestDiagnostic [ ] ; } export interface LoggerProcessor { param log process ( log ) : LogInfo | undefined ; } export interface LoggerAsyncProcessor { param log process ( log ) : Promise < LogInfo | undefined > ; } export interface LoggerSink { log ( info ) : void ; startProgress ( initialName ? ) : ProgressTracker ; } export type EnhancedLogInfo = Omit < LogInfo , "source" > & { readonly source ? : EnhancedSourceLocation [ ] ; } ; export interface EnhancedSourceLocation { document : string ; position : EnhancedPosition ; }