// import { AnyConstructor, Base, isInstanceOf, Mixin } from "../../src/class/BetterMixin.js" // // class Base { // // * gen () { // // } // } // // // class Next extends Base { // // * gen () { // const supGen = super.gen // // const a = function * () { // yield* supGen() // } // // // // yield* a() // } // } // // class A { comp () { console.log(this) } } // class B extends A { comp () { return super.comp } } // // b = new B() // c = b.comp() // c() === b // // // // // //--------------------------------------------------------------------------------------------------------------------- // // export class Event extends Mixin( // // [ Base ], // // >(base : T) => { // // // // class Event extends base { // // @bucket() // // incomingDependncies : Collection // // // // @reference({ bucket : () => this.$.childEvents }) // // parentEvent : Event // // // // @bucket() // // childEvents : Collection // // // // @bucket() // // incomingStartDateConstraintsIntervals : Collection // // // // // // @formula('combinedConstraintsInterval') // // $combinedConstraintsInterval (Y : SyncEffectHandler) : DateInterval { // // const { // // incomingStartDateConstraintsIntervals // // } : Partial = Y(this.$.incomingStartDateConstraintsIntervals) // // // // const reduced = incomingStartDateConstraintsIntervals.reduce() // // // // return reduced // // } // // } // // // // return Event // // } // // ){} // // // // // // //--------------------------------------------------------------------------------------------------------------------- // export class Dependency extends Mixin( // [ Base ], // >(base : T) => { // // class Dependency extends base { // @ref(() => this.$.incomingDependencies) // toEvent : Event // // @bucket() // startDateDependencyIntervals : Collection // // @formula('startDate') // calculateStartDate (Y : SyncEffectHandler) { // Y(this.$.dispatcher).then(({ dispatcher } : Partial) => { // return dispatcher.resolution.get(this.$.startDate).call(this, Y) // }) // } // // @formula('startDateByEndDateDuration') // calculateStartDate (Y : SyncEffectHandler) { // Y(this.$.endDate, this.$.duration, this.$.durationUnit, this.$.calendar).then( // ({ endDate, duration, durationUnit, calendar } : Partial) => { // return calendar.calcualteStartDate(endDate, duration, this.project.convertDuration(Y, duration, durationUnit, TimeUnit.Millisecond)) // } // ) // } // // // @formula(startDate) // startDateByEndDateDuration (Y : SyncEffectHandler, endDate, duration, durationUnit, calendar) { // const startDate = calendar.calcualteStartDate(endDate, duration, this.project.convertDuration(Y, duration, durationUnit, TimeUnit.Millisecond)) // // if (startDate > 0) { // return startDate // } else { // Y.write(this.$.duration, 0) // // return startDate // } // } // // // @formula('dispatcher', () => [ this.$.startDate), this.$.endDate, this.$.duration ]) // calculateDispatcher (Y : Ctx, startDate, endDate, duration) : SEDDispatcher { // dispatcher.collectInput(Y, this) // // return dispatcher // } // // // @input('startDate') // setStartDate (startDate : Date, keepDuration : boolean) { // this.Y.write(this.$.startDate, startDate) // this.Y.write(this.$.duration, 'KEEP') // } // // // // @formula('startDateDependencyInterval') // calculateEndToStartDependencyInterval (Y : SyncEffectHandler) { // yield Input(this.$.lag, this.$.lagUnit, this.$.calendar).compute(function* ({ lag, lagUnit, calendar } : Partial) => { // // yield Continue(super.calculateEndToStartDependencyInterval) // // if (lag > 0) { // yield Input(this.$.lag, this.$.lagUnit, this.$.calendar).compute(function* ({ lag, lagUnit, calendar } : Partial) => { // yield Output(this.$.toEvent.$.incomingStartDateConstraintsIntervals) // }) // } else { // yield Input(this.$.lag, this.$.lagUnit, this.$.calendar).compute(function* ({ lag, lagUnit, calendar } : Partial) => { // yield Output(this.$.startDateDependencyIntervals) // }) // } // }) // } // // } // // return Dependency // } // ){} //