UNPKG

@beenotung/tslib

Version:
21 lines (20 loc) 1.24 kB
import { ArrayMapper, MapValueMapper, NodeListElementMapper, ObjectMapper, SetMapper } from './map'; export type ArrayConsumer<A> = ArrayMapper<A, void>; export type ObjectConsumer<A> = ObjectMapper<A, void>; export type SetConsumer<A> = SetMapper<A, void>; export type MapValueConsumer<K, V> = MapValueMapper<K, V, void, void>; export type NodeListElementConsumer<A extends Element> = NodeListElementMapper<A, void>; export declare namespace foreachs { function array<A>(xs: A[], f: ArrayConsumer<A>): void; function object<A>(x: A, f: ObjectConsumer<A>): void; function set<A>(xs: Set<A>, f: SetConsumer<A>): void; function map<K, V>(xs: Map<K, V>, f: MapValueConsumer<K, V>): void; function nodeList<A extends Element = Element>(xs: NodeListOf<A> | HTMLCollectionOf<A>, f: NodeListElementConsumer<A>): void; function any(o: any, f: (a: any) => void): void; } export declare const foreach_array: typeof foreachs.array; export declare const foreach_object: typeof foreachs.object; export declare const foreach_set: typeof foreachs.set; export declare const foreach_map: typeof foreachs.map; export declare const foreach_nodeList: typeof foreachs.nodeList; export declare const foreach_any: typeof foreachs.any;