import Class from '../features/orm/class'; export default class Collection { private collection; constructor(collection: T[]); readonly length: number; count(): number; /** * Get the first item from the collection */ first(): T | null; /** * Get the last Object from the collection */ last(): T | null; /** * Return Objects that pass a given evaluator * @param {Function} evaluator */ where(evaluator: (object: T) => boolean): Collection; /** * Map Objects into an array using an iterator * @param {Function} iterator */ map(iterator: (object: T) => any): U[]; /** * Iterate through each item * @param {Function} iterator */ forEach(iterator: (object: T) => void): void; /** * Alias of toArray() */ toList(): T[]; /** * Convert the collection into an array */ toArray(): T[]; /** * Convert the collection into a Map, based on the given iterator * @param iterator */ toMap(iterator?: string | ((object: T) => any)): Map; /** * Convert the collection into an object literal */ toJSON(): import("../types/class").ClassJSON[]; /** * Run a promise iterator over every Object, in series * @param {Function} iterator */ each(iterator: (object: T) => Promise): Promise; /** * Run a promise iterator over every Object, in parallel */ all(iterator: (object: T) => Promise): Promise; [Symbol.iterator](): Iterator; }