import { IEventLike } from '../../observables/events/events-listener/event-like/interfaces'; /** TYPES **/ export type TNotificationName> = N extends INotification ? TName : never; export type TNotificationValue> = N extends INotification ? TValue : never; /** INTERFACES **/ export interface INotificationConstructor { // converts an Event to a Notification fromEvent(event: TEvent): INotification; new(name: TName, value: TValue): INotification; } /** * A notification is a tuple containing a name and a value. * Its purpose its to associate a key with a value to allow filtering at the end of the pipe. * @Example: * const notification = new Notification<'click', Event>() */ export interface INotification { readonly name: TName; readonly value: TValue; toJSON(): Pick, 'name' | 'value'>; }