@altostra/core
Version:
Core library for shared types and logic
14 lines (13 loc) • 504 B
TypeScript
import { It } from "./Iterable";
/**
* Base-type for helper collections
* T is the object-type the helper wraps
* TWrapper is the helper-type which wraps the objects of type T
*/
export declare abstract class Collection<T extends object, TWrapper, TId> extends It<TWrapper> {
private readonly _cache;
private readonly _wrapper;
constructor(_cache: WeakMap<T, TWrapper>, _wrapper: (item: T) => TWrapper);
abstract has(id: TId): boolean;
protected _getWrapper(item: T): TWrapper;
}