import { AsyncPredicate, Predicate } from 'augmentative-iterable'; import { FluentAsyncIterable, FluentIterable } from '../base'; export interface SkipWhileFunction { /** * Bypasses elements in the iterable as long as a specified condition is true and then returns the remaining elements.
* Example: `fluent(['anchor', 'almond', 'bound', 'alpine']).skipWhile(word => word[0] === 'a')` yields *bound* and *alpine*. * @param condition A predicate of `T`. All elements are skipped from the iterable until this evaluates to `false` for the first time. * @returns A [[FluentIterable]] of the elements after the condition is not met. */ (condition: Predicate): FluentIterable; /** * Bypasses elements in the iterable as long as a specified condition is true and then returns the remaining elements.
* Example: `fluent(['anchor', 'almond', 'bound', 'alpine']).skipWhile(word => word[0] === 'a')` yields *bound* and *alpine*. * @param condition A predicate of `T`. All elements are skipped from the iterable until this evaluates to `false` for the first time. * @returns A [[FluentIterable]] of the elements after the condition is not met. */ (condition: keyof T): FluentIterable; } export interface AsyncSkipWhileFunction { /** * Bypasses elements in the iterable as long as a specified asynchronous condition is true and then returns the remaining elements. * @param condition An asynchronous predicate of `T`. All elements are skipped from the iterable until this evaluates to `false` for the first time. * @returns A [[FluentAsyncIterable]] of the elements after the condition is not met. */ (condition: AsyncPredicate): FluentAsyncIterable; /** * Bypasses elements in the iterable as long as a specified asynchronous condition is true and then returns the remaining elements. * @param condition An asynchronous predicate of `T`. All elements are skipped from the iterable until this evaluates to `false` for the first time. * @returns A [[FluentAsyncIterable]] of the elements after the condition is not met. */ (condition: R): FluentAsyncIterable; }