import { AnyIterable, AsyncMapper } from 'augmentative-iterable'; import { AsyncReducer, Comparer, Equality } from '../types/base'; import { AnyMapper, CompareProvider, ResolverType } from '../types-internal'; export type IngredientOpt = (predicate?: AnyMapper) => AnyIterable; export type Ingredient = (predicate: AnyMapper) => AnyIterable; export type ComparerIngredient = (comparer: Comparer) => AnyIterable; export type ResolverIngredient = (predicate?: AnyMapper) => any; export type RequiredResolverIngredient = (predicate: AnyMapper) => any; export type ReduceIngredient = (reducer: AsyncReducer, initial: any) => any; export type ReduceAndMapIngredient = (reducer: AsyncReducer, initial: any, result: AsyncMapper) => any; export type PartitionIngredient = (size: number | Equality) => AnyIterable>; export type ThresholdIngredient = (threshold: number) => AnyIterable>; export type IterateIngredient = (t: any) => any; export type ConcatIngredient = (this: AnyIterable, ...iterables: Array>) => AnyIterable; export type CombineIngredient = (this: AnyIterable, iterable: AnyIterable, baseKeyA?: AnyMapper, baseKeyB?: AnyMapper) => AnyIterable<[any, any]> | Promise>; export type EmptyIngredient = () => AnyIterable; export interface BasicIngredients { resolver: ResolverType; map: Ingredient; filter: Ingredient; takeWhile: Ingredient; forEach: RequiredResolverIngredient; iterate: IterateIngredient; iterateAll: IterateIngredient; toArray: ResolverIngredient; } export interface BasicReduceIngredients extends BasicIngredients { reduce: ReduceIngredient; reduceAndMap: ReduceAndMapIngredient; } export interface CombineIngredients extends BasicIngredients { flatten: IngredientOpt; } export interface GroupIngredients extends BasicReduceIngredients { partition: PartitionIngredient; } export interface DistinctIngredients extends BasicIngredients { partition: PartitionIngredient; filterOrAll: Ingredient | ResolverIngredient; hasLessOrExactly: ThresholdIngredient; reduce: ReduceIngredient; } export interface MinMaxIngredients extends BasicIngredients { first: ResolverIngredient; last: ResolverIngredient; } export interface ComparisonIngredients extends BasicIngredients { count: IngredientOpt; take: ThresholdIngredient; comparer: CompareProvider; } export interface UnwindIngredients extends BasicIngredients { flatten: Function; toObject: Function; combineJoin: Function; symbols: Symbol[]; } export interface ToObjectChainIngredients extends BasicIngredients { group: Function; toObject: Function; flatten: Function; reduce: AsyncReducer; } export interface ToMapChainIngredients extends BasicIngredients { group: Function; toMap: Function; flatten: Function; reduce: AsyncReducer; }