@igo2/core
Version:
73 lines (66 loc) • 2.92 kB
TypeScript
import * as i0 from '@angular/core';
import { ModuleWithProviders, TemplateRef, EnvironmentProviders } from '@angular/core';
import { IndividualConfig, ActiveToast } from 'ngx-toastr';
import { HttpErrorResponse } from '@angular/common/http';
import { BehaviorSubject } from 'rxjs';
/**
* @deprecated import the provideMessage directly
*/
declare class IgoMessageModule {
static forRoot(): ModuleWithProviders<IgoMessageModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<IgoMessageModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<IgoMessageModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<IgoMessageModule>;
}
declare enum MessageType {
ERROR = "error",
ALERT = "warning",// todo delete (transition to ngx-toastr)
WARNING = "warning",
INFO = "info",
SUCCESS = "success",
SHOW = "show"
}
interface Message {
title?: string;
text?: string;
html?: string | TemplateRef<any>;
type?: MessageType;
options?: MessageOptions;
format?: 'text' | 'html';
textInterpolateParams?: object;
titleInterpolateParams?: object;
showIcon?: boolean;
}
interface MessageOptions extends IndividualConfig {
template?: string;
from?: Date | string;
to?: Date | string;
id?: number;
showOnEachLayerVisibility?: boolean;
}
declare function provideMessage(): EnvironmentProviders;
declare class MessageService {
private injector;
private configService;
private languageService;
messages$: BehaviorSubject<Message[]>;
private options?;
private activeMessageTranslations;
constructor();
private get toastr();
showError(httpError: HttpErrorResponse): ActiveToast<any>;
message(message: Message): void;
success(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: object, titleInterpolateParams?: object): ActiveToast<any>;
error(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: object, titleInterpolateParams?: object): ActiveToast<any>;
info(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: object, titleInterpolateParams?: object): ActiveToast<any>;
alert(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: object, titleInterpolateParams?: object): ActiveToast<any>;
show(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: object, titleInterpolateParams?: object): ActiveToast<any>;
private handleNgxToastr;
remove(id?: number): void;
removeAllAreNotError(): void;
private handleTemplate;
static ɵfac: i0.ɵɵFactoryDeclaration<MessageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<MessageService>;
}
export { IgoMessageModule, MessageService, MessageType, provideMessage };
export type { Message, MessageOptions };