import {IConsumer} from "../Interface"; import {Objects} from "../type/Objects"; /** * @IConsumer: => accept */ export interface sink extends IConsumer{ /*** */ begin(value:number):void /*** */ end():void /*** */ cancellationRequested():boolean } /**/ export interface ofInt extends sink{} /**/ abstract class ChainedReference implements sink{ /*** */ protected downstream:sink constructor(downstream:sink) { this.downstream = Objects.requireNotNull(downstream); } /*** */ public abstract accept(o: T): void /*** */ public begin(value: number): void { this.downstream.begin(value); } /*** */ public cancellationRequested(): boolean { return this.downstream.cancellationRequested(); } /*** */ public end(): void { this.downstream.end(); } } /*** */ abstract class ChainedInt extends ChainedReference implements ofInt{ } /** * @Sink * */ export abstract class Sink { /*** */ public static readonly ChainedReference = ChainedReference; /*** */ public static readonly ChainedInt = ChainedInt; } Object.package(this);