@universis/common
Version:
Universis - common directives and services
63 lines (62 loc) • 2.14 kB
TypeScript
import { OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
import { TranslateService } from '@ngx-translate/core';
import * as i0 from "@angular/core";
export declare interface TranslateError {
title?: string;
message?: string;
action?: string;
actionText?: string;
continue?: string;
icon?: string;
iconClass?: string;
}
export declare interface ShowErrorModalOptions {
continueLink?: string;
buttonText?: string;
iconClass?: string;
}
export declare class ErrorModalComponent implements OnInit {
private _translateService;
bsModalRef: BsModalRef;
private _router;
code: any;
language: any;
continueLink: string;
message: string | undefined;
title: string | undefined;
iconClass?: string;
buttonText: string;
error: any;
constructor(_translateService: TranslateService, bsModalRef: BsModalRef, _router: Router);
hide(): Promise<void> | Promise<boolean>;
ngOnInit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorModalComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ErrorModalComponent, "universis-error-modal", never, { "continueLink": "continueLink"; "message": "message"; "title": "title"; "iconClass": "iconClass"; "buttonText": "buttonText"; "error": "error"; }, {}, never, never, false, never>;
}
export declare class ErrorService {
private _router;
private _modalService;
private _lastError;
constructor(_router: Router, _modalService: BsModalService);
/**
* @param {*} error
* @returns {Promise<boolean>}
*/
navigateToError(error: any): Promise<boolean>;
showError(error: any, options?: ShowErrorModalOptions): void;
/**
* Sets last application error
* @param {*=} err
* @return ErrorService
*/
setLastError(err?: any): this;
/**
* Gets last application error
* @return {any}
*/
getLastError(): any;
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ErrorService>;
}