import { AnyIterable, Mapper } from 'augmentative-iterable'; import { AsyncItemType, FluentAsyncIterable, FluentIterable, IsAnyOrUnknown, ItemType } from '../base'; export interface CombineJoinFunctionContract { /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations */ (): FluentIterable; /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations * @param key A mapper that returns the key map value from the iterables */ (key: Mapper): FluentIterable; /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations * @param key A property name with value will be used as for comparison with the key of the iterables */ (key: keyof T): FluentIterable; } export type CombineJoinFunction = T extends Iterable ? CombineJoinFunctionContract> : IsAnyOrUnknown extends true ? CombineJoinFunctionContract> : {}; export interface AsyncCombineJoinFunctionContract { /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations */ (): FluentAsyncIterable; /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations * @param key A mapper that returns the key map value from the iterables */ (key: Mapper): FluentAsyncIterable; /** * Combines all the sub iterables, returning a new iterable with the inner matching combinations * @param key A property name with value will be used as for comparison with the key of the iterables */ (key: keyof T): FluentAsyncIterable; } export type AsyncCombineJoinFunction = T extends AnyIterable ? AsyncCombineJoinFunctionContract> : IsAnyOrUnknown extends true ? AsyncCombineJoinFunctionContract> : never;