import { FluentAsyncIterable, FluentGroup, FluentIterable } from '../types'; import { Group, AverageStepper } from '../types/base'; import { AnyIterable, AsyncPredicate } from 'augmentative-iterable'; /** * Returns exactly the informed parameter * @param param The informed parameter to be returned */ declare function identity(param: T): T; export declare function isPromise(t: unknown): t is PromiseLike; /** * Iterates all element of an async iterable * @typeparam T the item type of the [[Iterable]] * @param a The async iterable */ declare function iterateAsync(a: AnyIterable | PromiseLike>): AsyncIterable; /** * Iterates in all elements of an async iterable of iterables or async iterables * @typeparam T the item type of the internal [[Iterable/AsyncIterable]] * @param a The async iterable */ declare function iterateAllAsync(a: AsyncIterable>): AsyncGenerator, void, any>; /** * Iterates all element of an iterable * @typeparam T the item type of the [[Iterable]] * @param a The iterable */ declare const iterate: (a: Iterable) => Iterable; /** * Returns a function that always returns the informed value * @param value the constant value */ declare function constant(value: T): () => T; /** * Iterates in all elements of an iterable of iterables * @typeparam T the item type of the internal [[Iterable]] * @param a The iterable */ declare function iterateAll(a: Iterable>): Generator; /** * Iterates over all owned properties of the given object * @param obj The object to iterate with */ declare function iterateObjProps(obj: T): Iterable; /** * Iterates over all owned entries of given object * @param obj The object to iterate with */ declare function iterateObjEntries(obj: T): Iterable<[K, V]>; /** * Provides a "equals" comparer * @typeparam T the type of b * @param b the value for comparison */ declare function eq(b: any): (a: T) => boolean; /** * Provides a "greater than" comparer * @typeparam T the type of b * @param b the value for comparison */ declare function gt(b: any): (a: T) => boolean; /** * Provides a "greater or equal" comparer * @typeparam T the type of b * @param b the value for comparison */ declare function ge(b: any): (a: T) => boolean; /** * Provides a "lesser than" comparer * @typeparam T the type of b * @param b the value for comparison */ declare function lt(b: any): (a: T) => boolean; /** * Provides a "lesser or equal" comparer * @typeparam T the type of b * @param b the value for comparison */ declare function le(b: any): (a: T) => boolean; /** * Provides an empty iterable */ declare function empty(): Iterable; /** * Provides an empty async iterable */ declare function emptyAsync(): AsyncIterable; /** * Always returns true */ declare function truth(): boolean; /** * Always returns false */ declare function falsity(): boolean; /** * Provides a function that negates the informed predicate * @typeparam T the item type of the [[Predicate]] * @param predicate The predicate to be negated */ declare function negation(this: unknown, predicate: (...args: TArgs) => R): (...args: TArgs) => boolean; /** * Provides a function that negates the informed async predicate * @typeparam T the item type of the [[AsyncPredicate]] * @param predicate The async predicate to be negated */ declare function asyncNegation(predicate: AsyncPredicate): AsyncPredicate; /** * Convert a simple [[Group]] to a [[FluentGroup]] * @typeparam Key The type of the key * @typeparam Value the type of the items of the value property * @param {Group} grp the [[Group]] to be converted */ declare function fluentGroup(grp: Group): FluentGroup; /** * Returns an object to calculates incremental average/iterative means */ declare function getAverageStepper(): AverageStepper; /** * Returns a new instance of a function with a order assuring mark. * Fluent Iterable will treat order Assuring marked function as if * they're guaranteed to return ordered result in regard some iterable * where they're applied. The actual order, though, is of responsibility * of the code using this package. * * This is useful to have access to faster versions of some algorithms, but * the output may not match expectation if the resulting order is not actually right. * * @param f the function to assure order */ declare function assureOrder>(f: F): F; /** * Returns a new instance of a function with a descending order assuring mark. * Fluent Iterable will treat descending order assuring marked functions as if * they're guaranteed to return descending ordered results in regard some iterable * where they're applied. The actual order, though, is of responsibility * of the code using this package. * * This is useful to have access to faster versions of some algorithms, but * the output may not match expectation if the resulting order is not actually right. * * @param f the function to assure order */ declare function assureOrderDescending | FluentAsyncIterable>(f: F): F; /** * Mark a field name or a mapper as ascending, for use with sortBy * @param f the mapper or the field name */ export declare function asc(f: F): F; /** * Mark a field name or a mapper as descending, for use with sortBy * @param f the mapper or the field name */ export declare function desc(f: F): F; export { assureOrder, assureOrderDescending, constant, empty, emptyAsync, identity, truth, falsity, negation, asyncNegation, fluentGroup, getAverageStepper, eq, ge, gt, le, lt, iterateAsync, iterateAllAsync, iterate, iterateAll, iterateObjProps, iterateObjEntries, };