export interface IModel { id : string ; } export interface ICrudable < T extends IModel > { create ( data ) : Promise < T > ; read ( id ) : Promise < T > ; update ( id , data ) : Promise < T > ; delete ( id ) : Promise < T [ 'id' ] > ; } export class Crudable < T extends IModel > implements ICrudable < T > { create ( data ) { throw new Error ( 'Method not implemented.' ) ; } read ( id ) { throw new Error ( 'Method not implemented.' ) ; } update ( id , data ) { throw new Error ( 'Method not implemented.' ) ; } delete ( id ) { throw new Error ( 'Method not implemented.' ) ; } }