Initial commit
This commit is contained in:
9
src/infrastructure/Repository/IRepository.ts
Normal file
9
src/infrastructure/Repository/IRepository.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { IEntity } from '../Entity/IEntity';
|
||||
|
||||
export interface IRepository<TKey, TEntity extends IEntity<TKey>> {
|
||||
readonly length: number;
|
||||
getItems(predicate?: (entity: TEntity) => boolean): TEntity[];
|
||||
addItem(item: TEntity): void;
|
||||
removeItem(id: TKey): void;
|
||||
exists(item: TEntity): boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user