import { IForwardContainer } from "../container/IForwardContainer"; import { Pair } from "../../utility/Pair"; import { UnaryPredicator } from "../../internal/functional/UnaryPredicator"; import { BinaryPredicator } from "../../internal/functional/BinaryPredicator"; import { Comparator } from "../../internal/functional/Comparator"; declare type BinaryPredicatorInferrer | IForwardContainer, Range2 extends Array | IForwardContainer> = BinaryPredicator, IForwardContainer.ValueType>; /** * Apply a function to elements in range. * * @param range An iterable ranged container. * @param fn The function to apply. * * @return The function *fn* itself. */ export declare function for_each | IForwardContainer, Func extends (val: IForwardContainer.ValueType) => any>(range: Range, fn: Func): Func; /** * Apply a function to elements in steps. * * @param range An iterable ranged container. * @param n Steps to maximum advance. * @param fn The function to apply. * * @return Iterator advanced from *first* for *n* steps. */ export declare function for_each_n | IForwardContainer, Func extends (val: IForwardContainer.ValueType) => any>(range: Range, n: number, fn: Func): IForwardContainer.IteratorType; /** * Test whether all elements meet a specific condition. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return Whether the *pred* returns always `true` for all elements. */ export declare function all_of | IForwardContainer>(range: Range, pred: UnaryPredicator>): boolean; /** * Test whether any element meets a specific condition. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return Whether the *pred* returns at least a `true` for all elements. */ export declare function any_of | IForwardContainer>(range: Range, pred: UnaryPredicator>): boolean; /** * Test whether any element doesn't meet a specific condition. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return Whether the *pred* doesn't return `true` for all elements. */ export declare function none_of | IForwardContainer>(range: Range, pred: UnaryPredicator>): boolean; /** * Test whether two ranges are equal. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return Whether two ranges are equal. */ export declare function equal | (IForwardContainer), Range2 extends IForwardContainer.SimilarType>(range1: Range1, range2: Range2): boolean; /** * Test whether two ranges are equal. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return Whether two ranges are equal. */ export declare function equal | IForwardContainer, Range2 extends Array | IForwardContainer>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer): boolean; /** * Compare lexicographically. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param comp A binary function predicates *x* element would be placed before *y*. When returns `true`, then *x* precedes *y*. Default is {@link less}. * * @return Whether the 1st range precedes the 2nd. */ export declare function lexicographical_compare | IForwardContainer, Range2 extends IForwardContainer.SimilarType>(range1: Range1, range2: Range2, comp?: BinaryPredicatorInferrer): boolean; /** * Find a value in range. * * @param range An iterable ranged container. * @param val The value to find. * * @return Iterator to the first element {@link equal to equal_to} the value. */ export declare function find | IForwardContainer>(range: Range, val: IForwardContainer.ValueType): IForwardContainer.IteratorType; /** * Find a matched condition in range. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return Iterator to the first element *pred* returns `true`. */ export declare function find_if | IForwardContainer>(range: Range, pred: UnaryPredicator>): IForwardContainer.IteratorType; /** * Find a mismatched condition in range. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return Iterator to the first element *pred* returns `false`. */ export declare function find_if_not | IForwardContainer>(range: Range, pred: UnaryPredicator>): IForwardContainer.IteratorType; /** * Find the last sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * * @return Iterator to the first element of the last sub range. */ export declare function find_end | IForwardContainer, Range2 extends IForwardContainer.SimilarType>(range1: Range1, range2: Range2): IForwardContainer.IteratorType; /** * Find the last sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return Iterator to the first element of the last sub range. */ export declare function find_end | IForwardContainer, Range2 extends Array | IForwardContainer>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer): IForwardContainer.IteratorType; /** * Find the first sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * * @return Iterator to the first element of the first sub range. */ export declare function find_first_of | IForwardContainer, Range2 extends IForwardContainer.SimilarType>(range1: Range1, range2: Range2): IForwardContainer.IteratorType; /** * Find the first sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return Iterator to the first element of the first sub range. */ export declare function find_first_of | IForwardContainer, Range2 extends Array | IForwardContainer>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer): IForwardContainer.IteratorType; /** * Find the first adjacent element. * * @param range An iterable ranged container. * @param pred A binary function predicates two arguments are equal. Default is {@link equal_to}. * * @return Iterator to the first element of adjacent find. */ export declare function adjacent_find | IForwardContainer>(range: Range, pred?: Comparator>): IForwardContainer.IteratorType; /** * Search sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * * @return Iterator to the first element of the sub range. */ export declare function search | IForwardContainer, Range2 extends Array | IForwardContainer.SimilarType>(range1: Range1, range2: Range2): IForwardContainer.IteratorType; /** * Search sub range. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return Iterator to the first element of the sub range. */ export declare function search | IForwardContainer, Range2 extends Array | IForwardContainer>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer): IForwardContainer.IteratorType; /** * Search specific and repeated elements. * * @param range An iterable ranged container. * @param count Count to be repeated. * @param val Value to search. * @param pred A binary function predicates two arguments are equal. Default is {@link equal_to}. * * @return Iterator to the first element of the repetition. */ export declare function search_n | IForwardContainer>(range: Range, count: number, val: IForwardContainer.ValueType, pred?: Comparator>): IForwardContainer.IteratorType; /** * Find the first mistmached position between two ranges. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * * @return A {@link Pair} of mismatched positions. */ export declare function mismatch | IForwardContainer, Range2 extends Array | IForwardContainer.SimilarType>(range1: Range1, range2: Range2): Pair, IForwardContainer.IteratorType>; /** * Find the first mistmached position between two ranges. * * @param range1 The 1st iterable ranged container. * @param range2 The 2nd iterable ranged container. * @param pred A binary function predicates two arguments are equal. * * @return A {@link Pair} of mismatched positions. */ export declare function mismatch | IForwardContainer, Range2 extends Array | IForwardContainer>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer): Pair, IForwardContainer.IteratorType>; /** * Count matched value in range. * * @param range An iterable ranged container. * @param val The value to count. * * @return The matched count. */ export declare function count | IForwardContainer>(range: Range, val: IForwardContainer.ValueType): number; /** * Count matched condition in range. * * @param range An iterable ranged container. * @param pred A function predicates the specific condition. * * @return The matched count. */ export declare function count_if | IForwardContainer>(range: Range, pred: UnaryPredicator>): number; export {}; //# sourceMappingURL=iterations.d.ts.map