UNPKG

@dillonkearns/elm-graphql

Version:

<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">

78 lines (62 loc) 2.76 kB
/** * 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. * * @flow */ // Note: Flow already has built-in definitions for // Iterable, Iterator, AsyncIterable, and AsyncIterator so they are not // defined here. declare export var $$iterator: '@@iterator' declare export function isIterable(obj: any): boolean declare export function isArrayLike(obj: any): boolean declare export function isCollection(obj: any): boolean declare export var getIterator: & (<+TValue>(iterable: Iterable<TValue>) => Iterator<TValue>) & ((iterable: mixed) => void | Iterator<mixed>) declare export var getIteratorMethod: & (<+TValue>(iterable: Iterable<TValue>) => (() => Iterator<TValue>)) & ((iterable: mixed) => (void | (() => Iterator<mixed>))) declare export var createIterator: & (<+TValue>(collection: Iterable<TValue>) => Iterator<TValue>) & ((collection: {length: number}) => Iterator<mixed>) & ((collection: mixed) => (void | Iterator<mixed>)) declare export var forEach: & (<+TValue, TCollection: Iterable<TValue>>( collection: TCollection, callbackFn: (value: TValue, index: number, collection: TCollection) => any, thisArg?: any ) => void) & (<TCollection: {length: number}>( collection: TCollection, callbackFn: (value: mixed, index: number, collection: TCollection) => any, thisArg?: any ) => void) declare export var $$asyncIterator: '@@asyncIterator' declare export function isAsyncIterable(obj: any): boolean declare export var getAsyncIterator: & (<+TValue>(asyncIterable: AsyncIterable<TValue>) => AsyncIterator<TValue>) & ((asyncIterable: mixed) => (void | AsyncIterator<mixed>)) declare export var getAsyncIteratorMethod: & (<+TValue>(asyncIterable: AsyncIterable<TValue>) => (() => AsyncIterator<TValue>)) & ((asyncIterable: mixed) => (void | (() => AsyncIterator<mixed>))) declare export var createAsyncIterator: & (<+TValue>( collection: Iterable<Promise<TValue> | TValue> | AsyncIterable<TValue> ) => AsyncIterator<TValue>) & ((collection: {length: number}) => AsyncIterator<mixed>) & ((collection: mixed) => (void | AsyncIterator<mixed>)) declare export var forAwaitEach: & (<+TValue, TCollection: Iterable<Promise<TValue> | TValue> | AsyncIterable<TValue>>( collection: TCollection, callbackFn: (value: TValue, index: number, collection: TCollection) => any, thisArg?: any ) => Promise<void>) & (<TCollection: { length: number }>( collection: TCollection, callbackFn: (value: mixed, index: number, collection: TCollection) => any, thisArg?: any ) => Promise<void>)