Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AsyncHierarchyQuery<TNode, T, TNode, T>

Represents a sequence of hierarchically organized values.

Type parameters

  • TNode
  • T: TNode
  • TNode
  • T: TNode

Hierarchy

Implements

Index

Constructors

constructor

Methods (Query)

Static choose

  • Creates an AsyncQuery that iterates the elements from sources picked from a list based on the result of a lazily evaluated choice.

    category

    Query

    Type parameters

    • K
    • V

    Parameters

    • chooser: function

      A callback used to choose a source.

        • (): PromiseLike<K> | K
        • Returns PromiseLike<K> | K

    • choices: AsyncQueryable<AsyncChoice<K, V>>

      A list of sources

    • Optional otherwise: AsyncQueryable<V>

      A default source to use when another choice could not be made.

    Returns AsyncQuery<V>

Static consume

Static continuous

  • continuous<T>(value: PromiseLike<T> | T): AsyncQuery<T>

Static empty

Static from

Static generate

  • generate<T>(count: number, generator: function): AsyncQuery<T>
  • Creates an AsyncQuery whose values are provided by a callback executed a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • count: number

      The number of times to execute the callback.

    • generator: function

      The callback to execute.

        • (offset: number): PromiseLike<T> | T
        • Parameters

          • offset: number

          Returns PromiseLike<T> | T

    Returns AsyncQuery<T>

Static hierarchy

  • Creates an AsyncHierarchyQuery from a root node and a HierarchyProvider.

    category

    Query

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • root: PromiseLike<T> | T

      The root node of the hierarchy.

    • hierarchy: HierarchyProvider<TNode>

      A HierarchyProvider object.

    Returns AsyncHierarchyQuery<TNode, T>

Static if

  • Creates an AsyncQuery that iterates the elements from one of two sources based on the result of a lazily evaluated condition.

    category

    Query

    Type parameters

    • T

    Parameters

    • condition: function

      A callback used to choose a source.

        • (): PromiseLike<boolean> | boolean
        • Returns PromiseLike<boolean> | boolean

    • thenQueryable: AsyncQueryable<T>

      The source to use when the callback evaluates to true.

    • Optional elseQueryable: AsyncQueryable<T>

      The source to use when the callback evaluates to false.

    Returns AsyncQuery<T>

Static objectEntries

Static objectKeys

  • objectKeys<T>(source: PromiseLike<T> | T): AsyncQuery<Extract<keyof T, string>>

Static objectValues

  • objectValues<T>(source: PromiseLike<T> | T): AsyncQuery<T[Extract<keyof T, string>]>

Static of

  • of<T>(...elements: (T | PromiseLike<T>)[]): AsyncQuery<T>
  • Creates an AsyncQuery for the provided elements.

    category

    Query

    Type parameters

    • T

    Parameters

    • Rest ...elements: (T | PromiseLike<T>)[]

      The elements of the Query.

    Returns AsyncQuery<T>

Static once

  • once<T>(value: PromiseLike<T> | T): AsyncQuery<T>

Static repeat

  • repeat<T>(value: PromiseLike<T> | T, count: number): AsyncQuery<T>
  • Creates an AsyncQuery for a value repeated a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: PromiseLike<T> | T

      The value for each element of the Query.

    • count: number

      The number of times to repeat the value.

    Returns AsyncQuery<T>

Methods (Scalar)

average

  • average(): Promise<T extends number ? number : never>
  • average(elementSelector: function): Promise<number>
  • Computes the average for a series of numbers.

    NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Returns Promise<T extends number ? number : never>

  • Computes the average for a series of numbers.

    NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Parameters

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number | PromiseLike<number>
        • Parameters

          • element: T

          Returns number | PromiseLike<number>

    Returns Promise<number>

break

  • Creates a tuple whose first element is a subquery containing the first span of elements that do not match the supplied predicate, and whose second element is a subquery containing the remaining elements.

    The first subquery is eagerly evaluated, while the second subquery is lazily evaluated.

    category

    Scalar

    Parameters

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns Promise<[Query<T>, AsyncQuery<T>]>

copyTo

  • copyTo<U>(dest: U, start?: undefined | number, count?: undefined | number): Promise<U>
  • Writes each element to a destination array.

    category

    Scalar

    Type parameters

    Parameters

    • dest: U

      The destination array.

    • Optional start: undefined | number

      The offset into the array at which to start writing.

    • Optional count: undefined | number

      The number of elements to write to the array.

    Returns Promise<U>

