import { PipeSwitchCase } from "./Pipe"; import { ICallback, IPause, IOrder, ISend } from "./CoreTypes"; import { ISubscribe, IOrderedSubscribe, ISubscriptionLike, IGroupSubscription } from "./SubscriptionTypes"; export type ISwitch = { choice(): PipeSwitchCase; }; export type IGroup = { group(): IGroupSubscription; }; export type IOrderedGroup = { group(): IGroupSubscription; }; export type IOnce = { once(): ISubscribe; }; export type IOrderedOnce = { once(): IOrderedSubscribe; }; export type ITake = { take(n: number): ISubscribe; }; export type IOrderedTake = { take(n: number): IOrderedSubscribe; }; export type ISkip = { skip(n: number): ISetup; }; export type IOrderedSkip = { skip(n: number): IOrderedSetup; }; export type IScan = { scan(fn: (accumulator: K, value: T) => K, seed: K): ISetup; }; export type IOrderedScan = { scan(fn: (accumulator: K, value: T) => K, seed: K): IOrderedSetup; }; export type IUnsubscribeByPositive = { unsubscribeBy(condition: ICallback): ISetup; }; export type IOrderedUnsubscribeByPositive = { unsubscribeBy(condition: ICallback): ISetup; }; export type IEmitByPositive = { and(condition: ICallback): ISetup; allOf(conditions: ICallback[]): ISetup; }; export type IOrderedEmitByPositive = { and(condition: ICallback): ISetup; allOf(conditions: ICallback[]): ISetup; }; export type ITransform = { map(condition: ICallback): ISetup; }; export type IThrottle = { throttle(ms: number): ISetup; }; export type IDebounce = { debounce(ms: number): ISetup; }; export type IDistinctUntilChanged = { distinctUntilChanged(comparator?: (previous: T, current: T) => boolean): ISetup; }; export type ITap = { tap(fn: ICallback): ISetup; }; export type ISerialisation = { toJson(): ISetup; fromJson(): ISetup; }; export type ISetup = IUnsubscribeByPositive & IEmitByPositive & IOnce & ITake & ISkip & IScan & ISwitch & ITransform & IThrottle & IDebounce & IDistinctUntilChanged & ITap & ISerialisation & IGroup & ISubscribe; export type IOrderedSetup = IOrderedUnsubscribeByPositive & IOrderedEmitByPositive & IOrderedOnce & IOrderedTake & IOrderedSkip & IOrderedScan & ISwitch & ITransform & IThrottle & IDebounce & IDistinctUntilChanged & ITap & ISerialisation & IOrderedGroup & IOrderedSubscribe; export type ISubscribeObject = ISubscriptionLike & IPause & IOrder & ISend & ISetup; export type IPipeCase = ISubscribe & { or(condition: ICallback): IPipeCase & ISubscribe; anyOf(conditions: ICallback[]): IPipeCase & ISubscribe; group(): IGroupSubscription; };