turbogui-angular
Version:
A library that tries to help with the most common user interface elements on several frameworks and platforms
39 lines • 1.72 kB
TypeScript
import { Subscription } from 'rxjs';
import { GUINotification } from '../model/classes/GUINotification';
import { SingletoneStrictClass } from '../model/classes/SingletoneStrictClass';
import * as i0 from "@angular/core";
/**
* This is the main application event bus.
* All global events that happen on the application are broadcasted by this service, and
* can be listened by any application element who previously subscribed
*/
export declare class NotificationService extends SingletoneStrictClass {
/**
* The Observable instance that handles subscriptions and notifications
*/
private readonly _notifications;
constructor();
/**
* used by other services or components to subscribe to all notifications that are generated by this service
*
* @param notificationHandler A method that will be used to receive each notification as a GUINotification instance
*
* @returns The new subscription object. Make sure to unsubscribe when not required anymore
*/
subscribe(notificationHandler: (notification: GUINotification) => any): Subscription;
/**
* Launch a notification to anyone who may be listening
*
* @param notification A notification instance to launch
*/
send(notification: GUINotification): void;
/**
* End a previously initiated subscription
*
* @param subscription A previously created subscription instance from which we want to unsubscribe
*/
unsubscribe(subscription: Subscription): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
}
//# sourceMappingURL=notification.service.d.ts.map