@anglr/notifications
Version:
Angular module for displaying notifications
53 lines • 2.32 kB
TypeScript
import { ComponentRef, OnChanges, SimpleChanges, ViewContainerRef, EventEmitter, OnDestroy } from '@angular/core';
import { Notification } from '@anglr/common';
import { Subscription } from 'rxjs';
import { NotificationMessage, NotificationsOptions, NotificationMessageService } from '../../common/notifications.interface';
import * as i0 from "@angular/core";
/**
* Creates instance of component dynamically by its metadata
*/
export declare class MessageRendererDirective implements OnChanges, OnDestroy {
protected viewContainerRef: ViewContainerRef;
protected notificationMessageService?: NotificationMessageService | undefined;
/**
* Created component reference
*/
protected componentRef: ComponentRef<NotificationMessage> | null;
/**
* Subscription for listening on closed message
*/
protected closedSubscription: Subscription | undefined | null;
/**
* Instance of notification message that should be rendered
*/
notification: Notification;
/**
* Options passed to notifications component
*/
notificationsOptions: NotificationsOptions;
/**
* Occurs when message was closed by user
*/
closed: EventEmitter<Notification>;
/**
* Instance of dynamically created component
*/
protected get component(): NotificationMessage | null;
constructor(viewContainerRef: ViewContainerRef, notificationMessageService?: NotificationMessageService | undefined);
/**
* Called when input value changes
*/
ngOnChanges(changes: SimpleChanges): void;
/**
* Called when component is destroyed
*/
ngOnDestroy(): void;
/**
* Called when notification was closed by user
* @param notification - Notification that was closed
*/
protected closedEmit: (notification: Notification) => void;
static ɵfac: i0.ɵɵFactoryDeclaration<MessageRendererDirective, [null, { optional: true; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<MessageRendererDirective, "[messageRenderer]", ["messageRenderer"], { "notification": { "alias": "messageRenderer"; "required": true; }; "notificationsOptions": { "alias": "notificationsOptions"; "required": true; }; }, { "closed": "closed"; }, never, never, true, never>;
}
//# sourceMappingURL=messageRenderer.directive.d.ts.map