indexed-collection
Version:
A zero-dependency library of classes that make filtering, sorting and observing changes to arrays easier and more efficient.
18 lines (15 loc) • 385 B
text/typescript
export interface IIndex<T> {
/**
* Add an item into the index
* @param item
* @return true if the item has been added to the index successfully.
*/
index(item: T): boolean;
/**
* Remove an item from the index
* @param item
* @return true if the item has been removed to the index successfully.
*/
removeFromIndex(item: T): boolean;
reset(): void;
}