@aimee-blue/ab-service-kit
Version:
Aimee Blue Service Template
23 lines (22 loc) • 801 B
TypeScript
import { Observable, ObservedValueOf } from 'rxjs';
import { BasicLogger } from './logging';
export declare type TagNotification = 'next' | 'error' | 'complete' | 'subscribe' | 'unsubscribe';
export declare type NotificationInfo<T, K = void> = {
notification: 'next';
value: T;
} | {
notification: 'error';
error: unknown;
} | {
notification: 'complete';
lastValue?: T;
} | {
notification: 'subscribe';
} | {
notification: 'unsubscribe';
lastValue?: T;
} | {
notification: K;
lastValue?: T;
};
export declare function executeOnNotifications<T, O extends Observable<unknown>>(notifications: Array<TagNotification | O>, cb: (info: NotificationInfo<T, ObservedValueOf<O>>) => void, logger?: BasicLogger): <X extends T>(stream: Observable<X>) => Observable<X>;