/**
 * @module Collection
 */
import { type StandardSchemaV1 } from "@standard-schema/spec";
import { type AsyncCollapse, type AsyncPredicate, type AsyncForEach, type AsyncMap, type AsyncModifier, type AsyncTap, type AsyncTransform, type Comparator, type IAsyncCollection, type AsyncReduce, type CrossJoinResult, type EnsureMap, type EnsureRecord } from "../../../collection/contracts/_module.js";
import { type AsyncIterableValue, type AsyncLazyable } from "../../../utilities/_module.js";
/**
 * All methods that return {@link IAsyncCollection | `IAsyncCollection`} are executed lazly, meaning the execution will occur iterating the items withthe `forEach` method or `for await` loop.
 *
 * IMPORT_PATH: `"@daiso-tech/core/collection"`
 * @group Implementations
 */
export declare class AsyncIterableCollection<TInput = unknown> implements IAsyncCollection<TInput> {
    /**
     * The `concat` static method is a convenient utility for easily concatenating multiple {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * class MyAsyncIterable implements AsyncIterable<number> {
     *   async *[Symbol.iterator](): Iterator<number> {
     *     yield "a";
     *     yield "b";
     *     yield "c";
     *   }
     * }
     *
     * class MyIterable implements Iterable<number> {
     *   *[Symbol.iterator](): Iterator<number> {
     *     yield 1;
     *     yield 2;
     *     yield 3;
     *   }
     * }
     *
     * const collection = AsyncIterableCollection.concat([
     *   new MyAsyncIterable(),
     *   new MyIterable(),
     *   new Set([1, 2, 3]),
     *   new Map([["a", 1], ["b", 2]]),
     *   ["a", "b", "c"]
     * ]);
     * await collection.toArray();
     * // ["a", "b", "c", 1, 2, 3, 1, 2, 3, ["a", 1], ["b", 2], "a", "b", "c"]
     * ```
     */
    static concat<TValue>(iterables: AsyncIterableValue<AsyncIterableValue<TValue>>): IAsyncCollection<TValue>;
    /**
     * The `difference` static method is used to compute the difference between two {@link Iterable | `Iterable`} instances. By default, the equality check is performed on each item.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = AsyncIterableCollection.difference(
     *   [1, 2, 2, 3, 4, 5],
     *   [2, 4, 6, 8]
     * );
     * await collection.toArray();
     * // [1, 3, 5]
     * ```
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = AsyncIterableCollection.difference(
     *   [
     *     { name: "iPhone 6", brand: "Apple", type: "phone" },
     *     { name: "iPhone 5", brand: "Apple", type: "phone" },
     *     { name: "Apple Watch", brand: "Apple", type: "watch" },
     *     { name: "Galaxy S6", brand: "Samsung", type: "phone" },
     *     { name: "Galaxy Gear", brand: "Samsung", type: "watch" },
     *   ],
     *   [
     *     { name: "Apple Watch", brand: "Apple", type: "watch" },
     *   ],
     *   (product) => product.type
     * );
     * await collection.toArray();
     * // [
     * //   { name: "iPhone 6", brand: "Apple", type: "phone" },
     * //   { name: "iPhone 5", brand: "Apple", type: "phone" },
     * //   { name: "Galaxy S6", brand: "Samsung", type: "phone" },
     * // ]
     * ```
     */
    static difference<TValue, TSelect>(iterableA: AsyncIterableValue<TValue>, iterableB: AsyncIterableValue<TValue>, selectFn?: AsyncMap<TValue, IAsyncCollection<TValue>, TSelect>): IAsyncCollection<TValue>;
    /**
     * The `zip` static method merges together the values of `iterableA` with the values of the `iterableB` at their corresponding index.
     * The returned collection has size of the shortest collection.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = AsyncIterableCollection.zip(["Chair", "Desk"], [100, 200]);
     * await collection.toArray();
     * // [["Chair", 100], ["Desk", 200]]
     * ```
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = AsyncIterableCollection.zip(["Chair", "Desk", "Couch"], [100, 200]);
     * await collection.toArray();
     * // [["Chair", 100], ["Desk", 200]]
     * ```
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = AsyncIterableCollection.zip(["Chair", "Desk"], [100, 200, 300]);
     * await collection.toArray();
     * // [["Chair", 100], ["Desk", 200]]
     * ```
     */
    static zip<TValueA, TValueB>(iterableA: AsyncIterableValue<TValueA>, iterableB: AsyncIterableValue<TValueB>): IAsyncCollection<[TValueA, TValueB]>;
    private static DEFAULT_CHUNK_SIZE;
    private static makeCollection;
    private readonly iterable;
    /**
     * The `constructor` takes an {@link Iterable | `Iterable`} or {@link AsyncIterable | `AsyncIterable`}.
     *
     * Works with `Array`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = new AsyncIterableCollection([1, 2, 3, 4]);
     * ```
     *
     * Works with `String`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = new AsyncIterableCollection("ABCDE");
     * ```
     *
     * Works with `Set`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = new AsyncIterableCollection(new Set([1, 2, 2 4]));
     * ```
     *
     * Works with `Map`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * const collection = new AsyncIterableCollection(new Map([["a", 1], ["b", 2]]));
     * ```
     *
     * Works with any `Iterable`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * class MyIterable implements Iterable<number> {
     *   *[Symbol.iterator](): Iterator<number> {
     *     yield 1;
     *     yield 2;
     *     yield 3;
     *   }
     * }
     * const collection = new AsyncIterableCollection(new MyIterable());
     * ```
     *
     * Works with any `AsyncIterable`.
     * @example
     * ```ts
     * import { AsyncIterableCollection } from "@daiso-tech/core/collection";
     *
     * class MyIterable implements AsyncIterable<number> {
     *   async *[Symbol.iterator](): Iterator<number> {
     *     yield 1;
     *     yield 2;
     *     yield 3;
     *   }
     * }
     * const collection = new AsyncIterableCollection(new MyIterable());
     * ```
     */
    constructor(iterable?: AsyncIterableValue<TInput>);
    [Symbol.asyncIterator](): AsyncIterator<TInput>;
    toIterator(): AsyncIterator<TInput, void>;
    entries(): IAsyncCollection<[number, TInput]>;
    keys(): IAsyncCollection<number>;
    copy(): IAsyncCollection<TInput>;
    filter<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TOutput>;
    validate<TOutput>(schema: StandardSchemaV1<TInput, TOutput>): IAsyncCollection<TOutput>;
    reject<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<Exclude<TInput, TOutput>>;
    map<TOutput>(mapFn: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TOutput>;
    reduce(reduce: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>): Promise<TInput>;
    reduce(reduce: AsyncReduce<TInput, IAsyncCollection<TInput>, TInput>, initialValue: TInput): Promise<TInput>;
    reduce<TOutput>(reduce: AsyncReduce<TInput, IAsyncCollection<TInput>, TOutput>, initialValue: Promise<TOutput>): Promise<TOutput>;
    join(separator?: string): Promise<Extract<TInput, string>>;
    collapse(): IAsyncCollection<AsyncCollapse<TInput>>;
    flatMap<TOutput>(mapFn: AsyncMap<TInput, IAsyncCollection<TInput>, Iterable<TOutput>>): IAsyncCollection<TOutput>;
    change<TFilterOutput extends TInput, TMapOutput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TFilterOutput>, mapFn: AsyncMap<TFilterOutput, IAsyncCollection<TInput>, TMapOutput>): IAsyncCollection<TInput | TFilterOutput | TMapOutput>;
    set(index: number, value: TInput | AsyncMap<TInput, IAsyncCollection<TInput>, TInput>): IAsyncCollection<TInput>;
    get(index: number): Promise<TInput | null>;
    getOrFail(index: number): Promise<TInput>;
    page(page: number, pageSize: number): IAsyncCollection<TInput>;
    sum(): Promise<Extract<TInput, number>>;
    average(): Promise<Extract<TInput, number>>;
    median(): Promise<Extract<TInput, number>>;
    min(): Promise<Extract<TInput, number>>;
    max(): Promise<Extract<TInput, number>>;
    percentage(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): Promise<number>;
    some<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<boolean>;
    every<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<boolean>;
    take(limit: number): IAsyncCollection<TInput>;
    takeUntil(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
    takeWhile(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
    skip(offset: number): IAsyncCollection<TInput>;
    skipUntil(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
    skipWhile(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
    when<TExtended = TInput>(condition: boolean, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
    whenEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
    whenNot<TExtended = TInput>(condition: boolean, callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
    whenNotEmpty<TExtended = TInput>(callback: AsyncModifier<IAsyncCollection<TInput>, IAsyncCollection<TExtended>>): IAsyncCollection<TInput | TExtended>;
    pipe<TOutput = TInput>(callback: AsyncTransform<IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    tap(callback: AsyncTap<IAsyncCollection<TInput>>): IAsyncCollection<TInput>;
    chunk(chunkSize: number): IAsyncCollection<IAsyncCollection<TInput>>;
    chunkWhile(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<IAsyncCollection<TInput>>;
    split(chunkAmount: number): IAsyncCollection<IAsyncCollection<TInput>>;
    partition(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): IAsyncCollection<IAsyncCollection<TInput>>;
    sliding(chunkSize: number, step?: number): IAsyncCollection<IAsyncCollection<TInput>>;
    groupBy<TOutput = TInput>(selectFn?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<[TOutput, IAsyncCollection<TInput>]>;
    countBy<TOutput = TInput>(selectFn?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<[TOutput, number]>;
    unique<TOutput = TInput>(selectFn?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TInput>;
    difference<TOutput = TInput>(iterable: AsyncIterableValue<TInput>, selectFn?: AsyncMap<TInput, IAsyncCollection<TInput>, TOutput>): IAsyncCollection<TInput>;
    repeat(amount: number): IAsyncCollection<TInput>;
    padStart<TExtended = TInput>(maxLength: number, fillItems: AsyncIterableValue<TExtended>): IAsyncCollection<TInput | TExtended>;
    padEnd<TExtended = TInput>(maxLength: number, fillItems: AsyncIterableValue<TExtended>): IAsyncCollection<TInput | TExtended>;
    slice(start?: number, end?: number): IAsyncCollection<TInput>;
    prepend<TExtended = TInput>(iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
    append<TExtended = TInput>(iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
    insertBefore<TExtended = TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>, iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
    insertAfter<TExtended = TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>, iterable: AsyncIterableValue<TInput | TExtended>): IAsyncCollection<TInput | TExtended>;
    crossJoin<TExtended>(iterable: AsyncIterableValue<TExtended>): IAsyncCollection<CrossJoinResult<TInput, TExtended>>;
    zip<TExtended>(iterable: AsyncIterableValue<TExtended>): IAsyncCollection<[TInput, TExtended]>;
    sort(comparator?: Comparator<TInput>): IAsyncCollection<TInput>;
    reverse(chunkSize?: number): IAsyncCollection<TInput>;
    shuffle(mathRandom?: () => number): IAsyncCollection<TInput>;
    private first_;
    first<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
    firstOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | TExtended>;
    firstOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    private last_;
    last<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
    lastOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | TExtended>;
    lastOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    private before_;
    before<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
    beforeOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | TExtended>;
    beforeOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    private after_;
    after<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | null>;
    afterOr<TOutput extends TInput, TExtended = TInput>(defaultValue: AsyncLazyable<TExtended>, predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput | TExtended>;
    afterOrFail<TOutput extends TInput>(predicateFn?: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    sole<TOutput extends TInput>(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>, TOutput>): Promise<TOutput>;
    nth(step: number): IAsyncCollection<TInput>;
    count(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): Promise<number>;
    size(): Promise<number>;
    isEmpty(): Promise<boolean>;
    isNotEmpty(): Promise<boolean>;
    searchFirst(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): Promise<number>;
    searchLast(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): Promise<number>;
    forEach(callback: AsyncForEach<TInput, IAsyncCollection<TInput>>): Promise<void>;
    toArray(): Promise<Array<TInput>>;
    toRecord(): Promise<EnsureRecord<TInput>>;
    toMap(): Promise<EnsureMap<TInput>>;
}