corresponds

correspondsBy

  • correspondsBy<K>(right: AsyncQueryable<T>, keySelector: function): Promise<boolean>
  • correspondsBy<U, K>(right: AsyncQueryable<U>, leftKeySelector: function, rightKeySelector: function, keyEqualer?: EqualityComparison<K> | Equaler<K>): Promise<boolean>
  • Computes a scalar value indicating whether every element in this AsyncQuery corresponds to a matching element in another Queryable at the same position.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the key for every element in this AsyncQuery corresponds to a matching key in right at the same position.

    category

    Scalar

    Type parameters

    • U
    • K

    Parameters

    • right: AsyncQueryable<U>

      A Queryable object.

    • leftKeySelector: function

      A callback used to select the key for each element in this Query.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • rightKeySelector: function

      A callback used to select the key for each element in right.

        • (element: U): K
        • Parameters

          • element: U

          Returns K

    • Optional keyEqualer: EqualityComparison<K> | Equaler<K>

      An optional callback used to compare the equality of two keys.

    Returns Promise<boolean>

count

  • count(predicate?: undefined | function): Promise<number>
  • Counts the number of elements in the Query, optionally filtering elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<number>

drain

elementAt

  • elementAt(offset: number): Promise<T | undefined>
  • Finds the value in the Query at the provided offset. A negative offset starts from the last element.

    category

    Scalar

    Parameters

    • offset: number

      An offset.

    Returns Promise<T | undefined>

endsWith

eval

every

  • every(predicate: function): Promise<boolean>
  • Computes a scalar value indicating whether all elements of the Query match the supplied callback.

    category

    Scalar

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns Promise<boolean>

first

  • first<U>(predicate: function): Promise<U | undefined>
  • first(predicate?: undefined | function): Promise<T | undefined>
  • Gets the first element in the Query, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • U: T

    Parameters

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the first element in the Query, optionally filtering elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

forEach

  • forEach(callback: function): Promise<void>
  • forEach(callback: function): Promise<void>
  • Invokes a callback for each element of the query.

    category

    Scalar

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns Promise<void>

  • Invokes a callback for each element of the query.

    category

    Scalar

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void | PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns void | PromiseLike<void>

    Returns Promise<void>

