Type Alias ICollection<TInput>

ICollection<TInput>: Iterable<TInput> & {
    after(predicateFn: Predicate<TInput, ICollection<TInput>>): null | TInput;
    afterOr<TExtended>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
    afterOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
    append<TExtended>(iterable: Iterable<TInput | TExtended, any, any>): ICollection<TInput | TExtended>;
    average(): EnsureType<TInput, number>;
    before(predicateFn: Predicate<TInput, ICollection<TInput>>): null | TInput;
    beforeOr<TExtended>(defaultValue: Lazyable<TExtended>, predicateFn: Predicate<TInput, ICollection<TInput>>): TInput | TExtended;
    beforeOrFail(predicateFn: Predicate<TInput, ICollection<TInput>>): TInput;
    change<TFilterOutput, TMapOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TFilterOutput>, mapFn: Map<TFilterOutput, ICollection<TInput>, TMapOutput>): ICollection<ChangendItem<TInput, TFilterOutput, TMapOutput>>;
    chunk(chunkSize: number): ICollection<ICollection<TInput>>;
    chunkWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
    collapse(): ICollection<Collapse<TInput>>;
    count(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
    countBy<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, number>>;
    crossJoin<TExtended>(iterable: Iterable<TExtended, any, any>): ICollection<CrossJoinResult<TInput, TExtended>>;
    difference<TOutput>(iterable: Iterable<TInput, any, any>, selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
    entries(): ICollection<RecordItem<number, TInput>>;
    every<TOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
    filter<TOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
    first<TOutput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): null | TOutput;
    firstOr<TOutput, TExtended>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
    firstOrFail<TOutput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
    flatMap<TOutput>(mapFn: Map<TInput, ICollection<TInput>, Iterable<TOutput, any, any>>): ICollection<TOutput>;
    forEach(callback: ForEach<TInput, ICollection<TInput>>): void;
    groupBy<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<RecordItem<TOutput, ICollection<TInput>>>;
    insertAfter<TExtended>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended, any, any>): ICollection<TInput | TExtended>;
    insertBefore<TExtended>(predicateFn: Predicate<TInput, ICollection<TInput>>, iterable: Iterable<TInput | TExtended, any, any>): ICollection<TInput | TExtended>;
    isEmpty(): boolean;
    isNotEmpty(): boolean;
    join(separator?: string): EnsureType<TInput, string>;
    keys(): ICollection<number>;
    last<TOutput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): null | TOutput;
    lastOr<TOutput, TExtended>(defaultValue: Lazyable<TExtended>, predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput | TExtended;
    lastOrFail<TOutput>(predicateFn?: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
    map<TOutput>(mapFn: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TOutput>;
    max(): EnsureType<TInput, number>;
    median(): EnsureType<TInput, number>;
    min(): EnsureType<TInput, number>;
    nth(step: number): ICollection<TInput>;
    padEnd<TExtended>(maxLength: number, fillItems: Iterable<TExtended, any, any>): ICollection<TInput | TExtended>;
    padStart<TExtended>(maxLength: number, fillItems: Iterable<TExtended, any, any>): ICollection<TInput | TExtended>;
    page(page: number, pageSize: number): ICollection<TInput>;
    partition(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<ICollection<TInput>>;
    percentage(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
    pipe<TOutput>(callback: Transform<ICollection<TInput>, TOutput>): TOutput;
    prepend<TExtended>(iterable: Iterable<TInput | TExtended, any, any>): ICollection<TInput | TExtended>;
    reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>): TInput;
    reduce(reduceFn: Reduce<TInput, ICollection<TInput>, TInput>, initialValue: TInput): TInput;
    reduce<TOutput>(reduceFn: Reduce<TInput, ICollection<TInput>, TOutput>, initialValue: TOutput): TOutput;
    reject<TOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): ICollection<Exclude<TInput, TOutput>>;
    repeat(amount: number): ICollection<TInput>;
    reverse(chunkSize?: number): ICollection<TInput>;
    searchFirst(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
    searchLast(predicateFn: Predicate<TInput, ICollection<TInput>>): number;
    shuffle(mathRandom?: (() => number)): ICollection<TInput>;
    size(): number;
    skip(offset: number): ICollection<TInput>;
    skipUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
    skipWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
    slice(start?: number, end?: number): ICollection<TInput>;
    sliding(chunkSize: number, step?: number): ICollection<ICollection<TInput>>;
    sole<TOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): TOutput;
    some<TOutput>(predicateFn: Predicate<TInput, ICollection<TInput>, TOutput>): boolean;
    sort(comparator?: Comparator<TInput>): ICollection<TInput>;
    split(chunkAmount: number): ICollection<ICollection<TInput>>;
    sum(): EnsureType<TInput, number>;
    take(limit: number): ICollection<TInput>;
    takeUntil(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
    takeWhile(predicateFn: Predicate<TInput, ICollection<TInput>>): ICollection<TInput>;
    tap(callback: Tap<ICollection<TInput>>): ICollection<TInput>;
    toArray(): TInput[];
    toIterator(): Iterator<TInput, void, any>;
    unique<TOutput>(selectFn?: Map<TInput, ICollection<TInput>, TOutput>): ICollection<TInput>;
    values(): ICollection<TInput>;
    when<TExtended>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
    whenEmpty<TExtended>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
    whenNot<TExtended>(condition: boolean, callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
    whenNotEmpty<TExtended>(callback: Modifier<ICollection<TInput>, ICollection<TExtended>>): ICollection<TInput | TExtended>;
    zip<TExtended>(iterable: Iterable<TExtended, any, any>): ICollection<RecordItem<TInput, TExtended>>;
}

ICollection is immutable.

Type Parameters

  • TInput

Type declaration