import { IDestroy, IErrorCallback, IListener, IOrder, ISetObservableValue, ISubscribeCounter, ISubscribeGroup } from "./CoreTypes"; import type { ISetup } from "./PipeTypes"; export type ISubscriptionLike = { unsubscribe(): void; }; export type IGroupSubscription = ISubscriptionLike & { add(listener: IListener | IListener[], errorHandler?: IErrorCallback | IErrorCallback[]): IGroupSubscription; }; export type ISubscribe = { subscribe(listener: ISubscribeGroup, errorHandler?: IErrorCallback): ISubscriptionLike; }; export type IOrderedSubscribe = { subscribe(listener: IListener, errorHandler?: IErrorCallback): IOrderedSubscriptionLike; }; export type ISubscriber = { getValue(): T | undefined; isEnable: boolean; } & ISubscribe; export type IOrderedSubscriptionLike = (ISubscriptionLike & IOrder); export type IObservablePipe = { pipe(): ISetup | undefined; }; export type IOrderedObservablePipe = { pipe(): ISetup | undefined; }; export type IObserver = ISetObservableValue & ISubscriber & IDestroy & ISubscribeCounter & IObservablePipe & { unSubscribe(subscriber: ISubscriptionLike): void; unsubscribeAll(): void; disable(): void; enable(): void; }; export type IOrderedObservable = { sortByOrder(): boolean; }; export type IOrdered = IObserver & IOrderedObservable & IOrderedObservablePipe; export type ICollector = IDestroy & ISubscribeCounter & { collect(...subscriptionLikeList: ISubscriptionLike[]): void; unsubscribe(subscriptionLike: ISubscriptionLike): void; unsubscribeAll(): void; };