Interface IOrderedParallelEnumerable<TSource>

Represents an async parallel enumeration that has been ordered.

interface IOrderedParallelEnumerable {
    dataFunc: TypedData<TSource>;
    [asyncIterator](): AsyncIterableIterator<TSource>;
    aggregate(func): Promise<TSource>;
    aggregate<TAccumulate>(seed, func): Promise<TAccumulate>;
    aggregate<TAccumulate, TResult>(seed, func, resultSelector): Promise<TResult>;
    all(predicate): Promise<boolean>;
    allAsync(predicate): Promise<boolean>;
    any(predicate?): Promise<boolean>;
    anyAsync(predicate): Promise<boolean>;
    append(element): IParallelEnumerable<TSource>;
    asAsync(): IAsyncEnumerable<TSource>;
    average(this): Promise<number>;
    average(selector): Promise<number>;
    averageAsync(selector): Promise<number>;
    chunk(size): IParallelEnumerable<TSource[]>;
    concatenate(second): IParallelEnumerable<TSource>;
    contains(value, comparer?): Promise<boolean>;
    containsAsync(value, comparer): Promise<boolean>;
    count(predicate?): Promise<number>;
    countAsync(predicate): Promise<number>;
    defaultIfEmpty(defaultValue): IParallelEnumerable<TSource>;
    distinct(comparer?): IParallelEnumerable<TSource>;
    distinctAsync(comparer): IParallelEnumerable<TSource>;
    each(action): IParallelEnumerable<TSource>;
    eachAsync(action): IParallelEnumerable<TSource>;
    elementAt(index): Promise<TSource>;
    elementAtOrDefault(index): Promise<null | TSource>;
    except(second, comparer?): IParallelEnumerable<TSource>;
    exceptAsync(second, comparer): IParallelEnumerable<TSource>;
    first(predicate?): Promise<TSource>;
    firstAsync(predicate): Promise<TSource>;
    firstOrDefault(predicate?): Promise<null | TSource>;
    firstOrDefaultAsync(predicate): Promise<null | TSource>;
    groupBy<TKey>(keySelector): IParallelEnumerable<IGrouping<TKey, TSource>>;
    groupBy<TKey>(keySelector, comparer): IParallelEnumerable<IGrouping<TKey, TSource>>;
    groupByAsync<TKey>(keySelector): IParallelEnumerable<IGrouping<TKey, TSource>>;
    groupByAsync<TKey>(keySelector, comparer): IParallelEnumerable<IGrouping<TKey, TSource>>;
    groupByWithSel<TElement, TKey>(keySelector, elementSelector): IParallelEnumerable<IGrouping<TKey, TElement>>;
    groupByWithSel<TKey, TElement>(keySelector, elementSelector, comparer): IParallelEnumerable<IGrouping<TKey, TElement>>;
    groupJoin<TInner, TKey, TResult>(inner, outerKeySelector, innerKeySelector, resultSelector, comparer?): IParallelEnumerable<TResult>;
    groupJoinAsync<TInner, TKey, TResult>(inner, outerKeySelector, innerKeySelector, resultSelector, comparer?): IParallelEnumerable<TResult>;
    intersect(second, comparer?): IParallelEnumerable<TSource>;
    intersectAsync(second, comparer): IParallelEnumerable<TSource>;
    joinByKey<TInner, TKey, TResult>(inner, outerKeySelector, innerKeySelector, resultSelector, comparer?): IParallelEnumerable<TResult>;
    last(predicate?): Promise<TSource>;
    lastAsync(predicate): Promise<TSource>;
    lastOrDefault(predicate?): Promise<null | TSource>;
    lastOrDefaultAsync(predicate): Promise<null | TSource>;
    max(this): Promise<number>;
    max(selector): Promise<number>;
    maxAsync(selector): Promise<number>;
    min(this): Promise<number>;
    min(selector): Promise<number>;
    minAsync(selector): Promise<number>;
    ofType<TType>(type): IParallelEnumerable<InferType<TType>>;
    order(comparer?): IOrderedParallelEnumerable<TSource>;
    orderBy<TKey>(predicate, comparer?): IOrderedParallelEnumerable<TSource>;
    orderByAsync<TKey>(predicate, comparer?): IOrderedParallelEnumerable<TSource>;
    orderByDescending<TKey>(predicate, comparer?): IParallelEnumerable<TSource>;
    orderByDescendingAsync<TKey>(predicate, comparer?): IParallelEnumerable<TSource>;
    orderDescending(comparer?): IParallelEnumerable<TSource>;
    partition(predicate): Promise<[pass: TSource[], fail: TSource[]]>;
    partitionAsync(predicate): Promise<[pass: TSource[], fail: TSource[]]>;
    prepend(element): IParallelEnumerable<TSource>;
    reverse(): IParallelEnumerable<TSource>;
    select<TResult>(selector): IParallelEnumerable<TResult>;
    select<TKey>(key): IParallelEnumerable<TSource[TKey]>;
    selectAsync<TResult>(selector): IParallelEnumerable<TResult>;
    selectAsync<TKey, TResult>(this, selector): IParallelEnumerable<TResult>;
    selectMany<TResult>(selector): IParallelEnumerable<TResult>;
    selectMany<TBindedSource, TOut>(this, selector): IParallelEnumerable<TOut>;
    selectManyAsync<TResult>(selector): IParallelEnumerable<TResult>;
    sequenceEquals(second, comparer?): Promise<boolean>;
    sequenceEqualsAsync(second, comparer?): Promise<boolean>;
    single(predicate?): Promise<TSource>;
    singleAsync(predicate): Promise<TSource>;
    singleOrDefault(predicate?): Promise<null | TSource>;
    singleOrDefaultAsync(predicate): Promise<null | TSource>;
    skip(count): IParallelEnumerable<TSource>;
    skipWhile(predicate): IParallelEnumerable<TSource>;
    skipWhileAsync(predicate): IParallelEnumerable<TSource>;
    sum(this): Promise<number>;
    sum(selector): Promise<number>;
    sumAsync(selector): Promise<number>;
    take(amount): IParallelEnumerable<TSource>;
    takeWhile(predicate): IParallelEnumerable<TSource>;
    takeWhileAsync(predicate): IParallelEnumerable<TSource>;
    thenBy<TKey>(keySelector, comparer?): IOrderedParallelEnumerable<TSource>;
    thenByAsync<TKey>(keySelector, comparer?): IOrderedParallelEnumerable<TSource>;
    thenByDescending<TKey>(keySelector, comparer?): IOrderedParallelEnumerable<TSource>;
    thenByDescendingAsync<TKey>(keySelector, comparer?): IOrderedParallelEnumerable<TSource>;
    toArray(): Promise<TSource[]>;
    toMap<TKey>(selector): Promise<Map<TKey, TSource[]>>;
    toMapAsync<TKey>(selector): Promise<Map<TKey, TSource[]>>;
    toObject<TKey>(selector): Promise<Record<TKey, TSource>>;
    toObjectAsync<TKey>(selector): Promise<Record<TKey, TSource>>;
    toSet(): Promise<Set<TSource>>;
    union(second, comparer?): IParallelEnumerable<TSource>;
    unionAsync(second, comparer?): IParallelEnumerable<TSource>;
    where(predicate): IParallelEnumerable<TSource>;
    whereAsync(predicate): IParallelEnumerable<TSource>;
    zip<TSecond, TResult>(second, resultSelector): IParallelEnumerable<TResult>;
    zip<TSecond>(second): IParallelEnumerable<[TSource, TSecond]>;
    zipAsync<TSecond, TResult>(second, resultSelector): IParallelEnumerable<TResult>;
}

