@esfx/async-iter-fn Package
An iteration and query API for ECMAScript async iterables.
Installation
npm i @esfx/async-iter-fn
Usage
import { mapAsync, filterAsync } from "@esfx/async-iter-fn";
// nested
const computerIsbns = mapAsync(filterAsync(books, book =>
book.categories.includes("computers")), book => book.isbn);
// or, pipe-like
let _;
const computerIsbns = (
_= books,
_= filterAsync(_, book => book.categories.includes("computers")),
_= mapAsync(_, book => book.isbn),
_);
// or, with actual pipes (if you are using a transpiler with support for Hack-style)
const computerIsbns = books
|> filterAsync(%, book => book.categories.includes("computers"))
|> mapAsync(%, book => book.isbn);
Interfaces
ConsumeAsyncOptions
Functions
ancestorsAndSelfAsync(source, predicate)
Selects the ancestors of each node in the iterable, along with the node itself. This is equivalent to the ancestor-or-self::*
selector in XPath.
Hierarchy
Declaration
export declare function ancestorsAndSelfAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
ancestorsAndSelfAsync(source, predicate)
Declaration
export declare function ancestorsAndSelfAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
ancestorsAsync(source, predicate)
Selects the ancestors of each node in the iterable. This is equivalent to the ancestor::*
selector in XPath.
Hierarchy
Declaration
export declare function ancestorsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
ancestorsAsync(source, predicate)
Declaration
export declare function ancestorsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
appendAsync(source, value)
Creates an AsyncIterable
for the elements of source
with the provided value
appended to the
end.
Declaration
export declare function appendAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, value: PromiseLike<T> | T): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
The AsyncIterable
or Iterable
object to append to.
Returns
appendAsync(source, value)
Creates an AsyncIterable
for the elements of source
with the provided value
appended to the
end.
Declaration
export declare function appendAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, value: PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
- source
- AsyncIterable<T> | Iterable<PromiseLike<T> | T>
The AsyncIterable
or Iterable
object to append to.
Returns
averageAsync(source)
Computes the average for a series of numbers.
NOTE: If any element is not a number
, this overload will throw.
Declaration
export declare function averageAsync(source: AsyncIterable<number> | Iterable<PromiseLike<number> | number>): Promise<number>;
Parameters
- source
- AsyncIterable<number> | Iterable<PromiseLike<number> | number>
An AsyncIterable
or Iterable
object.
Scalar
Returns
averageAsync(source, elementSelector)
Computes the average for a series of numbers.
Declaration
export declare function averageAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, elementSelector: (element: T) => PromiseLike<number> | number): Promise<number>;
Type Parameters
- T
Parameters
- elementSelector
- (element: T) => PromiseLike<number> | number
A callback used to convert a value in source
to a number.
Scalar
Returns
bottomMostAsync(source, predicate, equaler)
Creates an AsyncHierarchyIterable
for the bottom-most elements. Elements of source
that are an ancestor of any other
element of source
are removed.
Declaration
export declare function bottomMostAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => element is U, equaler?: Equaler<TNode>): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: T) => element is U
An optional callback used to filter the results.
Returns
bottomMostAsync(source, predicate, equaler)
Creates an AsyncHierarchyIterable
for the bottom-most elements. Elements of source
that are an ancestor of any other
element of source
are removed.
Declaration
export declare function bottomMostAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate?: (element: T) => PromiseLike<boolean> | boolean, equaler?: Equaler<TNode>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to filter the results.
Returns
childrenAsync(source, predicate)
Selects the children of each node in the iterable. This is equivalent to the child::*
selector in XPath, or the >
combinator in CSS.
Hierarchy
Declaration
export declare function childrenAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
childrenAsync(source, predicate)
Declaration
export declare function childrenAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
concatAsync(left, right)
Creates an AsyncIterable
that concatenates a AsyncIterable
or Iterable
object with an AsyncIterable
or Iterable
object.
Declaration
export declare function concatAsync<TNode, T extends TNode>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
concatAsync(left, right)
Creates an AsyncIterable
that concatenates an AsyncIterable
or Iterable
object with
a AsyncIterable
or Iterable
object.
Declaration
export declare function concatAsync<TNode, T extends TNode>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Subquery
Returns
concatAsync(left, right)
Creates an AsyncIterable
that concatenates two AsyncIterable
or Iterable
objects.
Declaration
export declare function concatAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
consumeAsync(iterator, options)
Creates an [[AsyncIterable]] that, when iterated, consumes the provided [[AsyncIterator]].
Declaration
export declare function consumeAsync<T>(iterator: AsyncIterator<T>, options?: ConsumeAsyncOptions): AsyncIterable<T>;
Type Parameters
- T
Parameters
- options
- ConsumeAsyncOptions
Returns
continuousAsync(value)
Creates an [[AsyncIterable]] that repeats the provided value forever.
Declaration
export declare function continuousAsync<T>(value: PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
copyToAsync(source, collection, start, count)
Writes each element of a source iterable to a destination array.
Declaration
export declare function copyToAsync<T, U extends IndexedCollection<T> | T[]>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, collection: U, start?: number, count?: number): Promise<U>;
Type Parameters
- T
- U
Parameters
- collection
- U
The destination array or IndexedCollection
.
Returns
correspondsAsync(left, right, equaler)
Computes a scalar value indicating whether every element in left
corresponds to a matching element
in right
at the same position.
Declaration
export declare function correspondsAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>;
Type Parameters
- T
Parameters
- equaler
- EqualityComparison<T> | Equaler<T>
An optional callback used to compare the equality of two elements. Scalar
Returns
correspondsAsync(left, right, equaler)
Computes a scalar value indicating whether every element in left
corresponds to a matching element
in right
at the same position.
Declaration
export declare function correspondsAsync<T, U>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, equaler: (left: T, right: U) => boolean): Promise<boolean>;
Type Parameters
- T
- U
Parameters
- equaler
- (left: T, right: U) => boolean
An optional callback used to compare the equality of two elements. Scalar
Returns
correspondsByAsync(left, right, keySelector)
Computes a scalar value indicating whether the key for every element in left
corresponds to a matching key
in right
at the same position.
Declaration
export declare function correspondsByAsync<T, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K): Promise<boolean>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element. Scalar
Returns
correspondsByAsync(left, right, leftKeySelector, rightKeySelector, keyEqualer)
Computes a scalar value indicating whether the key for every element in left
corresponds to a matching key
in right
at the same position.
Declaration
export declare function correspondsByAsync<T, U, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, leftKeySelector: (element: T) => K, rightKeySelector: (element: U) => K, keyEqualer?: EqualityComparison<K> | Equaler<K>): Promise<boolean>;
Type Parameters
- T
- U
- K
Parameters
- leftKeySelector
- (element: T) => K
A callback used to select the key for each element in left
.
- rightKeySelector
- (element: U) => K
A callback used to select the key for each element in right
.
- keyEqualer
- EqualityComparison<K> | Equaler<K>
An optional callback used to compare the equality of two keys. Scalar
Returns
countAsync(source, predicate)
Counts the number of elements, optionally filtering elements using the supplied callback.
Declaration
export declare function countAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): Promise<number>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to match each element. Scalar
Returns
defaultIfEmptyAsync(source, defaultValue)
Creates an AsyncIterable
that contains the provided default value if source
contains no elements.
Declaration
export declare function defaultIfEmptyAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, defaultValue: PromiseLike<T> | T): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
defaultIfEmptyAsync(source, defaultValue)
Creates an AsyncIterable
that contains the provided default value if source
contains no elements.
Declaration
export declare function defaultIfEmptyAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, defaultValue: PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
descendantsAndSelfAsync(source, predicate)
Selects the descendents of each node in the iterable, along with the node itself. This is equivalent to the descendant-or-self::*
selector in XPath.
Hierarchy
Declaration
export declare function descendantsAndSelfAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
descendantsAndSelfAsync(source, predicate)
Declaration
export declare function descendantsAndSelfAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
descendantsAsync(source, predicate)
Selects the descendents of each node in the iterable. This is equivalent to the descendant::*
selector in XPath, or the
(space) combinator in CSS.
Hierarchy
Declaration
export declare function descendantsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
descendantsAsync(source, predicate)
Declaration
export declare function descendantsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
distinctAsync(source, equaler)
Creates an AsyncIterable
for the distinct elements of source
.
Declaration
export declare function distinctAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
distinctAsync(source, equaler)
Creates an AsyncIterable
for the distinct elements of source.
Declaration
export declare function distinctAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
distinctByAsync(source, keySelector, keyEqualer)
Creates an AsyncIterable
for the distinct elements of source
.
Declaration
export declare function distinctByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (value: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (value: T) => K
A callback used to select the key to determine uniqueness.
Returns
distinctByAsync(source, keySelector, keyEqualer)
Creates an AsyncIterable
for the distinct elements of source
.
Declaration
export declare function distinctByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (value: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (value: T) => K
A callback used to select the key to determine uniqueness.
Returns
dropAsync(source, count)
Creates an AsyncIterable
containing all elements except the first elements up to the supplied
count.
Declaration
export declare function dropAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, count: number): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
dropAsync(source, count)
Creates an AsyncIterable
containing all elements except the first elements up to the supplied
count.
Declaration
export declare function dropAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, count: number): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
dropRightAsync(source, count)
Creates an AsyncIterable
containing all elements except the first elements up to the supplied
count.
Declaration
export declare function dropRightAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, count: number): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
dropRightAsync(source, count)
Creates an AsyncIterable
containing all elements except the first elements up to the supplied
count.
Declaration
export declare function dropRightAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, count: number): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
dropUntilAsync(source, predicate)
Creates an AsyncIterable
containing all elements except the first elements that do not match
the supplied predicate.
Declaration
export declare function dropUntilAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
dropUntilAsync(source, predicate)
Creates an AsyncIterable
containing all elements except the first elements that do not match
the supplied predicate.
Declaration
export declare function dropUntilAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
dropWhileAsync(source, predicate)
Creates an AsyncIterable
containing all elements except the first elements that match
the supplied predicate.
Declaration
export declare function dropWhileAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
dropWhileAsync(source, predicate)
Creates an AsyncIterable
containing all elements except the first elements that match
the supplied predicate.
Declaration
export declare function dropWhileAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
elementAtAsync(source, offset)
Finds the value at the provided offset. A negative offset starts from the last element.
Declaration
export declare function elementAtAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, offset: number | Index): Promise<T | undefined>;
Type Parameters
- T
Parameters
Returns
emptyAsync()
Creates an AsyncIterable
with no elements.
Query
Declaration
export declare function emptyAsync<T>(): AsyncIterable<T>;
Type Parameters
- T
Returns
endsWithAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of left
end
with the same sequence of elements in right
.
Declaration
export declare function endsWithAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>;
Type Parameters
- T
Parameters
- equaler
- EqualityComparison<T> | Equaler<T>
An optional callback used to compare the equality of two elements. Scalar
Returns
endsWithAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of left
end
with the same sequence of elements in right
.
Declaration
export declare function endsWithAsync<T, U>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, equaler: (left: T, right: U) => boolean): Promise<boolean>;
Type Parameters
- T
- U
Parameters
- equaler
- (left: T, right: U) => boolean
An optional callback used to compare the equality of two elements. Scalar
Returns
everyAsync(source, predicate)
Computes a scalar value indicating whether all elements match the supplied callback.
Declaration
export declare function everyAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => PromiseLike<boolean> | boolean): Promise<boolean>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Scalar
Returns
exceptAsync(left, right, equaler)
Creates an AsyncIterable
for the set difference between two AsyncIterable
or Iterable
objects.
Declaration
export declare function exceptAsync<TNode, T extends TNode>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
exceptAsync(left, right, equaler)
Creates an AsyncIterable
for the set difference between two AsyncIterable
or Iterable
objects.
Declaration
export declare function exceptAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
exceptByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set difference between two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function exceptByAsync<TNode, T extends TNode, K>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
exceptByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set difference between two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function exceptByAsync<T, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
excludeAsync(source, values)
Creates an AsyncIterable
with every instance of the specified value removed.
Declaration
export declare function excludeAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, ...values: [PromiseLike<T> | T, ...(PromiseLike<T> | T)[]]): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
excludeAsync(source, values)
Creates an AsyncIterable
with every instance of the specified value removed.
Declaration
export declare function excludeAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, ...values: [PromiseLike<T> | T, ...(PromiseLike<T> | T)[]]): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
filterAsync(source, predicate)
Creates an AsyncIterable
whose elements match the supplied predicate.
Declaration
export declare function filterAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => element is U
A callback used to match each element. Subquery
Returns
filterAsync(source, predicate)
Creates an AsyncIterable
whose elements match the supplied predicate.
Declaration
export declare function filterAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
filterAsync(source, predicate)
Creates an AsyncIterable
whose elements match the supplied predicate.
Declaration
export declare function filterAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => element is U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T, offset: number) => element is U
A callback used to match each element. Subquery
Returns
filterAsync(source, predicate)
Creates an AsyncIterable
whose elements match the supplied predicate.
Declaration
export declare function filterAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
filterByAsync(source, keySelector, predicate)
Creates an AsyncIterable
where the selected key for each element matches the supplied predicate.
Declaration
export declare function filterByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, predicate: (key: K, offset: number) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
- predicate
- (key: K, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each key. Subquery
Returns
filterByAsync(source, keySelector, predicate)
Creates an AsyncIterable
where the selected key for each element matches the supplied predicate.
Declaration
export declare function filterByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, predicate: (key: K, offset: number) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
- predicate
- (key: K, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each key. Subquery
Returns
filterDefinedAsync(source)
Creates an AsyncIterable
whose elements are neither null
nor undefined
.
Declaration
export declare function filterDefinedAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>): AsyncHierarchyIterable<TNode, NonNullable<T>>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Subquery
Returns
filterDefinedAsync(source)
Creates an AsyncIterable
whose elements are neither null
nor undefined
.
Declaration
export declare function filterDefinedAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<NonNullable<T>>;
Type Parameters
- T
Parameters
- source
- AsyncIterable<T> | Iterable<PromiseLike<T> | T>
An AsyncIterable
or Iterable
object.
Subquery
Returns
filterDefinedByAsync(source, keySelector)
Creates an AsyncIterable
where the selected key for each element is neither null
nor undefined
.
Declaration
export declare function filterDefinedByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (value: T) => K): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (value: T) => K
A callback used to select the key for each element. Subquery
Returns
filterDefinedByAsync(source, keySelector)
Creates an AsyncIterable
where the selected key for each element is neither null
nor undefined
.
Declaration
export declare function filterDefinedByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (value: T) => K): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (value: T) => K
A callback used to select the key for each element. Subquery
Returns
filterNotAsync(source, predicate)
Creates an AsyncIterable
whose elements do not match the supplied predicate.
Declaration
export declare function filterNotAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => element is U
A callback used to match each element. Subquery
Returns
filterNotAsync(source, predicate)
Creates an AsyncIterable
whose elements do not match the supplied predicate.
Declaration
export declare function filterNotAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
filterNotAsync(source, predicate)
Creates an AsyncIterable
whose elements do not match the supplied predicate.
Declaration
export declare function filterNotAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => element is U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T, offset: number) => element is U
A callback used to match each element. Subquery
Returns
filterNotAsync(source, predicate)
Creates an AsyncIterable
whose elements do not match the supplied predicate.
Declaration
export declare function filterNotAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
filterNotByAsync(source, keySelector, predicate)
Creates an AsyncIterable
where the selected key for each element does not match the supplied predicate.
Declaration
export declare function filterNotByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, predicate: (key: K, offset: number) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
- predicate
- (key: K, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each key. Subquery
Returns
filterNotByAsync(source, keySelector, predicate)
Creates an AsyncIterable
where the selected key for each element does not match the supplied predicate.
Declaration
export declare function filterNotByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, predicate: (key: K, offset: number) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
- predicate
- (key: K, offset: number) => PromiseLike<boolean> | boolean
A callback used to match each key. Subquery
Returns
filterNotDefinedByAsync(source, keySelector)
Creates an AsyncIterable
where the selected key for each element is either null
or undefined
.
Declaration
export declare function filterNotDefinedByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (value: T) => K): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (value: T) => K
A callback used to select the key for each element. Subquery
Returns
filterNotDefinedByAsync(source, keySelector)
Creates an AsyncIterable
where the selected key for each element is either null
or undefined
.
Declaration
export declare function filterNotDefinedByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (value: T) => K): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (value: T) => K
A callback used to select the key for each element. Subquery
Returns
firstAsync(source, predicate)
Gets the first element, optionally filtering elements using the supplied callback.
Declaration
export declare function firstAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => element is U): Promise<U | undefined>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T) => element is U
An optional callback used to match each element. Scalar
Returns
firstAsync(source, predicate)
Gets the first element, optionally filtering elements using the supplied callback.
Declaration
export declare function firstAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): Promise<T | undefined>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to match each element. Scalar
Returns
firstChildAsync(source, predicate)
Selects the first child of each node in the iterable. This is equivalent to the child::*[first()]
selector in XPath, or the :first-child
pseudo class in CSS.
Hierarchy
Declaration
export declare function firstChildAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
firstChildAsync(source, predicate)
Declaration
export declare function firstChildAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
flatMapAsync(source, projection)
Creates an AsyncIterable
that iterates the results of applying a callback to each element of source
.
Declaration
export declare function flatMapAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, projection: (element: T) => AsyncIterable<U> | Iterable<PromiseLike<U> | U>): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- projection
- (element: T) => AsyncIterable<U> | Iterable<PromiseLike<U> | U>
A callback used to map each element into an iterable. Subquery
Returns
flatMapAsync(source, projection, resultSelector)
Creates an AsyncIterable
that iterates the results of applying a callback to each element of source
.
Declaration
export declare function flatMapAsync<T, U, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, projection: (element: T) => AsyncIterable<U> | Iterable<PromiseLike<U> | U>, resultSelector: (element: T, innerElement: U) => PromiseLike<R> | R): AsyncIterable<R>;
Type Parameters
- T
- U
- R
Parameters
- projection
- (element: T) => AsyncIterable<U> | Iterable<PromiseLike<U> | U>
A callback used to map each element into an iterable. Subquery
- resultSelector
- (element: T, innerElement: U) => PromiseLike<R> | R
Returns
followingAsync(source, predicate)
Selects the nodes that follow each node in the iterable. This is equivalent to the following-sibling::*
selector in XPath or the ~
combinator in CSS.
Hierarchy
Declaration
export declare function followingAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
followingAsync(source, predicate)
Declaration
export declare function followingAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
followingSiblingsAsync(source, predicate)
Selects the siblings that follow each node in the iterable. This is equivalent to the following-sibling::*
selector in XPath or the ~
combinator in CSS.
Hierarchy
Declaration
export declare function followingSiblingsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
followingSiblingsAsync(source, predicate)
Declaration
export declare function followingSiblingsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
forEachAsync(source, callback)
Invokes a callback for each element of source
.
Declaration
export declare function forEachAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, callback: (element: T, offset: number) => void | PromiseLike<void>): Promise<void>;
Type Parameters
- T
Parameters
Returns
fullJoinAsync(outer, inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
Creates an [[AsyncIterable]] for the correlated elements between an outer [[AsyncQueryable]] object and an inner [[AsyncQueryable]] object.
Declaration
export declare function fullJoinAsync<O, I, K, R>(outer: AsyncIterable<O> | Iterable<PromiseLike<O> | O>, inner: AsyncIterable<I> | Iterable<PromiseLike<I> | I>, outerKeySelector: (element: O) => K, innerKeySelector: (element: I) => K, resultSelector: (outer: O | undefined, inner: I | undefined) => PromiseLike<R> | R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- O
- I
- K
- R
Parameters
- outerKeySelector
- (element: O) => K
A callback used to select the key for an element in outer
.
- innerKeySelector
- (element: I) => K
A callback used to select the key for an element in inner
.
- resultSelector
- (outer: O | undefined, inner: I | undefined) => PromiseLike<R> | R
A callback used to select the result for the correlated elements.
Returns
generateAsync(count, generator)
Creates an [[AsyncIterable]] whose values are provided by a callback executed a provided number of times.
Declaration
export declare function generateAsync<T>(count: number, generator: (offset: number) => PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
groupByAsync(source, keySelector, keyEqualer)
Groups each element of an AsyncIterable
by its key.
Declaration
export declare function groupByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<HierarchyGrouping<K, TNode, T>>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
groupByAsync(source, keySelector, elementSelector, resultSelector, keyEqualer)
Groups each element of an AsyncIterable
by its key.
Declaration
export declare function groupByAsync<TNode, T extends TNode, K, R>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, elementSelector: undefined, resultSelector: (key: K, elements: HierarchyIterable<TNode, T>) => R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- TNode
- T
- K
- R
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- resultSelector
- (key: K, elements: HierarchyIterable<TNode, T>) => R
A callback used to select a result from a group.
Returns
groupByAsync(source, keySelector, keyEqualer)
Groups each element of an AsyncIterable
by its key.
Declaration
export declare function groupByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<Grouping<K, T>>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
groupByAsync(source, keySelector, elementSelector, keyEqualer)
Groups each element of an AsyncIterable
by its key.
Declaration
export declare function groupByAsync<T, K, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, keyEqualer?: Equaler<K>): AsyncIterable<Grouping<K, V>>;
Type Parameters
- T
- K
- V
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback used to select a value for an element.
Returns
groupByAsync(source, keySelector, elementSelector, resultSelector, keyEqualer)
Groups each element of an AsyncIterable
by its key.
Declaration
export declare function groupByAsync<T, K, V, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, resultSelector: (key: K, elements: Iterable<V>) => PromiseLike<R> | R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- T
- K
- V
- R
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback used to select a value for an element.
- resultSelector
- (key: K, elements: Iterable<V>) => PromiseLike<R> | R
A callback used to select a result from a group.
Returns
groupJoinAsync(outer, inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
Creates a grouped [[AsyncIterable]] for the correlated elements between an outer [[AsyncQueryable]] object and an inner [[AsyncQueryable]] object.
Declaration
export declare function groupJoinAsync<O, I, K, R>(outer: AsyncIterable<O> | Iterable<PromiseLike<O> | O>, inner: AsyncIterable<I> | Iterable<PromiseLike<I> | I>, outerKeySelector: (element: O) => K, innerKeySelector: (element: I) => K, resultSelector: (outer: O, inner: Iterable<I>) => PromiseLike<R> | R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- O
- I
- K
- R
Parameters
- outerKeySelector
- (element: O) => K
A callback used to select the key for an element in outer
.
- innerKeySelector
- (element: I) => K
A callback used to select the key for an element in inner
.
- resultSelector
- (outer: O, inner: Iterable<I>) => PromiseLike<R> | R
A callback used to select the result for the correlated elements.
Returns
includesAsync(source, value, equaler)
Computes a scalar value indicating whether the provided value is included in an AsyncIterable
.
Declaration
export declare function includesAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, value: T, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>;
Type Parameters
- T
Parameters
- value
- T
A value.
- equaler
- EqualityComparison<T> | Equaler<T>
An optional callback used to compare the equality of two elements. Scalar
Returns
includesAsync(source, value, equaler)
Computes a scalar value indicating whether the provided value is included in an AsyncIterable
.
Declaration
export declare function includesAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, value: U, equaler: (left: T, right: U) => boolean): Promise<boolean>;
Type Parameters
- T
- U
Parameters
- value
- U
A value.
- equaler
- (left: T, right: U) => boolean
An optional callback used to compare the equality of two elements. Scalar
Returns
includesSequenceAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of left
include
an exact sequence of elements from right
.
Declaration
export declare function includesSequenceAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>;
Type Parameters
- T
Parameters
- equaler
- EqualityComparison<T> | Equaler<T>
A callback used to compare the equality of two elements. Scalar
Returns
includesSequenceAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of left
include
an exact sequence of elements from right
.
Declaration
export declare function includesSequenceAsync<T, U>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, equaler: (left: T, right: U) => boolean): Promise<boolean>;
Type Parameters
- T
- U
Parameters
- equaler
- (left: T, right: U) => boolean
A callback used to compare the equality of two elements. Scalar
Returns
intersectAsync(left, right, equaler)
Creates an AsyncIterable
for the set intersection of a AsyncIterable
or Iterable
object and another AsyncIterable
or Iterable
object.
Declaration
export declare function intersectAsync<TNode, T extends TNode>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
intersectAsync(left, right, equaler)
Creates an AsyncIterable
for the set intersection of two AsyncIterable
or Iterable
objects.
Declaration
export declare function intersectAsync<TNode, T extends TNode>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Returns
intersectAsync(left, right, equaler)
Creates an AsyncIterable
for the set intersection of two AsyncIterable
or Iterable
objects.
Declaration
export declare function intersectAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
intersectByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set intersection of a AsyncIterable
or Iterable
object and another AsyncIterable
or Iterable
object, where set identity is determined by the selected key.
Declaration
export declare function intersectByAsync<TNode, T extends TNode, K>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
intersectByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set intersection of two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function intersectByAsync<TNode, T extends TNode, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
intersectByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set intersection of two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function intersectByAsync<T, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
intoAsync(source, callback)
Pass the entire source to the provided callback, returning the result.
Declaration
export declare function intoAsync<T, S extends AsyncIterable<T> | Iterable<PromiseLike<T> | T>, R>(source: S, callback: (source: S) => R): R;
Type Parameters
- T
- S
- R
Parameters
- source
- S
An AsyncIterable
or Iterable
object.
- callback
- (source: S) => R
A callback function.
SubAsyncIterable
Returns
joinAsync(outer, inner, outerKeySelector, innerKeySelector, resultSelector, keyEqualer)
Creates an [[AsyncIterable]] for the correlated elements of two [[AsyncQueryable]] objects.
Declaration
export declare function joinAsync<O, I, K, R>(outer: AsyncIterable<O> | Iterable<PromiseLike<O> | O>, inner: AsyncIterable<I> | Iterable<PromiseLike<I> | I>, outerKeySelector: (element: O) => K, innerKeySelector: (element: I) => K, resultSelector: (outer: O, inner: I) => PromiseLike<R> | R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- O
- I
- K
- R
Parameters
- outerKeySelector
- (element: O) => K
A callback used to select the key for an element in outer
.
- innerKeySelector
- (element: I) => K
A callback used to select the key for an element in inner
.
- resultSelector
- (outer: O, inner: I) => PromiseLike<R> | R
A callback used to select the result for the correlated elements.
Returns
lastAsync(source, predicate)
Gets the last element of an AsyncIterable
or Iterable
, optionally filtering elements using the supplied
callback.
Declaration
export declare function lastAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => element is U): Promise<U | undefined>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T) => element is U
An optional callback used to match each element. Scalar
Returns
lastAsync(source, predicate)
Gets the last element of an AsyncIterable
or Iterable
, optionally filtering elements using the supplied
callback.
Declaration
export declare function lastAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): Promise<T | undefined>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to match each element. Scalar
Returns
lastChildAsync(source, predicate)
Selects the last child of each node in the iterable. This is equivalent to the child::*[last()]
selector in XPath, or the :last-child
pseudo class in CSS.
Hierarchy
Declaration
export declare function lastChildAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
lastChildAsync(source, predicate)
Declaration
export declare function lastChildAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
mapAsync(source, selector)
Creates an AsyncIterable
by applying a callback to each element of an AsyncIterable
or Iterable
object.
Declaration
export declare function mapAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, selector: (element: T, offset: number) => PromiseLike<U> | U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- selector
- (element: T, offset: number) => PromiseLike<U> | U
A callback used to map each element. Subquery
Returns
materializeAsync(source)
Eagerly evaluate an AsyncIterable
or Iterable
object, returning an AsyncIterable
for the
resolved elements of the original sequence.
Declaration
export declare function materializeAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object.
Scalar
Returns
materializeAsync(source)
Eagerly evaluate an AsyncIterable
or Iterable
object, returning an AsyncIterable
for the
resolved elements of the original sequence.
Declaration
export declare function materializeAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
maxAsync(source, comparer)
Gets the maximum element of an AsyncIterable
, optionally comparing elements using the supplied callback.
Declaration
export declare function maxAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, comparer?: Comparison<T> | Comparer<T>): Promise<T | undefined>;
Type Parameters
- T
Parameters
Returns
maxByAsync(source, keySelector, keyComparer)
Gets the maximum element of an AsyncIterable
, optionally comparing the keys of each element using the supplied callback.
Declaration
export declare function maxByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (value: T) => K, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>;
Type Parameters
- T
- K
Parameters
- keySelector
- (value: T) => K
A callback used to choose the key to compare.
Returns
minAsync(source, comparer)
Gets the minimum element of an AsyncIterable
, optionally comparing elements using the supplied callback.
Declaration
export declare function minAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, comparer?: Comparison<T> | Comparer<T>): Promise<T | undefined>;
Type Parameters
- T
Parameters
Returns
minByAsync(source, keySelector, keyComparer)
Gets the minimum element of an AsyncIterable
, optionally comparing the keys of each element using the supplied callback.
Declaration
export declare function minByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (value: T) => K, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>;
Type Parameters
- T
- K
Parameters
- keySelector
- (value: T) => K
A callback used to choose the key to compare.
Returns
nthChildAsync(source, offset, predicate)
Creates an AsyncHierarchyIterable
for the child of each element at the specified offset. A negative offset
starts from the last child.
Declaration
export declare function nthChildAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode, U> | HierarchyIterable<TNode, U>, offset: number | Index, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, U> | HierarchyIterable<TNode, U>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: TNode) => element is U
An optional callback used to filter the results. Hierarchy
Returns
nthChildAsync(source, offset, predicate)
Creates an AsyncHierarchyIterable
for the child of each element at the specified offset. A negative offset
starts from the last child.
Declaration
export declare function nthChildAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, offset: number | Index, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
An optional callback used to filter the results. Hierarchy
Returns
onceAsync(value)
Creates an [[AsyncIterable]] over a single element.
Declaration
export declare function onceAsync<T>(value: PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
orderByAsync(source, keySelector, keyComparer)
Creates an AsyncOrderedIterable
whose elements are sorted in ascending order by the provided key.
Declaration
export declare function orderByAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
orderByAsync(source, keySelector, keyComparer)
Creates an AsyncOrderedIterable
whose elements are sorted in ascending order by the provided key.
Declaration
export declare function orderByAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
orderByDescendingAsync(source, keySelector, keyComparer)
Creates an AsyncOrderedIterable
whose elements are sorted in descending order by the provided key.
Declaration
export declare function orderByDescendingAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
orderByDescendingAsync(source, keySelector, keyComparer)
Creates an AsyncOrderedIterable
whose elements are sorted in descending order by the provided key.
Declaration
export declare function orderByDescendingAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
pageByAsync(source, pageSize)
Creates an AsyncIterable
that splits an AsyncIterable
into one or more pages.
While advancing from page to page is evaluated lazily, the elements of the page are
evaluated eagerly.
Declaration
export declare function pageByAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, pageSize: number): AsyncIterable<HierarchyPage<TNode, T>>;
Type Parameters
- TNode
- T
Parameters
Returns
pageByAsync(source, pageSize, pageSelector)
Creates an AsyncIterable
that splits an AsyncIterable
into one or more pages.
While advancing from page to page is evaluated lazily, the elements of the page are
evaluated eagerly.
Declaration
export declare function pageByAsync<TNode, T extends TNode, R>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, pageSize: number, pageSelector: (page: number, offset: number, values: HierarchyIterable<TNode, T>) => R): AsyncIterable<R>;
Type Parameters
- TNode
- T
- R
Parameters
- pageSelector
- (page: number, offset: number, values: HierarchyIterable<TNode, T>) => R
A callback used to create a result for a page. Subquery
Returns
pageByAsync(source, pageSize)
Creates an AsyncIterable
that splits an AsyncIterable
into one or more pages.
While advancing from page to page is evaluated lazily, the elements of the page are
evaluated eagerly.
Declaration
export declare function pageByAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, pageSize: number): AsyncIterable<Page<T>>;
Type Parameters
- T
Parameters
Returns
pageByAsync(source, pageSize, pageSelector)
Creates an AsyncIterable
that splits an AsyncIterable
into one or more pages.
While advancing from page to page is evaluated lazily, the elements of the page are
evaluated eagerly.
Declaration
export declare function pageByAsync<T, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, pageSize: number, pageSelector: (page: number, offset: number, values: Iterable<T>) => R): AsyncIterable<R>;
Type Parameters
- T
- R
Parameters
- pageSelector
- (page: number, offset: number, values: Iterable<T>) => R
A callback used to create a result for a page. Subquery
Returns
parentsAsync(source, predicate)
Selects the parent of each node in the iterable. This is equivalent to the parent::*
or ..
selectors in XPath.
Hierarchy
Declaration
export declare function parentsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
parentsAsync(source, predicate)
Declaration
export declare function parentsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
patchAsync(source, start, skipCount, range)
Creates an AsyncIterable
for the elements of the source with the provided range
patched into the results.
Declaration
export declare function patchAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, start: number, skipCount?: number, range?: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
A AsyncIterable
or Iterable
object to patch.
Returns
patchAsync(source, start, skipCount, range)
Creates an AsyncIterable
for the elements of the source with the provided range
patched into the results.
Declaration
export declare function patchAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, start: number, skipCount?: number, range?: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
- source
- AsyncIterable<T> | Iterable<PromiseLike<T> | T>
An AsyncIterable
or Iterable
object to patch.
Returns
precedingAsync(source, predicate)
Selects the nodes that precede each node in the iterable. This is equivalent to the preceding::**
selector in XPath.
Hierarchy
Declaration
export declare function precedingAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
precedingAsync(source, predicate)
Declaration
export declare function precedingAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
precedingSiblingsAsync(source, predicate)
Selects the siblings that precede each node in the iterable. This is equivalent to the preceding-sibling::**
selector in XPath.
Hierarchy
Declaration
export declare function precedingSiblingsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
precedingSiblingsAsync(source, predicate)
Declaration
export declare function precedingSiblingsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
prependAsync(source, value)
Creates an AsyncIterable
for the elements of source
with the provided value
prepended to the
beginning.
Declaration
export declare function prependAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, value: T): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object value.
- value
- T
The value to prepend. Subquery
Returns
prependAsync(source, value)
Creates an AsyncIterable
for the elements of source
with the provided value
prepended to the
beginning.
Declaration
export declare function prependAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, value: PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
reduceAsync(source, accumulator)
Computes a scalar value by applying an accumulator callback over each element.
Declaration
export declare function reduceAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: T, element: T, offset: number) => PromiseLike<T> | T): Promise<T>;
Type Parameters
- T
Parameters
- accumulator
- (current: T, element: T, offset: number) => PromiseLike<T> | T
the callback used to compute the result. Scalar
Returns
reduceAsync(source, accumulator, seed)
Computes a scalar value by applying an accumulator callback over each element.
Declaration
export declare function reduceAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U): Promise<U>;
Type Parameters
- T
- U
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
the callback used to compute the result. Scalar
- seed
- U
An optional seed value.
Returns
reduceAsync(source, accumulator, seed, resultSelector)
Computes a scalar value by applying an accumulator callback over each element.
Declaration
export declare function reduceAsync<T, U, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U, resultSelector: (result: U, count: number) => R | PromiseLike<R>): Promise<R>;
Type Parameters
- T
- U
- R
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
the callback used to compute the result.
- seed
- U
An optional seed value.
- resultSelector
- (result: U, count: number) => R | PromiseLike<R>
An optional callback used to compute the final result. Scalar
Returns
reduceRightAsync(source, accumulator)
Computes a scalar value by applying an accumulator callback over each element in reverse.
Declaration
export declare function reduceRightAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: T, element: T, offset: number) => PromiseLike<T> | T): Promise<T>;
Type Parameters
- T
Parameters
- accumulator
- (current: T, element: T, offset: number) => PromiseLike<T> | T
the callback used to compute the result. Scalar
Returns
reduceRightAsync(source, accumulator, seed)
Computes a scalar value by applying an accumulator callback over each element in reverse.
Declaration
export declare function reduceRightAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U): Promise<U>;
Type Parameters
- T
- U
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
the callback used to compute the result.
- seed
- U
An optional seed value. Scalar
Returns
reduceRightAsync(source, accumulator, seed, resultSelector)
Computes a scalar value by applying an accumulator callback over each element in reverse.
Declaration
export declare function reduceRightAsync<T, U, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U, resultSelector: (result: U, count: number) => R | PromiseLike<R>): Promise<R>;
Type Parameters
- T
- U
- R
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
the callback used to compute the result.
- seed
- U
An optional seed value.
- resultSelector
- (result: U, count: number) => R | PromiseLike<R>
An optional callback used to compute the final result. Scalar
Returns
repeatAsync(value, count)
Creates an Iterable for a value repeated a provided number of times.
Declaration
export declare function repeatAsync<T>(value: PromiseLike<T> | T, count: number): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
reverseAsync(source)
Creates an AsyncIterable
whose elements are in the reverse order.
Subquery
Declaration
export declare function reverseAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
Returns
reverseAsync(source)
Creates an AsyncIterable
whose elements are in the reverse order.
Subquery
Declaration
export declare function reverseAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
- source
- AsyncIterable<T> | Iterable<PromiseLike<T> | T>
Returns
rootAsync(source, predicate)
Selects the root element of each node in the iterable. This is equivalent to the /
selector in XPath, or the :root
selector in CSS.
Hierarchy
Declaration
export declare function rootAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
rootAsync(source, predicate)
Declaration
export declare function rootAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
scanAsync(source, accumulator)
Creates an AsyncIterable
containing the cumulative results of applying the provided callback to each element.
Declaration
export declare function scanAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: T, element: T, offset: number) => PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
- accumulator
- (current: T, element: T, offset: number) => PromiseLike<T> | T
The callback used to compute each result. Subquery
Returns
scanAsync(source, accumulator, seed)
Creates an AsyncIterable
containing the cumulative results of applying the provided callback to each element.
Declaration
export declare function scanAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
The callback used to compute each result.
- seed
- U
An optional seed value. Subquery
Returns
scanRightAsync(source, accumulator)
Creates an AsyncIterable
containing the cumulative results of applying the provided callback to each element in reverse.
Declaration
export declare function scanRightAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: T, element: T, offset: number) => PromiseLike<T> | T): AsyncIterable<T>;
Type Parameters
- T
Parameters
- accumulator
- (current: T, element: T, offset: number) => PromiseLike<T> | T
The callback used to compute each result. Subquery
Returns
scanRightAsync(source, accumulator, seed)
Creates an AsyncIterable
containing the cumulative results of applying the provided callback to each element in reverse.
Declaration
export declare function scanRightAsync<T, U>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, accumulator: (current: U, element: T, offset: number) => PromiseLike<U> | U, seed: U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- accumulator
- (current: U, element: T, offset: number) => PromiseLike<U> | U
The callback used to compute each result.
- seed
- U
An optional seed value. Subquery
Returns
selfAsync(source, predicate)
Selects each node in the iterable. This is equivalent to the self::*
or .
selectors in XPath.
Hierarchy
Declaration
export declare function selfAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
- predicate
- (element: T) => element is U
Returns
selfAsync(source, predicate)
Declaration
export declare function selfAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
- predicate
- (element: T) => PromiseLike<boolean> | boolean
Returns
siblingsAndSelfAsync(source, predicate)
Selects the siblings of each node in the iterable, including the node itself. This equivalent to the ../*
selector in XPath.
Hierarchy
Declaration
export declare function siblingsAndSelfAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
siblingsAndSelfAsync(source, predicate)
Declaration
export declare function siblingsAndSelfAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
siblingsAsync(source, predicate)
Selects the siblings of each node in the iterable, excluding the node itself. Hierarchy
Declaration
export declare function siblingsAsync<TNode, U extends TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate: (element: TNode) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- U
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => element is U
Returns
siblingsAsync(source, predicate)
Declaration
export declare function siblingsAsync<TNode>(source: AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>, predicate?: (element: TNode) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode>;
Type Parameters
- TNode
Parameters
- source
- AsyncHierarchyIterable<TNode> | HierarchyIterable<TNode>
- predicate
- (element: TNode) => PromiseLike<boolean> | boolean
Returns
singleAsync(source, predicate)
Gets the only element, or returns undefined
.
Declaration
export declare function singleAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => element is U): Promise<U | undefined>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T) => element is U
An optional callback used to match each element. Scalar
Returns
singleAsync(source, predicate)
Gets the only element, or returns undefined
.
Declaration
export declare function singleAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): Promise<T | undefined>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to match each element. Scalar
Returns
someAsync(source, predicate)
Computes a scalar value indicating whether source
contains any elements,
optionally filtering the elements using the supplied callback.
Declaration
export declare function someAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate?: (element: T) => PromiseLike<boolean> | boolean): Promise<boolean>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to match each element. Scalar
Returns
spanAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that match the supplied predicate, and whose second element is an AsyncIterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => element is U): Promise<[HierarchyIterable<TNode, U>, AsyncHierarchyIterable<TNode, T>]>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => element is U
The predicate used to match elements. Scalar
Returns
spanAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that match the supplied predicate, and whose second element is an AsyncIterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): Promise<[HierarchyIterable<TNode, T>, AsyncHierarchyIterable<TNode, T>]>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
The predicate used to match elements. Scalar
Returns
spanAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that match the supplied predicate, and whose second element is an AsyncIterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => element is U): Promise<[Iterable<U>, AsyncIterable<T>]>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T, offset: number) => element is U
The predicate used to match elements. Scalar
Returns
spanAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that match the supplied predicate, and whose second element is an AsyncIterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): Promise<[Iterable<T>, AsyncIterable<T>]>;
Type Parameters
- T
Parameters
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
The predicate used to match elements. Scalar
Returns
spanMapAsync(source, keySelector, keyEqualer)
Creates a subquery whose elements are the contiguous ranges of elements that share the same key.
Declaration
export declare function spanMapAsync<TNode, T extends TNode, K>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<HierarchyGrouping<K, TNode, T>>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
spanMapAsync(source, keySelector, elementSelector, spanSelector, keyEqualer)
Creates a subquery whose elements are the contiguous ranges of elements that share the same key.
Declaration
export declare function spanMapAsync<TNode, T extends TNode, K, R>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, elementSelector: undefined, spanSelector: (key: K, elements: HierarchyIterable<TNode, T>) => R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- TNode
- T
- K
- R
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- spanSelector
- (key: K, elements: HierarchyIterable<TNode, T>) => R
A callback used to select a result from a contiguous range.
Returns
spanMapAsync(source, keySelector, keyEqualer)
Creates a subquery whose elements are the contiguous ranges of elements that share the same key.
Declaration
export declare function spanMapAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<Grouping<K, T>>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
spanMapAsync(source, keySelector, elementSelector, keyEqualer)
Creates a subquery whose values are computed from each element of the contiguous ranges of elements that share the same key.
Declaration
export declare function spanMapAsync<T, K, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, keyEqualer?: Equaler<K>): AsyncIterable<Grouping<K, V>>;
Type Parameters
- T
- K
- V
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback used to select a value for an element.
Returns
spanMapAsync(source, keySelector, elementSelector, spanSelector, keyEqualer)
Creates a subquery whose values are computed from the contiguous ranges of elements that share the same key.
Declaration
export declare function spanMapAsync<T, K, V, R>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, spanSelector: (key: K, elements: Iterable<V>) => PromiseLike<R> | R, keyEqualer?: Equaler<K>): AsyncIterable<R>;
Type Parameters
- T
- K
- V
- R
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for an element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback used to select a value for an element.
- spanSelector
- (key: K, elements: Iterable<V>) => PromiseLike<R> | R
A callback used to select a result from a contiguous range.
Returns
spanUntilAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that do not match the supplied predicate, and whose second element is an AsyncIterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanUntilAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): Promise<[HierarchyIterable<T>, AsyncHierarchyIterable<T>]>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
The predicate used to match elements. Scalar
Returns
spanUntilAsync(source, predicate)
Creates a tuple whose first element is an Iterable
containing the first span of
elements that do not match the supplied predicate, and whose second element is an Iterable
containing the remaining elements.
The first Iterable
is eagerly evaluated, while the second AsyncIterable
is lazily
evaluated.
Declaration
export declare function spanUntilAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T, offset: number) => PromiseLike<boolean> | boolean): Promise<[Iterable<T>, AsyncIterable<T>]>;
Type Parameters
- T
Parameters
- predicate
- (element: T, offset: number) => PromiseLike<boolean> | boolean
The predicate used to match elements. Scalar
Returns
startsWithAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of this AsyncIterable
start
with the same sequence of elements in another AsyncIterable
.
Declaration
export declare function startsWithAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>;
Type Parameters
- T
Parameters
- equaler
- EqualityComparison<T> | Equaler<T>
A callback or Equaler
object used to compare the equality of two elements.
Scalar
Returns
startsWithAsync(left, right, equaler)
Computes a scalar value indicating whether the elements of this AsyncIterable
start
with the same sequence of elements in another AsyncIterable
.
Declaration
export declare function startsWithAsync<T, U>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, equaler: (left: T, right: U) => boolean): Promise<boolean>;
Type Parameters
- T
- U
Parameters
- equaler
- (left: T, right: U) => boolean
A callback or Equaler
object used to compare the equality of two elements.
Scalar
Returns
sumAsync(source)
Computes the sum for a series of numbers.
NOTE: If any element is not a number
, this overload will throw.
Declaration
export declare function sumAsync(source: AsyncIterable<number> | Iterable<PromiseLike<number> | number>): Promise<number>;
Parameters
- source
- AsyncIterable<number> | Iterable<PromiseLike<number> | number>
An AsyncIterable
or Iterable
object.
Scalar
Returns
sumAsync(source, elementSelector)
Computes the sum for a series of numbers.
Declaration
export declare function sumAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, elementSelector: (element: T) => PromiseLike<number> | number): Promise<number>;
Type Parameters
- T
Parameters
- elementSelector
- (element: T) => PromiseLike<number> | number
A callback used to convert a value in source
to a number.
Scalar
Returns
symmetricDifferenceAsync(left, right, equaler)
Creates an AsyncIterable
for the symmetric difference between two [[Queryable]] objects.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceAsync<TNode, T extends TNode>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
symmetricDifferenceAsync(left, right, equaler)
Creates an AsyncIterable
for the symmetric difference between two [[Queryable]] objects.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceAsync<TNode, T extends TNode>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
symmetricDifferenceAsync(left, right, equaler)
Creates an AsyncIterable
for the symmetric difference between two [[Queryable]] objects.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
symmetricDifferenceByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the symmetric difference between two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceByAsync<TNode, T extends TNode, K>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
symmetricDifferenceByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the symmetric difference between two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceByAsync<TNode, T extends TNode, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
symmetricDifferenceByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the symmetric difference between two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
The result is an AsyncIterable
containings the elements that exist in only left or right, but not
in both.
Declaration
export declare function symmetricDifferenceByAsync<T, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
takeAsync(source, count)
Creates an AsyncIterable
containing the first elements up to the supplied count.
Declaration
export declare function takeAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, count: number): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
takeAsync(source, count)
Creates an AsyncIterable
containing the first elements up to the supplied count.
Declaration
export declare function takeAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, count: number): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
takeRightAsync(source, count)
Creates an AsyncIterable
containing the last elements up to the supplied
count.
Declaration
export declare function takeRightAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, count: number): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
takeRightAsync(source, count)
Creates an AsyncIterable
containing the last elements up to the supplied
count.
Declaration
export declare function takeRightAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, count: number): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
takeUntilAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that do not match the supplied predicate.
Declaration
export declare function takeUntilAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => element is U
A callback used to match each element. Subquery
Returns
takeUntilAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that do not match the supplied predicate.
Declaration
export declare function takeUntilAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
takeUntilAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that do not match the supplied predicate.
Declaration
export declare function takeUntilAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => element is U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T) => element is U
A callback used to match each element. Subquery
Returns
takeUntilAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that do not match the supplied predicate.
Declaration
export declare function takeUntilAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
takeWhileAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that match the supplied predicate.
Declaration
export declare function takeWhileAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => element is U): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => element is U
A callback used to match each element. Subquery
Returns
takeWhileAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that match the supplied predicate.
Declaration
export declare function takeWhileAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
takeWhileAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that match the supplied predicate.
Declaration
export declare function takeWhileAsync<T, U extends T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => element is U): AsyncIterable<U>;
Type Parameters
- T
- U
Parameters
- predicate
- (element: T) => element is U
A callback used to match each element. Subquery
Returns
takeWhileAsync(source, predicate)
Creates an AsyncIterable
containing the first elements that match the supplied predicate.
Declaration
export declare function takeWhileAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, predicate: (element: T) => PromiseLike<boolean> | boolean): AsyncIterable<T>;
Type Parameters
- T
Parameters
- predicate
- (element: T) => PromiseLike<boolean> | boolean
A callback used to match each element. Subquery
Returns
tapAsync(source, callback)
Lazily invokes a callback as each element of the iterable is iterated.
Declaration
export declare function tapAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, callback: (element: T, offset: number) => PromiseLike<void> | void): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
tapAsync(source, callback)
Lazily invokes a callback as each element of the iterable is iterated.
Declaration
export declare function tapAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, callback: (element: T, offset: number) => PromiseLike<void> | void): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
thenByAsync(source, keySelector, keyComparer)
Creates a subsequent AsyncOrderedIterable
whose elements are also sorted in ascending order by the provided key.
Declaration
export declare function thenByAsync<TNode, T extends TNode, K>(source: AsyncOrderedHierarchyIterable<TNode, T> | OrderedHierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncOrderedHierarchyIterable<TNode, T> | OrderedHierarchyIterable<TNode, T>
An AsyncOrderedIterable
or OrderedIterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
thenByAsync(source, keySelector, keyComparer)
Creates a subsequent AsyncOrderedIterable
whose elements are also sorted in ascending order by the provided key.
Declaration
export declare function thenByAsync<T, K>(source: AsyncOrderedIterable<T> | OrderedIterable<T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedIterable<T>;
Type Parameters
- T
- K
Parameters
- source
- AsyncOrderedIterable<T> | OrderedIterable<T>
An AsyncOrderedIterable
or OrderedIterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
thenByDescendingAsync(source, keySelector, keyComparer)
Creates a subsequent AsyncOrderedIterable
whose elements are also sorted in descending order by the provided key.
Declaration
export declare function thenByDescendingAsync<TNode, T extends TNode, K>(source: AsyncOrderedHierarchyIterable<TNode, T> | OrderedHierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- source
- AsyncOrderedHierarchyIterable<TNode, T> | OrderedHierarchyIterable<TNode, T>
An AsyncOrderedIterable
or OrderedIterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
thenByDescendingAsync(source, keySelector, keyComparer)
Creates a subsequent AsyncOrderedIterable
whose elements are also sorted in descending order by the provided key.
Declaration
export declare function thenByDescendingAsync<T, K>(source: AsyncOrderedIterable<T> | OrderedIterable<T>, keySelector: (element: T) => K, keyComparer?: Comparison<K> | Comparer<K>): AsyncOrderedIterable<T>;
Type Parameters
- T
- K
Parameters
- source
- AsyncOrderedIterable<T> | OrderedIterable<T>
An AsyncOrderedIterable
or OrderedIterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for an element.
Returns
toArrayAsync(source)
Creates an Array for the elements of the AsyncIterable
.
Declaration
export declare function toArrayAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): Promise<T[]>;
Type Parameters
- T
Parameters
Returns
toArrayAsync(source, elementSelector)
Creates an Array for the elements of the AsyncIterable
.
Declaration
export declare function toArrayAsync<T, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, elementSelector: (element: T) => PromiseLike<V> | V): Promise<V[]>;
Type Parameters
- T
- V
Parameters
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element. Scalar
Returns
toHashMapAsync(source, keySelector, keyEqualer)
Creates a HashMap
for the elements of the source.
Declaration
export declare function toHashMapAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): Promise<HashMap<K, T>>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element.
Returns
toHashMapAsync(source, keySelector, elementSelector, keyEqualer)
Creates a HashMap
for the elements of the source.
Declaration
export declare function toHashMapAsync<T, K, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, keyEqualer?: Equaler<K>): Promise<HashMap<K, V>>;
Type Parameters
- T
- K
- V
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
Returns
toHashSetAsync(source, equaler)
Creates a HashSet
for the elements of the AsyncIterable
.
Declaration
export declare function toHashSetAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): Promise<HashSet<T>>;
Type Parameters
- T
Parameters
Returns
toHashSetAsync(source, elementSelector, equaler)
Creates a HashSet
for the elements of the AsyncIterable
.
Declaration
export declare function toHashSetAsync<T, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, elementSelector: (element: T) => PromiseLike<V> | V, equaler?: Equaler<V>): Promise<HashSet<V>>;
Type Parameters
- T
- V
Parameters
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
Returns
toHierarchyAsync(source, hierarchy)
Creates an AsyncHierarchyIterable
using the provided HierarchyProvider
.
Declaration
export declare function toHierarchyAsync<TNode, T extends TNode = TNode>(source: AsyncOrderedIterable<T> | OrderedIterable<T>, hierarchy: HierarchyProvider<TNode>): AsyncOrderedHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
Returns
toHierarchyAsync(source, hierarchy)
Creates an AsyncHierarchyIterable
using the provided HierarchyProvider
.
Declaration
export declare function toHierarchyAsync<TNode, T extends TNode = TNode>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, hierarchy: HierarchyProvider<TNode>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
Returns
toLookupAsync(source, keySelector, keyEqualer)
Creates a Lookup for the elements of the source.
Declaration
export declare function toLookupAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): Promise<Lookup<K, T>>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element.
Returns
toLookupAsync(source, keySelector, elementSelector, keyEqualer)
Creates a Lookup for the elements of the source.
Declaration
export declare function toLookupAsync<T, K, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, keyEqualer?: Equaler<K>): Promise<Lookup<K, V>>;
Type Parameters
- T
- K
- V
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
Returns
toMapAsync(source, keySelector)
Creates a Map for the elements of the AsyncIterable
.
Declaration
export declare function toMapAsync<T, K>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K): Promise<Map<K, T>>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element. Scalar
Returns
toMapAsync(source, keySelector, elementSelector)
Creates a Map for the elements of the AsyncIterable
.
Declaration
export declare function toMapAsync<T, K, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V): Promise<Map<K, V>>;
Type Parameters
- T
- K
- V
Parameters
- keySelector
- (element: T) => K
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element. Scalar
Returns
toObjectAsync(source, prototype, keySelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0]);
obj.x; // ["x", 1]
obj.y; // ["y", 2]
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, TProto extends object, K extends PropertyKey>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: TProto, keySelector: (element: T) => K): Promise<TProto & Record<K, T>>;
Type Parameters
- T
- TProto
- K
Parameters
- prototype
- TProto
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
- (element: T) => K
A callback used to select a key for each element. Scalar
Returns
toObjectAsync(source, prototype, keySelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0]);
obj.x; // ["x", 1]
obj.y; // ["y", 2]
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, TProto extends object>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: TProto, keySelector: (element: T) => PropertyKey): Promise<TProto & Record<PropertyKey, T>>;
Type Parameters
- T
- TProto
Parameters
- prototype
- TProto
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
- (element: T) => PropertyKey
A callback used to select a key for each element. Scalar
Returns
toObjectAsync(source, prototype, keySelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0]);
obj.x; // ["x", 1]
obj.y; // ["y", 2]
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, K extends PropertyKey>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: object | null | undefined, keySelector: (element: T) => K): Promise<Record<K, T>>;
Type Parameters
- T
- K
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
- (element: T) => K
A callback used to select a key for each element. Scalar
Returns
toObjectAsync(source, prototype, keySelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0]);
obj.x; // ["x", 1]
obj.y; // ["y", 2]
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: object | null | undefined, keySelector: (element: T) => PropertyKey): Promise<Record<PropertyKey, T>>;
Type Parameters
- T
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
- (element: T) => PropertyKey
A callback used to select a key for each element. Scalar
Returns
toObjectAsync(source, prototype, keySelector, elementSelector, descriptorSelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
obj.x; // 1
obj.y; // 2
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, TProto extends object, K extends PropertyKey, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: TProto, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, descriptorSelector?: (key: K, value: V) => TypedPropertyDescriptor<V>): Promise<TProto & Record<K, V>>;
Type Parameters
- T
- TProto
- K
- V
Parameters
- prototype
- TProto
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
- (element: T) => K
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
- descriptorSelector
- (key: K, value: V) => TypedPropertyDescriptor<V>
A callback that defines the PropertyDescriptor
for each property.
Scalar
Returns
toObjectAsync(source, prototype, keySelector, elementSelector, descriptorSelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
obj.x; // 1
obj.y; // 2
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, TProto extends object, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: TProto, keySelector: (element: T) => PropertyKey, elementSelector: (element: T) => PromiseLike<V> | V, descriptorSelector?: (key: PropertyKey, value: V) => TypedPropertyDescriptor<V>): Promise<TProto & Record<PropertyKey, V>>;
Type Parameters
- T
- TProto
- V
Parameters
- prototype
- TProto
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
- (element: T) => PropertyKey
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
- descriptorSelector
- (key: PropertyKey, value: V) => TypedPropertyDescriptor<V>
A callback that defines the PropertyDescriptor
for each property.
Scalar
Returns
toObjectAsync(source, prototype, keySelector, elementSelector, descriptorSelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
obj.x; // 1
obj.y; // 2
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, K extends PropertyKey, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: object | null | undefined, keySelector: (element: T) => K, elementSelector: (element: T) => PromiseLike<V> | V, descriptorSelector?: (key: K, value: V) => TypedPropertyDescriptor<V>): Promise<Record<K, V>>;
Type Parameters
- T
- K
- 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
- (element: T) => K
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
- descriptorSelector
- (key: K, value: V) => TypedPropertyDescriptor<V>
A callback that defines the PropertyDescriptor
for each property.
Scalar
Returns
toObjectAsync(source, prototype, keySelector, elementSelector, descriptorSelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
obj.x; // 1
obj.y; // 2
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: object | null | undefined, keySelector: (element: T) => PropertyKey, elementSelector: (element: T) => PromiseLike<V> | V, descriptorSelector?: (key: PropertyKey, value: V) => TypedPropertyDescriptor<V>): Promise<Record<PropertyKey, V>>;
Type Parameters
- T
- 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
- (element: T) => PropertyKey
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
- descriptorSelector
- (key: PropertyKey, value: V) => TypedPropertyDescriptor<V>
A callback that defines the PropertyDescriptor
for each property.
Scalar
Returns
toObjectAsync(source, prototype, keySelector, elementSelector, descriptorSelector)
Creates an Object for the elements of source
. Properties are added via Object.defineProperty
.
// As a regular object
const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], 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 toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
obj.x; // 1
obj.y; // 2
typeof obj.toString; // undefined
Declaration
export declare function toObjectAsync<T, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, prototype: object | null | undefined, keySelector: (element: T) => PropertyKey, elementSelector: (element: T) => PromiseLike<V> | V, descriptorSelector?: (key: PropertyKey, value: V) => PropertyDescriptor): Promise<object>;
Type Parameters
- T
- 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
- (element: T) => PropertyKey
A callback used to select a key for each element.
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element.
- descriptorSelector
- (key: PropertyKey, value: V) => PropertyDescriptor
A callback that defines the PropertyDescriptor
for each property.
Scalar
Returns
topMostAsync(source, predicate, equaler)
Creates an AsyncHierarchyIterable
for the top-most elements. Elements of source
that are a descendant of any other
element of source
are removed.
Declaration
export declare function topMostAsync<TNode, T extends TNode, U extends T>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate: (element: T) => element is U, equaler?: Equaler<TNode>): AsyncHierarchyIterable<TNode, U>;
Type Parameters
- TNode
- T
- U
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: T) => element is U
An optional callback used to filter the results.
Returns
topMostAsync(source, predicate, equaler)
Creates an AsyncHierarchyIterable
for the top-most elements. Elements of source
that are a descendant of any other
element of source
are removed.
Declaration
export declare function topMostAsync<TNode, T extends TNode>(source: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, predicate?: (element: T) => PromiseLike<boolean> | boolean, equaler?: Equaler<TNode>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- source
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncHierarchyIterable
or HierarchyIterable
object.
- predicate
- (element: T) => PromiseLike<boolean> | boolean
An optional callback used to filter the results.
Returns
toSetAsync(source)
Creates a Set for the elements of the Iterable.
Declaration
export declare function toSetAsync<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): Promise<Set<T>>;
Type Parameters
- T
Parameters
Returns
toSetAsync(source, elementSelector)
Creates a Set for the elements of the Iterable.
Declaration
export declare function toSetAsync<T, V>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, elementSelector: (element: T) => PromiseLike<V> | V): Promise<Set<V>>;
Type Parameters
- T
- V
Parameters
- elementSelector
- (element: T) => PromiseLike<V> | V
A callback that selects a value for each element. Scalar
Returns
unionAsync(left, right, equaler)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects.
Declaration
export declare function unionAsync<TNode, T extends TNode>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
unionAsync(left, right, equaler)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects.
Declaration
export declare function unionAsync<TNode, T extends TNode>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, equaler?: Equaler<T>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
Returns
unionAsync(left, right, equaler)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects.
Declaration
export declare function unionAsync<T>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, equaler?: Equaler<T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
Returns
unionByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function unionByAsync<TNode, T extends TNode, K>(left: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- left
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
unionByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function unionByAsync<TNode, T extends TNode, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncHierarchyIterable<TNode, T>;
Type Parameters
- TNode
- T
- K
Parameters
- right
- AsyncHierarchyIterable<TNode, T> | HierarchyIterable<TNode, T>
An AsyncIterable
or Iterable
object.
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
unionByAsync(left, right, keySelector, keyEqualer)
Creates an AsyncIterable
for the set union of two AsyncIterable
or Iterable
objects, where set identity is determined by the selected key.
Declaration
export declare function unionByAsync<T, K>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, keySelector: (element: T) => K, keyEqualer?: Equaler<K>): AsyncIterable<T>;
Type Parameters
- T
- K
Parameters
- keySelector
- (element: T) => K
A callback used to select the key for each element.
Returns
unzipAsync(source)
Unzips a sequence of tuples into a tuple of sequences.
Declaration
export declare function unzipAsync<T extends readonly any[] | []>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): Promise<{
-readonly [I in keyof T]: T[I][];
}>;
Type Parameters
- T
Parameters
Returns
unzipAsync(source, partSelector)
Unzips a sequence of tuples into a tuple of sequences.
Declaration
export declare function unzipAsync<T, U extends readonly any[] | []>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, partSelector: (value: T) => PromiseLike<U> | U): Promise<{
-readonly [I in keyof U]: U[I][];
}>;
Type Parameters
- T
- U
Parameters
- partSelector
- (value: T) => PromiseLike<U> | U
A callback that converts a result into a tuple. Scalar
Returns
zipAsync(left, right)
Creates a subquery that combines two [[AsyncQueryable]] objects by combining elements in tuples.
Declaration
export declare function zipAsync<T, U>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>): AsyncIterable<[T, U]>;
Type Parameters
- T
- U
Parameters
Returns
zipAsync(left, right, selector)
Creates a subquery that combines two [[AsyncQueryable]] objects by combining elements using the supplied callback.
Declaration
export declare function zipAsync<T, U, R>(left: AsyncIterable<T> | Iterable<PromiseLike<T> | T>, right: AsyncIterable<U> | Iterable<PromiseLike<U> | U>, selector: (left: T, right: U) => PromiseLike<R> | R): AsyncIterable<R>;
Type Parameters
- T
- U
- R