import * as Models from "../generated/artifacts/models" ; import Context from "../generated/Context" ; export interface ILease { leaseId ? : string ; leaseState ? : Models . LeaseStateType ; leaseStatus ? : Models . LeaseStatusType ; leaseDurationType ? : Models . LeaseDurationType ; leaseDurationSeconds ? : number ; leaseExpireTime ? : Date ; leaseBreakTime ? : Date ; } export interface ILeaseValidator { validate ( lease , context ) : void ; } export interface ILeaseSyncer < T > { sync ( lease ) : T ; } export interface ILeaseState { lease : ILease ; acquire ( duration , proposedLeaseId ? ) : ILeaseState ; break ( breakPeriod ? ) : ILeaseState ; renew ( leaseId ) : ILeaseState ; change ( leaseId , proposedLeaseId ) : ILeaseState ; release ( leaseId ) : ILeaseState ; validate ( validator ) : ILeaseState ; sync < T > ( syncer ) : T ; }