import { TransformableInfo } from 'logform'; /** * Interface to implement an FormatExceptionOptions object */ export interface FormatExceptionOptions { metaKey?: string; } /** * Interface to implement an FormatException object */ export interface FormatException { message: string; trace: string[]; } export interface ParserExceptionInterface { /** * Try to generate a FormatException from TransformableInfo * @param {TransformableInfo | any} obj * @returns {[FormatException, Error] | null} */ getFormatException(obj: TransformableInfo | any): [FormatException, Error] | null; /** * Extract Error object from TransformableInfo message * @param {TransformableInfo | any} obj * @returns {Error | null} */ extractMessageError(obj: TransformableInfo | any): Error | null; /** * Extract first Error object from TransformableInfo splat * @param {TransformableInfo} obj * @returns {Error | null} */ extractSplatError(obj: TransformableInfo): Error | null; /** * Parse Error object. * @param {Error} error * @returns {FormatException} */ parseError(error: Error): FormatException; /** * Parse stack string. * @param {string} stack * @returns {FormatException} */ parseStack(stack: string): FormatException; } export declare class ParserError implements ParserExceptionInterface { /** * {@inheritdoc} */ getFormatException(obj: TransformableInfo | any): [FormatException, Error] | null; /** * {@inheritdoc} */ extractMessageError(obj: TransformableInfo | any): Error | null; /** * {@inheritdoc} */ extractSplatError(obj: TransformableInfo | any): Error | null; /** * {@inheritdoc} */ parseError(error: Error): FormatException; /** * {@inheritdoc} */ parseStack(stack: string): FormatException; /** * Validate if the object is an Error * @param obj * @returns {boolean} */ private isErr; } /** * Transform logger info when detected an exception. * * @param {TransformableInfo} info * @param {FormatExceptionOptions} opts * * @returns {Format} */ export declare const exception: import("logform").FormatWrap; //# sourceMappingURL=format.d.ts.map