All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.iterall.index.d.ts Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2016, Lee Byron
 * All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

// Note: TypeScript already has built-in definitions for
// Iterable, Iterator, AsyncIterable, and AsyncIterator so they are not
// defined here. However you may need to configure TypeScript to include them.

export var $$iterator: symbol

export function isIterable(obj: any): obj is Iterable

export function isArrayLike(obj: any): obj is { length: number }

export function isCollection(obj: any): obj is Iterable | { length: number }

export function getIterator(
  iterable: Iterable
): Iterator
export function getIterator(iterable: any): void | Iterator

export function getIteratorMethod(
  iterable: Iterable
): () => Iterator
export function getIteratorMethod(iterable: any): void | (() => Iterator)

export function createIterator(
  collection: Iterable
): Iterator
export function createIterator(collection: { length: number }): Iterator
export function createIterator(collection: any): void | Iterator

export function forEach>(
  collection: TCollection,
  callbackFn: (value: TValue, index: number, collection: TCollection) => any,
  thisArg?: any
): void
export function forEach(
  collection: TCollection,
  callbackFn: (value: any, index: number, collection: TCollection) => any,
  thisArg?: any
): void

export var $$asyncIterator: symbol

export function isAsyncIterable(obj: any): obj is AsyncIterable

export function getAsyncIterator(
  asyncIterable: AsyncIterable
): AsyncIterator
export function getAsyncIterator(
  asyncIterable: any
): void | AsyncIterator

export function getAsyncIteratorMethod(
  asyncIterable: AsyncIterable
): () => AsyncIterator
export function getAsyncIteratorMethod(
  asyncIterable: any
): void | (() => AsyncIterator)

export function createAsyncIterator(
  collection: AsyncIterable | Iterable | TValue>
): AsyncIterator
export function createAsyncIterator(
  collection: {length: number}
): AsyncIterator
export function createAsyncIterator(
  collection: any
): void | AsyncIterator

export function forAwaitEach>(
  collection: TCollection,
  callbackFn: (value: TValue, index: number, collection: TCollection) => any,
  thisArg?: any
): Promise
export function forAwaitEach | TValue>>(
  collection: TCollection,
  callbackFn: (value: TValue, index: number, collection: TCollection) => any,
  thisArg?: any
): Promise
export function forAwaitEach(
  collection: TCollection,
  callbackFn: (value: any, index: number, collection: TCollection) => any,
  thisArg?: any
): Promise




© 2015 - 2024 Weber Informatics LLC | Privacy Policy