includes

  • includes(value: T, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>
  • includes<U>(value: U, equaler: function): Promise<boolean>
  • Computes a scalar value indicating whether the provided value is included in the query.

    category

    Scalar

    Parameters

    • value: T

      A value.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      An optional callback used to compare the equality of two elements.

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the provided value is included in the query.

    category

    Scalar

    Type parameters

    • U

    Parameters

    • value: U

      A value.

    • equaler: function

      An optional callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns Promise<boolean>

includesSequence

last

  • last<U>(predicate: function): Promise<U | undefined>
  • last(predicate?: undefined | function): Promise<T | undefined>
  • Gets the last element in the Query, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • U: T

    Parameters

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the last element in the Query, optionally filtering elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

max

  • max(comparer?: Comparison<T> | Comparer<T>): Promise<T | undefined>
  • Gets the maximum element in the query, optionally comparing elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional comparer: Comparison<T> | Comparer<T>

      An optional callback used to compare two elements.

    Returns Promise<T | undefined>

maxBy

  • maxBy<K>(keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>
  • Gets the maximum element in the query, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to choose the key to compare.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare the keys.

    Returns Promise<T | undefined>

min

  • min(comparer?: Comparison<T> | Comparer<T>): Promise<T | undefined>
  • Gets the minimum element in the query, optionally comparing elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional comparer: Comparison<T> | Comparer<T>

      An optional callback used to compare two elements.

    Returns Promise<T | undefined>

minBy

  • minBy<K>(keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>
  • Gets the minimum element in the query, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to choose the key to compare.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare the keys.

    Returns Promise<T | undefined>

nth

  • nth(offset: number): Promise<T | undefined>
  • Finds the value in the Query at the provided offset. A negative offset starts from the last element.

    This is an alias for elementAt.

    category

    Scalar

    Parameters

    • offset: number

      An offset.

    Returns Promise<T | undefined>

reduce

  • reduce(accumulator: function): Promise<T>
  • reduce<U>(accumulator: function, seed?: U): Promise<U>
  • reduce<U, R>(accumulator: function, seed: U, resultSelector: function): Promise<R>
  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns Promise<T>

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • U

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • Optional seed: U

      An optional seed value.

    Returns Promise<U>

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • U
    • R

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R | PromiseLike<R>
        • Parameters

          • result: U
          • count: number

          Returns R | PromiseLike<R>

    Returns Promise<R>

reduceRight

  • reduceRight(accumulator: function): Promise<T>
  • reduceRight<U>(accumulator: function, seed: U): Promise<U>
  • reduceRight<U, R>(accumulator: function, seed: U, resultSelector: function): Promise<R>
  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns Promise<T>

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • U

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns Promise<U>

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • U
    • R

    Parameters

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R | PromiseLike<R>
        • Parameters

          • result: U
          • count: number

          Returns R | PromiseLike<R>

    Returns Promise<R>

single

  • single<U>(predicate: function): Promise<U | undefined>
  • single(predicate?: undefined | function): Promise<T | undefined>
  • Gets the only element in the Query, or returns undefined.

    category

    Scalar

    Type parameters

    • U: T

    Parameters

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the only element in the Query, or returns undefined.

    category

    Scalar

    Parameters

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

some

  • some(predicate?: undefined | function): Promise<boolean>
  • Computes a scalar value indicating whether the Query contains any elements, optionally filtering the elements using the supplied callback.

    category

    Scalar

    Parameters

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<boolean>

span

  • Creates a tuple whose first element is a subquery containing the first span of elements that match the supplied predicate, and whose second element is a subquery containing the remaining elements.

    The first subquery is eagerly evaluated, while the second subquery is lazily evaluated.

    category

    Scalar

    Type parameters

    • U: T

    Parameters

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns Promise<[Query<U>, AsyncQuery<T>]>

  • Creates a tuple whose first element is a subquery containing the first span of elements that match the supplied predicate, and whose second element is a subquery containing the remaining elements.

    The first subquery is eagerly evaluated, while the second subquery is lazily evaluated.

    category

    Scalar

    Parameters

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns Promise<[Query<T>, AsyncQuery<T>]>

startsWith

sum

  • sum(): Promise<T extends number ? number : never>
  • sum(elementSelector: function): Promise<number>
  • Computes the sum for a series of numbers.

    NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Returns Promise<T extends number ? number : never>

  • Computes the sum for a series of numbers.

    NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Parameters

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number | PromiseLike<number>
        • Parameters

          • element: T

          Returns number | PromiseLike<number>

    Returns Promise<number>

toArray

  • toArray(): Promise<T[]>
  • toArray<V>(elementSelector: function): Promise<V[]>
  • Creates an Array for the elements of the Query.

    category

    Scalar

    Returns Promise<T[]>

  • Creates an Array for the elements of the Query.

    category

    Scalar

    Type parameters

    • V

    Parameters

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<V[]>

toLookup

  • toLookup<K>(keySelector: function, keyEqualer?: Equaler<K>): Promise<Lookup<K, T>>
  • toLookup<K, V>(keySelector: function, elementSelector: function, keyEqualer?: Equaler<K>): Promise<Lookup<K, V>>
  • Creates a Lookup for the elements of the Query.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<Lookup<K, T>>

  • Creates a Lookup for the elements of the Query.

    category

    Scalar

    Type parameters

    • K
    • V

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<Lookup<K, V>>

toMap

  • toMap<K>(keySelector: function): Promise<Map<K, T>>
  • toMap<K>(keySelector: function, keyEqualer: Equaler<K>): Promise<HashMap<K, T>>
  • toMap<K, V>(keySelector: function, elementSelector: function): Promise<Map<K, V>>
  • toMap<K, V>(keySelector: function, elementSelector: function, keyEqualer: Equaler<K>): Promise<HashMap<K, V>>
  • Creates a Map for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Promise<Map<K, T>>

  • Creates a Map for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<HashMap<K, T>>

  • Creates a Map for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • K
    • V

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<Map<K, V>>

  • Creates a Map for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • K
    • V

    Parameters

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<HashMap<K, V>>

toObject

  • toObject(prototype: object | null | undefined, keySelector: function): Promise<object>
  • toObject<V>(prototype: object | null | undefined, keySelector: function, elementSelector: function, descriptorSelector?: undefined | function): Promise<object>
  • Creates an Object for the elements of the AsyncQuery. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(undefined, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(baseObject, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    obj.toString(); // "x",1:"y",2
    
    // with a null prototype
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(null, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // undefined
    category

    Scalar

    Parameters

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    Returns Promise<object>

  • Creates an Object for the elements the Query. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(undefined, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(baseObject, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    obj.toString(); // 1:2
    
    // with a null prototype
    const obj = await fromAsync([Promise.resolve(["x", 1]), ["y", 2]]).toObject(null, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // undefined
    category

    Scalar

    Type parameters

    • V

    Parameters

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • Optional descriptorSelector: undefined | function

      A callback that defines the PropertyDescriptor for each property.

    Returns Promise<object>

toSet

  • toSet(): Promise<Set<T>>
  • toSet(equaler: Equaler<T>): Promise<HashSet<T>>
  • toSet<V>(elementSelector: function): Promise<Set<V>>
  • toSet<V>(elementSelector: function, equaler: Equaler<V>): Promise<HashSet<V>>
  • Creates a Set for the elements of the AsyncQuery.

    category

    Scalar

    Returns Promise<Set<T>>

  • Creates a Set for the elements of the AsyncQuery.

    category

    Scalar

    Parameters

    • equaler: Equaler<T>

      An [[Equaler]] object used to compare equality.

    Returns Promise<HashSet<T>>

  • Creates a Set for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • V

    Parameters

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<Set<V>>

  • Creates a Set for the elements of the AsyncQuery.

    category

    Scalar

    Type parameters

    • V

    Parameters

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • equaler: Equaler<V>

      An [[Equaler]] object used to compare equality.

    Returns Promise<HashSet<V>>

unzip

  • unzip(): Promise<T extends [any, ...any[]] ? { [I in keyof T]: T[I][]; } : unknown[]>
  • unzip<U>(partSelector: function): Promise<object>
  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Returns Promise<T extends [any, ...any[]] ? { [I in keyof T]: T[I][]; } : unknown[]>

  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Type parameters

    • U: [any, Array]

    Parameters

    • partSelector: function

      A callback that converts a result into a tuple.

        • (value: T): U | PromiseLike<U>
        • Parameters

          • value: T

          Returns U | PromiseLike<U>

    Returns Promise<object>

Methods (Subquery)

append

concat

defaultIfEmpty

distinct

distinctBy

  • Creates a subquery for the distinct elements of this AsyncQuery.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key to determine uniqueness.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncUnorderedQueryFlow<this, T>

do

  • Lazily invokes a callback as each element of the query is iterated.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns AsyncUnorderedQueryFlow<this, T>

  • Lazily invokes a callback as each element of the query is iterated.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void>

    Returns AsyncUnorderedQueryFlow<this, T>

  • Lazily invokes a callback as each element of the query is iterated.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void> | void
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void> | void

    Returns AsyncUnorderedQueryFlow<this, T>

except

exceptBy

  • Creates a subquery for the set difference between this and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncUnorderedQueryFlow<this, T>

exclude

expand

  • Creates a subquery that iterates the results of recursively expanding the elements of the source.

    category

    Subquery

    Parameters

    • projection: function

      A callback used to recusively expand each element.

    Returns AsyncQuery<T>

filter

  • Creates a subquery whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • U: T

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns AsyncUnorderedQueryFlow<this, U>

  • Creates a subquery whose elements match the supplied predicate.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

filterBy

  • Creates a subquery where the selected key for each element matches the supplied predicate.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • key: K
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

filterDefined

flatMap

  • flatMap<U>(projection: function): AsyncQuery<U>
  • flatMap<U, R>(projection: function, resultSelector: function): AsyncQuery<R>
  • Creates a subquery that iterates the results of applying a callback to each element.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • projection: function

      A callback used to map each element into an iterable.

    Returns AsyncQuery<U>

  • Creates a subquery that iterates the results of applying a callback to each element.

    category

    Subquery

    Type parameters

    • U
    • R

    Parameters

    • projection: function

      A callback used to map each element into an iterable.

    • resultSelector: function
        • (element: T, innerElement: U): R | PromiseLike<R>
        • Parameters

          • element: T
          • innerElement: U

          Returns R | PromiseLike<R>

    Returns AsyncQuery<R>

groupBy

  • groupBy<K>(keySelector: function, keyEqualer?: Equaler<K>): AsyncQuery<Grouping<K, T>>
  • groupBy<K, V>(keySelector: function, elementSelector: function, keyEqualer?: Equaler<K>): AsyncQuery<Grouping<K, V>>
  • groupBy<K, V, R>(keySelector: function, elementSelector: function, resultSelector: function, keyEqualer?: Equaler<K>): AsyncQuery<R>
  • Groups each element of this AsyncQuery by its key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<Grouping<K, T>>

  • Groups each element by its key.

    category

    Subquery

    Type parameters

    • K
    • V

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<Grouping<K, V>>

  • Groups each element by its key.

    category

    Subquery

    Type parameters

    • K
    • V
    • R

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • resultSelector: function

      A callback used to select a result from a group.

        • (key: K, elements: Query<V>): R
        • Parameters

          • key: K
          • elements: Query<V>

          Returns R

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<R>

intersect

intersectBy

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • UNode
    • U: UNode & T
    • K

    Parameters

    • right: PossiblyAsyncHierarchyIterable<UNode, U>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncHierarchyQuery<UNode, U>

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • U: T
    • K

    Parameters

    • right: AsyncQueryable<U>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<U>

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<T>

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • UNode: TNode
    • U: UNode & T
    • K

    Parameters

    • right: PossiblyAsyncHierarchyIterable<UNode, U>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncHierarchyQuery<UNode, U>

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • U: T
    • K

    Parameters

    • right: AsyncQueryable<U>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the set intersection of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncHierarchyQuery<TNode, T>

map

  • Creates a subquery by applying a callback to each element.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • selector: function

      A callback used to map each element.

        • (element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    Returns AsyncQuery<U>

pageBy

  • Creates a subquery that splits this AsyncQuery into one or more pages. While advancing from page to page is evaluated lazily, the elements of the page are evaluated eagerly.

    category

    Subquery

    Parameters

    • pageSize: number

      The number of elements per page.

    Returns AsyncQuery<Page<T>>

patch

  • Creates a subquery for the elements of this AsyncQuery with the provided range patched into the results.

    category

    Subquery

    Parameters

    • start: number

      The offset at which to patch the range.

    • Optional skipCount: undefined | number

      The number of elements to skip from start.

    • Optional range: AsyncQueryable<T>

      The range to patch into the result.

    Returns AsyncUnorderedQueryFlow<this, T>

prepend

relativeComplement

relativeComplementBy

reverse

scan

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Parameters

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns AsyncQuery<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns AsyncQuery<U>

scanRight

  • scanRight(accumulator: function): AsyncQuery<T>
  • scanRight<U>(accumulator: function, seed?: U): AsyncQuery<U>
  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Parameters

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns AsyncQuery<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • Optional seed: U

      An optional seed value.

    Returns AsyncQuery<U>

select

  • Creates a subquery by applying a callback to each element. This is an alias for map.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • selector: function

      A callback used to map each element.

        • (element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    Returns AsyncQuery<U>

selectMany

  • selectMany<U>(projection: function): AsyncQuery<U>
  • selectMany<U, R>(projection: function, resultSelector: function): AsyncQuery<R>
  • Creates a subquery that iterates the results of applying a callback to each element. This is an alias for flatMap.

    category

    Subquery

    Type parameters

    • U

    Parameters

    • projection: function

      A callback used to map each element into an iterable.

    Returns AsyncQuery<U>

  • Creates a subquery that iterates the results of applying a callback to each element. This is an alias for flatMap.

    category

    Subquery

    Type parameters

    • U
    • R

    Parameters

    • projection: function

      A callback used to map each element into an iterable.

    • resultSelector: function
        • (element: T, innerElement: U): R | PromiseLike<R>
        • Parameters

          • element: T
          • innerElement: U

          Returns R | PromiseLike<R>

    Returns AsyncQuery<R>

skip

  • Creates a subquery containing all elements except the first elements up to the supplied count.

    category

    Subquery

    Parameters

    • count: number

      The number of elements to skip.

    Returns AsyncUnorderedQueryFlow<this, T>

skipRight

skipUntil

  • Creates a subquery containing all elements except the first elements that do not match the supplied predicate.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncUnorderedQueryFlow<this, T>

skipWhile

  • Creates a subquery containing all elements except the first elements that match the supplied predicate.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

spanMap

  • spanMap<K>(keySelector: function): AsyncQuery<Grouping<K, T>>
  • spanMap<K, V>(keySelector: function, elementSelector: function): AsyncQuery<Grouping<K, V>>
  • spanMap<K, V, R>(keySelector: function, elementSelector: function, spanSelector: function): AsyncQuery<R>
  • Creates a subquery whose elements are the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns AsyncQuery<Grouping<K, T>>

  • Creates a subquery whose values are computed from each element of the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • K
    • V

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns AsyncQuery<Grouping<K, V>>

  • Creates a subquery whose values are computed from the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • K
    • V
    • R

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • spanSelector: function

      A callback used to select a result from a contiguous range.

        • (key: K, elements: Query<V>): PromiseLike<R> | R
        • Parameters

          • key: K
          • elements: Query<V>

          Returns PromiseLike<R> | R

    Returns AsyncQuery<R>

symmetricDifference

symmetricDifferenceBy

take

takeRight

takeUntil

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

takeWhile

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • U: T

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncUnorderedQueryFlow<this, U>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

tap

  • Lazily invokes a callback as each element of the query is iterated. This is an alias for do.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns AsyncUnorderedQueryFlow<this, T>

  • Lazily invokes a callback as each element of the query is iterated. This is an alias for do.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void>

    Returns AsyncUnorderedQueryFlow<this, T>

  • Lazily invokes a callback as each element of the query is iterated. This is an alias for do.

    category

    Subquery

    Parameters

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void> | void
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void> | void

    Returns AsyncUnorderedQueryFlow<this, T>

through

  • Pass the entire query to the provided callback, creating a new query from the result.

    category

    Subquery

    Type parameters

    Parameters

    • callback: function

      A callback function.

        • (source: this): R
        • Parameters

          • source: this

          Returns R

    Returns AsyncQueryFlow<R, QueriedType<R>>

union

unionBy

  • Creates a subquery for the set union of this AsyncQuery and another AsyncQueryable, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncUnorderedQueryFlow<this, T>

where

  • Creates a subquery whose elements match the supplied predicate. This is an alias for filter.

    category

    Subquery

    Type parameters

    • U: T

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns AsyncUnorderedQueryFlow<this, U>

  • Creates a subquery whose elements match the supplied predicate. This is an alias for filter.

    category

    Subquery

    Parameters

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns AsyncUnorderedQueryFlow<this, T>

whereBy

  • Creates a subquery where the selected key for each element matches the supplied predicate.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean
        • Parameters

          • key: K
          • offset: number

          Returns boolean

    Returns AsyncUnorderedQueryFlow<this, T>

whereDefined

  • Creates a subquery whose elements are neither null nor undefined.

    NOTE: This is an alias for filterDefined.

    category

    Subquery

    Returns AsyncUnorderedQueryFlow<this, NonNullable<T>>

  • Creates a subquery where the selected key for each element is neither null nor undefined.

    NOTE: This is an alias for filterDefined.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns AsyncUnorderedQueryFlow<this, T>

xor

xorBy

  • Creates a subquery for the symmetric difference between this AsyncQuery and another AsyncQueryable.

    This is an alias for symmetricDifference.

    category

    Subquery

    Type parameters

    • K

    Parameters

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncUnorderedQueryFlow<this, T>

Methods (Order)

orderBy

  • orderBy<K>(keySelector: function, comparer?: Comparison<K> | Comparer<K>): AsyncOrderedQueryFlow<this, T>
  • Creates an ordered subquery whose elements are sorted in ascending order by the provided key.

    category

    Order

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional comparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns AsyncOrderedQueryFlow<this, T>

orderByDescending

  • orderByDescending<K>(keySelector: function, comparer?: Comparison<K> | Comparer<K>): AsyncOrderedQueryFlow<this, T>
  • Creates an ordered subquery whose elements are sorted in descending order by the provided key.

    category

    Order

    Type parameters

    • K

    Parameters

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional comparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns AsyncOrderedQueryFlow<this, T>

Methods (Join)

fullJoin

  • fullJoin<I, K, R>(inner: AsyncQueryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): AsyncQuery<R>
  • Creates a subquery for the correlated elements of this AsyncQuery and another AsyncQueryable.

    category

    Join

    Type parameters

    • I
    • K
    • R

    Parameters

    • inner: AsyncQueryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in this AsyncQuery.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in the other Queryable.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: T | undefined, inner: I | undefined): R | PromiseLike<R>
        • Parameters

          • outer: T | undefined
          • inner: I | undefined

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<R>

groupJoin

  • groupJoin<I, K, R>(inner: AsyncQueryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): AsyncQuery<R>
  • Creates a grouped subquery for the correlated elements of this AsyncQuery and another AsyncQueryable object.

    category

    Join

    Type parameters

    • I
    • K
    • R

    Parameters

    • inner: AsyncQueryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in this AsyncQuery.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in the other Queryable object.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: T, inner: Query<I>): R | PromiseLike<R>
        • Parameters

          • outer: T
          • inner: Query<I>

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<R>

join

  • join<I, K, R>(inner: AsyncQueryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): AsyncQuery<R>
  • Creates a subquery for the correlated elements of this AsyncQuery and another AsyncQueryable.

    category

    Join

    Type parameters

    • I
    • K
    • R

    Parameters

    • inner: AsyncQueryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in this AsyncQuery.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in the other Queryable.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: T, inner: I): R | PromiseLike<R>
        • Parameters

          • outer: T
          • inner: I

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncQuery<R>

zip

Methods (Hierarchy)

ancestors

  • Creates a subquery for the ancestors of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the ancestors of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

ancestorsAndSelf

  • Creates a subquery for the ancestors of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the ancestors of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

bottomMost

  • Creates a subquery for the bottom-most elements. Elements that are an ancestor of any other element are removed.

    category

    Hierarchy

    Type parameters

    • U: T

    Parameters

    • predicate: function
        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the bottom-most elements. Elements that are an ancestor of any other element are removed.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

    Returns AsyncHierarchyQuery<TNode, T>

children

  • Creates a subquery for the children of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the children of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

descendants

  • Creates a subquery for the descendants of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the descendants of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

descendantsAndSelf

  • Creates a subquery for the descendants of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the descendants of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

nthChild

  • Creates a subquery for the child of each element at the specified offset. A negative offset starts from the last child.

    category

    Hierarchy

    Parameters

    • offset: number

      The offset for the child.

    Returns AsyncHierarchyQuery<TNode>

parents

  • Creates a subquery for the parents of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the parents of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

root

  • Creates a subquery for the roots of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the roots of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

self

  • Creates a subquery for this [[Asyncquery]].

    category

    Hierarchy

    Type parameters

    • U: T

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for this [[Asyncquery]].

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for this [[Asyncquery]].

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

siblings

  • Creates a subquery for the siblings of each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the siblings of each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

siblingsAfterSelf

  • Creates a subquery for the siblings after each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the siblings after each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

siblingsAndSelf

  • Creates a subquery for the siblings of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the siblings of each element as well as each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

siblingsBeforeSelf

  • Creates a subquery for the siblings before each element in the hierarchy.

    category

    Hierarchy

    Type parameters

    • U: TNode

    Parameters

    • predicate: function

      A callback used to filter the results.

        • (element: TNode): boolean
        • Parameters

          • element: TNode

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the siblings before each element in the hierarchy.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

      A callback used to filter the results.

    Returns AsyncHierarchyQuery<TNode>

toHierarchy

topMost

  • Creates a subquery for the top-most elements. Elements that are a descendant of any other element are removed.

    category

    Hierarchy

    Type parameters

    • U: T

    Parameters

    • predicate: function
        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncHierarchyQuery<TNode, U>

  • Creates a subquery for the top-most elements. Elements that are a descendant of any other element are removed.

    category

    Hierarchy

    Parameters

    • Optional predicate: undefined | function

    Returns AsyncHierarchyQuery<TNode, T>

Methods ()

[Hierarchical.hierarchy]

[Symbol.asyncIterator]

Generated using TypeDoc