/** * 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. */ declare module "iterall" { // Note: TypeScript already has built-in definitions for // Iterable and Iterator so they are not defined here. export var $$iterator: symbol | string export function isIterable(obj: any): boolean export function isArrayLike(obj: any): boolean export function isCollection(obj: any): boolean 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 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 function createIterator(collection: Iterable): Iterator export function createIterator(collection: { length: number }): Iterator export function createIterator(collection: any): void | Iterator }