import { Response } from '@angular/http';
import { MatSnackBar } from '@angular/material';
import 'rxjs/add/operator/toPromise';
/**
 * IResponseError is the formed Error returned in responses from the dev server.
 */
export interface IResponseError<T> {
    name: string;
    message: string;
    stack: string;
    metadata: T;
}
/**
 * IJoiError is the error result returned if Joi validation fails.
 */
export interface IJoiError {
    isJoi: true;
    name: 'ValidationError';
    details: {
        context: {
            key: string;
            label: string;
        };
        message: string;
        path: string[];
        type: string;
    }[];
}
/**
 * The HttpError services wraps handling of common errors into an easily
 * reusable pattern.
 */
export declare class HttpErrorService {
    private readonly snackRef;
    constructor(snackRef: MatSnackBar);
    /**
     * Handled a named error from the API.
     */
    catch<T, E>(errName: string, handler: (err: IResponseError<E>, res: Response) => T | Promise<T>): (res: Response) => Promise<T>;
    /**
     * Handles Joi errors from the server.
     */
    joi<T>(handler: (err: IJoiError, res: Response) => T | Promise<T>): (res: Response) => Promise<T>;
    /**
     * Toasts about a response error, and resolves void.
     */
    toast: (res: Response) => void;
}
