@itwin/clash-detection-client
Version:
Clash Detection client for the iTwin platform
29 lines • 1.79 kB
TypeScript
/**
* Transforms each entity in the async iterator using the provided function.
* @param {AsyncIterableIterator<TSource>} iterator source entity iterator.
* @param {(entity: TSource) => TTarget} mapFunc function to transform elements from `TSource` to `TTarget`.
* @returns {AsyncIterableIterator<TTarget>} iterator of transformed elements.
*/
export declare function map<TSource, TTarget>(iterator: AsyncIterableIterator<TSource>, mapFunc: (entity: TSource) => TTarget): AsyncIterableIterator<TTarget>;
/**
* Transforms an iterator of entity pages into an iterator of entities.
* @param {AsyncIterableIterator<TEntity[]>} pagedIterator iterator of entity pages.
* @returns {AsyncIterableIterator<TEntity>} iterator of entities.
*/
export declare function flatten<TEntity>(pagedIterator: AsyncIterableIterator<TEntity[]>): AsyncIterableIterator<TEntity>;
/**
* Loads all entities from an iterator into an array.
* @param {AsyncIterableIterator<TEntity>} iterator entity iterator.
* @returns {Promise<TEntity[]>} entity array.
*/
export declare function toArray<TEntity>(iterator: AsyncIterableIterator<TEntity>): Promise<TEntity[]>;
/**
* Loads top n entities from an iterator into an array.
* @param {AsyncIterableIterator<TSource>} iterator source entity iterator.
* @param {number} entityCount number of entities to load.
* @returns {Promise<TEntity[]>} entity array that contains a number of top elements specified. If iterator contains
* less items than specified in `entityCount` length of the array will be less than `entityCount`. If
* iterator contains no entities the array will be empty.
*/
export declare function take<TEntity>(iterator: AsyncIterableIterator<TEntity>, entityCount: number): Promise<TEntity[]>;
//# sourceMappingURL=IteratorUtilFunctions.d.ts.map