-
Notifications
You must be signed in to change notification settings - Fork 1
IEnumerable
Provides an interface for enumerating data sets, transforming, and manipulating data.
- getEnumerator
- aggregate
- all
- any
- *append
- *apply
- at
- average
- *concat
- count
- distinct
- *except
- first
- firstIndex
- groupBy
- intersect
- join
- last
- lastIndex
- max
- min
- *orderBy
- *orderByDescending
- *prepend
- reverse
- *select
- *selectMany
- *skip
- *skipWhile
- sum
- *take
- *takeWhile
- toArray
- *traverse
- *traverseUnique
- union
- *where
- zip
getEnumerator(): IEnumerator<T>;Creates an enumerator on this enumerable.
aggregate<TAccumulate>(seed: TAccumulate, accumulator: (acc: TAccumulate, cur: T) => TAccumulate): TAccumulate;Aggregates items beginning with a seed value and an accumulator function.
all(predicate?: (t: T, index?: number) => boolean): boolean;Verifies that projections of all items using the predicate function evaluate to true.
any(predicate?: (t: T, index?: number) => boolean): boolean;Verifies that a projection of any item using the predicate function evaluates to true.
append(...items: T[]): IEnumerable<T>;Does not enumerate. Creates an IEnumerable by appending the input items. This allows individual items to be inserted at the end of the enumeration.
apply<T>(action: (t: T, index?: number) => void): IEnumerable<T>;Does not enumerate. Creates an IEnumerable that applies action function to all items.
at(index: number): T;Retrieves the item at index.
average(selector?: (t: T) => number): number;Aggregates all items by taking the average. The optional selector function can be used to project items to numbers.
concat(second: IEnumerable<T>): IEnumerable<T>;
concat(second: T[]): IEnumerable<T>;Does not enumerate. Creates a single IEnumerable with this items immediately preceding items from second.
count(predicate?: (t: T) => boolean): number;Counts the number of items. The optional predicate function can be used to filter items.
distinct(comparer?: (f: T, s: T) => boolean): IEnumerable<T>;Creates an IEnumerable with distinct items. If comparer is not specified, uses strict equality === to check for distinctness. Otherwise, comparer is used to verify whether f and s are the same.
except(second: IEnumerable<T>, comparer?: (f: T, s: T) => boolean): IEnumerable<T>;
except(second: T[], comparer?: (f: T, s: T) => boolean): IEnumerable<T>;Creates an IEnumerable from the set complement (this \ second). If comparer is not specified, uses strict equality === to compare. Otherwise, comparer is used to verify whether f and s are the same.
first(match?: (t: T) => boolean): T;Finds the first item that passes the match function. If no match function is specified, returns the first item. If this enumerable is empty, returns undefined.
firstIndex (match?: (t: T) => boolean): number;Finds the first item that passes the match function. If there are no items, returns -1. If no match function is specified, this will return -1 with an empty enumerable or 0 with a non-empty enumerable.
groupBy<TKey>(keySelector: (t: T) => TKey, comparer?: (k1: TKey, k2: TKey) => boolean): IEnumerable<IGrouping<TKey, T>>;Groups items into IEnumerable<IGrouping<TKey, T>> using the keySelector function to project a key element. If comparer is not specified, uses strict equality === to compare the keys from keySelector function. Otherwise, comparer is used to verify k1 and k2 are the same. The first key seen in a group will be used as the key in the group. See IGrouping.
intersect(second: IEnumerable<T>, comparer?: (f: T, s: T) => boolean): IEnumerable<T>;
intersect(second: T[], comparer?: (f: T, s: T) => boolean): IEnumerable<T>;Creates an IEnumerable from the set intersection (this ∩ second). If comparer is not specified, strict equality === is used to compare. Otherwise, comparer is used to verify whether f and s are the same.
join<TInner, TKey, TResult>(inner: IEnumerable<TInner>, outerKeySelector: (t: T) => TKey, innerKeySelector: (t: TInner) => TKey, resultSelector: (o: T, i: TInner) => TResult, comparer?: (k1: TKey, k2: TKey) => boolean): IEnumerable<TResult>;
join<TInner, TKey, TResult>(inner: TInner[], outerKeySelector: (t: T) => TKey, innerKeySelector: (t: TInner) => TKey, resultSelector: (o: T, i: TInner) => TResult, comparer?: (k1: TKey, k2: TKey) => boolean): IEnumerable<TResult>;Creates an IEnumerable from the set cross product (this × inner). Items are included where resulting keys from outerKeySelector and innerKeySelector match. If comparer is not specified, strict equality === is used to compare. Otherwise, comparer is used to verify whether k1 and k2 are the same.
last(match?: (t: T) => boolean): T;Finds the last item that matches match function. If no match function is specified, returns the last item. If this enumerable is empty, returns undefined.
lastIndex (match?: (t: T) => boolean): number;Finds the last item that passes the match function. If there are no items, returns -1. If no match function is specified, this will return -1 with an empty enumerable or (n - 1) with a non-empty enumerable.
max(selector?: (t: T) => number): number;Uses Math.max to determine the max of all items. The optional selector function can be used to project items to numbers.
min(selector?: (t: T) => number): number;Uses Math.min to determine the min of all items. The optional selector function can be used to project items to numbers.
orderBy<TKey>(keySelector: (t: T) => TKey, comparer?: (f: TKey, s: TKey) => number): IOrderedEnumerable<T>;Does not enumerate. Creates an IOrderedEnumerable by ordering based on the key from the keySelector function. The optional comparer function can be used for custom comparison.
orderByDescending<TKey>(keySelector: (t: T) => TKey, comparer?: (f: TKey, s: TKey) => number): IOrderedEnumerable<T>;Does not enumerate. Creates an IOrderedEnumerable by ordering in descending order based on the key from the keySelector function. The optional comparer function can be used for custom comparison.
prepend(...items: T[]): IEnumerable<T>;Does not enumerate. Creates an IEnumerable by prepending the input items. This allows individual items to be inserted at the beginning of the enumeration.
reverse(): IEnumerable<T>;Creates an IEnumerable from the reverse order of items.
select<TResult>(selector: (t: T, index?: number) => TResult): IEnumerable<TResult>;Does not enumerate. Projects items to new objec
selectMany<TResult>(selector: (t: T) => IEnumerable<TResult>): IEnumerable<TResult>;
selectMany<TResult>(selector: (t: T) => TResult[]): IEnumerable<TResult>;Does not enumerate. Creates an IEnumerable from a flattened projection of elements. The selector function should return an IEnumerable or Array that is used to concatenate to the resulting IEnumerable.
skip(count: number): IEnumerable<T>;Does not enumerate. Creates an IEnumerable that begins after count items.
skipWhile(predicate: (t: T, index?: number) => boolean): IEnumerable<T>;Does not enumerate. Creates an IEnumerable skipping items while predicate function is satisfied.
sum(selector?: (t: T) => number): number;Adds all items. Can optionally project items to numbers using selector function.
take(count: number): IEnumerable<T>;Does not enumerate. Creates an IEnumerable that only takes count items.
takeWhile(predicate: (t: T, index?: number) => boolean): IEnumerable<T>;Does not enumerate. Creates an IEnumerable that takes items while predicate function is satisfied.
toArray(): T[];Enumerates items and places into an array.
traverse(selector: (t: T) => T[]): IEnumerable<T>;
traverse(selector: (t: T) => IEnumerable<T>): IEnumerable<T>;(v0.2.9) Does not enumerate. Creates an IEnumerable that traverses a hierarchical data structure. Resulting IEnumerable is a pre-order traversal of the tree using selector to walk children.
traverseUnique(selector: (t: T) => T[], matcher?: (t1: T, t2: T) => boolean): IEnumerable<T>;
traverseUnique(selector: (t: T) => IEnumerable<T>, matcher?: (t1: T, t2: T) => boolean): IEnumerable<T>;(v0.2.10) Does not enumerate. Traverses just like traverse with circular reference checking. Uses optional matcher to test equality. If matcher is not specified, uses === to test for equality.
union(second: IEnumerable<T>, comparer?: (f: T, s: T) => boolean): IEnumerable<T>;
union(second: T[], comparer?: (f: T, s: T) => boolean): IEnumerable<T>;Creates an IEnumerable from the set union (this ∪ second). If comparer is not specified, uses strict equality === to compare. Otherwise, comparer is used to verify whether f and s are the same.
where(filter: (t: T) => boolean): IEnumerable<T>;Does not enumerate. Creates an IEnumerable with items that satisfy filter function.
zip<TSecond, TResult>(second: IEnumerable<TSecond>, resultSelector: (f: T, s: TSecond) => TResult): IEnumerable<TResult>;
zip<TSecond, TResult>(second: TSecond[], resultSelector: (f: T, s: TSecond) => TResult): IEnumerable<TResult>;Creates an IEnumerable from a matching of elements from this and second. Items matching indices are passed through the resultSelector function to create a resulting object.