// tslint:disable: max-classes-per-file export interface AnyCtor { new(...args: Array): T; prototype: {}; } export interface IdentityBill { grants: ReadonlyArray; isIdentified: boolean; isAnonymous: boolean; } export abstract class IdentifiedBillBase { constructor(readonly grants: ReadonlyArray) {} get isIdentified(): true { return true; } get isAnonymous(): false { return false; } } export class IdentifiedBill< TPrincipal, TCredential > extends IdentifiedBillBase { constructor( readonly principal: TPrincipal, readonly credential: TCredential, grants: ReadonlyArray, ) { super(grants); } } export class AnonymousBill implements IdentityBill { constructor(readonly grants: ReadonlyArray) {} get isIdentified(): false { return false; } get isAnonymous(): true { return true; } }