Type Parameters

  • TSource

Hierarchy

Properties

dataFunc: TypedData<TSource>

Used for processing.

Methods

  • Applies an accumulator function over a sequence.

    Parameters

    • func: ((x, y) => TSource)

      An accumulator function to be invoked on each element.

        • (x, y): TSource
        • Parameters

          • x: TSource
          • y: TSource

          Returns TSource

    Returns Promise<TSource>

    The final accumulator value.

  • Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.

    Type Parameters

    • TAccumulate

    Parameters

    • seed: TAccumulate

      The initial accumulator value.

    • func: ((x, y) => TAccumulate)

      An accumulator function to be invoked on each element.

        • (x, y): TAccumulate
        • Parameters

          • x: TAccumulate
          • y: TSource

          Returns TAccumulate

    Returns Promise<TAccumulate>

    The final accumulator value.

  • Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.

    Type Parameters

    • TAccumulate

    • TResult

    Parameters

    • seed: TAccumulate

      The initial accumulator value.

    • func: ((x, y) => TAccumulate)

      An accumulator function to be invoked on each element.

        • (x, y): TAccumulate
        • Parameters

          • x: TAccumulate
          • y: TSource

          Returns TAccumulate

    • resultSelector: ((x) => TResult)

      A function to transform the final accumulator value into the result value.

        • (x): TResult
        • Parameters

          • x: TAccumulate

          Returns TResult

    Returns Promise<TResult>

    The transformed final accumulator value.

  • Determines whether all elements of a sequence satisfy a condition.

    Parameters

    • predicate: ((x) => boolean)

      A function to test each element for a condition.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<boolean>

    true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.

  • Determines whether all elements of a sequence satisfy a condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<boolean>

    true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.

  • Determines whether a sequence contains any elements. If predicate is specified, determines whether any element of a sequence satisfies a condition.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<boolean>

    true if the source sequence contains any elements or passes the test specified; otherwise, false.

  • Determines whether any element of a sequence satisfies a condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<boolean>

    true if the source sequence contains any elements or passes the test specified; otherwise, false.

  • Computes the average of a sequence of number values.

    Parameters

    Returns Promise<number>

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns Promise<number>

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => Promise<number>)

      An async transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    The average of the sequence of values.

    Throws

    source contains no elements.

  • Determines whether a sequence contains a specified element by using the specified or default IEqualityComparer.

    Parameters

    • value: TSource

      The value to locate in the sequence.

    • Optional comparer: IEqualityComparer<TSource>

      An equality comparer to compare values. Optional.

    Returns Promise<boolean>

    true if the source sequence contains an element that has the specified value; otherwise, false.

  • Determines whether a sequence contains a specified element by using the specified or default IEqualityComparer.

    Parameters

    • value: TSource

      The value to locate in the sequence.

    • comparer: IAsyncEqualityComparer<TSource>

      An async equality comparer to compare values.

    Returns Promise<boolean>

    true if the source sequence contains an element that has the specified value; otherwise, false.

  • Returns the number of elements in a sequence or represents how many elements in the specified sequence satisfy a condition if the predicate is specified.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<number>

    The number of elements in the input sequence.

  • Returns the number of elements in a sequence or represents how many elements in the specified sequence satisfy a condition if the predicate is specified.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<number>

    The number of elements in the input sequence.

  • Returns the element at a specified index in a sequence.

    Parameters

    • index: number

      The zero-based index of the element to retrieve.

    Returns Promise<TSource>

    The element at the specified position in the source sequence.

    Throws

    index is less than 0 or greater than or equal to the number of elements in source.

  • Returns the element at a specified index in a sequence or a default value if the index is out of range.

    Parameters

    • index: number

      The zero-based index of the element to retrieve.

    Returns Promise<null | TSource>

    null if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence.

  • Produces the set difference of two sequences by using the comparer provided or EqualityComparer to compare values.

    Parameters

    • second: IAsyncParallel<TSource>

      An IAsyncParallel whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.

    • Optional comparer: IEqualityComparer<TSource>

      An IEqualityComparer to compare values. Optional.

    Returns IParallelEnumerable<TSource>

    A sequence that contains the set difference of the elements of two sequences.

  • Parameters

    • Optional predicate: ((x) => boolean)
        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<TSource>

    Throws

    Sequence contains no elements

    Throws

    Sequence contains no matching elements

  • Returns the first element in a sequence that satisfies a specified condition.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      A function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    The first element in the sequence that passes the test in the specified predicate function.

    Throws

    No elements in Iteration matching predicate

  • Returns first element in sequence that satisfies predicate otherwise returns the first element in the sequence. Returns null if no value found.

    Parameters

    • Optional predicate: ((x) => boolean)

      A function to test each element for a condition. Optional.

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<null | TSource>

    The first element in the sequence or the first element that passes the test in the specified predicate function. Returns null if no value found.

  • Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

    Parameters

    • predicate: ((x) => Promise<boolean>)

      An async function to test each element for a condition.

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<null | TSource>

    null if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate.

  • Groups the elements of a sequence according to a specified key selector function.

    Type Parameters

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns IParallelEnumerable<IGrouping<TKey, TSource>>

    An IParallelEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

    Type Parameters

    • TKey

    Parameters

    • keySelector: ((x) => TKey)

      A function to extract the key for each element.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    • comparer: IEqualityComparer<TKey>

      An IEqualityComparer to compare keys.

    Returns IParallelEnumerable<IGrouping<TKey, TSource>>

    An IParallelEnumerable<IGrouping<TKey, TSource>> where each IGrouping<TKey,TElement> object contains a sequence of objects and a key.

  • Correlates the elements of two sequences based on equality of keys and groups the results.

    Type Parameters

    • TInner

    • TKey

    • TResult

    Parameters

    • inner: Iterable<TInner> | AsyncIterable<TInner>

      The sequence to join to the first sequence.

    • outerKeySelector: ((value) => TKey)

      The sequence to join to the first sequence.

        • (value): TKey
        • Parameters

          • value: TSource

          Returns TKey

    • innerKeySelector: ((value) => TKey)

      A function to extract the join key from each element of the second sequence.

        • (value): TKey
        • Parameters

          • value: TInner

          Returns TKey

    • resultSelector: ((element, collection) => TResult)

      A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.

        • (element, collection): TResult
        • Parameters

          • element: TSource
          • collection: TInner[]

          Returns TResult

    • Optional comparer: IEqualityComparer<TKey>

      To compare keys. Optional.

    Returns IParallelEnumerable<TResult>

    An IParallelEnumerable that contains elements of type TResult that are obtained by performing a grouped join on two sequences.

  • Correlates the elements of two sequences based on equality of keys and groups the results.

    Type Parameters

    • TInner

    • TKey

    • TResult

    Parameters

    • inner: Iterable<TInner> | AsyncIterable<TInner>

      The sequence to join to the first sequence. Can be async.

    • outerKeySelector: ((value) => TKey | Promise<TKey>)

      The sequence to join to the first sequence. Can be async.

        • (value): TKey | Promise<TKey>
        • Parameters

          • value: TSource

          Returns TKey | Promise<TKey>

    • innerKeySelector: ((value) => TKey | Promise<TKey>)

      A function to extract the join key from each element of the second sequence.

        • (value): TKey | Promise<TKey>
        • Parameters

          • value: TInner

          Returns TKey | Promise<TKey>

    • resultSelector: ((element, collection) => TResult | Promise<TResult>)

      A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. Can be async.

        • (element, collection): TResult | Promise<TResult>
        • Parameters

          • element: TSource
          • collection: TInner[]

          Returns TResult | Promise<TResult>

    • Optional comparer: IEqualityComparer<TKey>

      To compare keys. Optional.

    Returns IParallelEnumerable<TResult>

    An IParallelEnumerable that contains elements of type TResult that are obtained by performing a grouped join on two sequences.

  • Parameters

    • Optional predicate: ((x) => boolean)
        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<TSource>

    Throws

    Sequence contains no elements

    Throws

    Sequence contains no matching element

  • Parameters

    • predicate: ((x) => Promise<boolean>)
        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    Throws

    Sequence contains no matching element

  • Partitions the values into a tuple of failing and passing arrays

    Parameters

    • predicate: ((x) => boolean)

      Predicate to determine whether a value passes or fails

        • (x): boolean
        • Parameters

          • x: TSource

          Returns boolean

    Returns Promise<[pass: TSource[], fail: TSource[]]>

    [values that pass, values that fail]

  • Partitions the values into a tuple of failing and passing arrays

    Parameters

    • predicate: ((x) => Promise<boolean>)

      Async predicate to determine whether a value passes or fails

        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<[pass: TSource[], fail: TSource[]]>

    [values that pass, values that fail]

  • Parameters

    • predicate: ((x) => Promise<boolean>)
        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<TSource>

    Throws

    Sequence contains more than one matching element

    Throws

    Sequence contains no matching element

  • Parameters

    • predicate: ((x) => Promise<boolean>)
        • (x): Promise<boolean>
        • Parameters

          • x: TSource

          Returns Promise<boolean>

    Returns Promise<null | TSource>

    Throws

    Sequence contains more than one matching element

  • Computes the sum of the sequence of numeric values.

    Parameters

    Returns Promise<number>

    A promise of the sum of the values in the sequence.

  • Computes the sum of the sequence of numeric values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => number)

      A transform function to apply to each element.

        • (x): number
        • Parameters

          • x: TSource

          Returns number

    Returns Promise<number>

    A promise of the sum of the projected values.

  • Computes the sum of the sequence of numeric values that are obtained by invoking a transform function on each element of the input sequence.

    Parameters

    • selector: ((x) => Promise<number>)

      An async transform function to apply to each element.

        • (x): Promise<number>
        • Parameters

          • x: TSource

          Returns Promise<number>

    Returns Promise<number>

    A promise of the sum of the projected values.

  • Converts the async or parallel iteration to a Map<TKey, TSource[]>.

    Type Parameters

    • TKey

    Parameters

    • selector: ((x) => TKey)

      A function to serve as a key selector.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns Promise<Map<TKey, TSource[]>>

    A promise for Map<TKey, TSource[]>

  • Converts the async or parallel iteration to a Map<TKey, TSource[]>.

    Type Parameters

    • TKey

    Parameters

    • selector: ((x) => Promise<TKey>)

      An async function to serve as a key selector.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    Returns Promise<Map<TKey, TSource[]>>

    A promise for Map<TKey, TSource[]>

  • Converts the Iteration to an Object. Duplicate values will be overriden.

    Type Parameters

    • TKey extends string | number | symbol

    Parameters

    • selector: ((x) => TKey)

      A function to determine the Key based on the value.

        • (x): TKey
        • Parameters

          • x: TSource

          Returns TKey

    Returns Promise<Record<TKey, TSource>>

    Promise of KVP Object

  • Converts the Iteration to an Object. Duplicate values will be overriden.

    Type Parameters

    • TKey extends string | number | symbol

    Parameters

    • selector: ((x) => Promise<TKey>)

      An async function to determine the Key based on the value.

        • (x): Promise<TKey>
        • Parameters

          • x: TSource

          Returns Promise<TKey>

    Returns Promise<Record<TKey, TSource>>

    Promise of KVP Object

  • Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => boolean)

      A function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): boolean
        • Parameters

          • x: TSource
          • index: number

          Returns boolean

    Returns IParallelEnumerable<TSource>

    An IParallelEnumerable that contains elements from the input sequence that satisfy the condition.

  • Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

    Parameters

    • predicate: ((x, index) => Promise<boolean>)

      A async function to test each source element for a condition; the second parameter of the function represents the index of the source element.

        • (x, index): Promise<boolean>
        • Parameters

          • x: TSource
          • index: number

          Returns Promise<boolean>

    Returns IParallelEnumerable<TSource>

    An IParallelEnumerable that contains elements from the input sequence that satisfy the condition.

Generated using TypeDoc