import { Joi } from '../helpers'; export declare const errorInfoSchema: Joi.ObjectSchema; export interface IErrorInfo { status: string; message: string; details?: IErrorDetails; } export interface IErrorResponse { error: IErrorInfo; } export interface IErrorDetails { [key: string]: string | number | undefined; } export declare type OptionalResponse = T | (E & IErrorResponse); export declare type WhenNoError = Exclude; export declare type WhenError = Extract; export declare function isErrorResponse(response: T): response is Extract; export declare function isSuccessResponse(response: T): response is Exclude; export declare const addErrorDetails: (incomingError: IErrorInfo, details?: IErrorDetails | undefined) => IErrorInfo;