import Context from "../generated/Context" ; import { ILease , ILeaseState , ILeaseSyncer , ILeaseValidator } from "./ILeaseState" ; export default abstract class LeaseStateBase implements ILeaseState { public constructor ( public readonly lease , protected readonly context ) { } public abstract acquire ( duration , proposedLeaseId ? ) ; public abstract break ( breakPeriod ? ) ; public abstract renew ( leaseId ) ; public abstract change ( leaseId , proposedLeaseId ) ; public abstract release ( leaseId ) ; public sync < T > ( syncer ) { return syncer . sync ( this . lease ) ; } public validate ( validator ) { validator . validate ( this . lease , this . context ) ; return this ; } }