1 | import '../polyfill-array';
|
2 | export declare type Mapper<A, B> = (a: A) => B;
|
3 | export declare type ArrayMapper<A, B> = (a: A, i: number, xs: A[]) => B;
|
4 | export declare type ObjectMapper<A, B> = (value: A[keyof A], key: keyof A, object: A) => B;
|
5 | export declare type SetMapper<A, B> = (a: A, xs: Set<A>) => B;
|
6 | export declare type MapValueMapper<AK, AV, BK, BV> = (v: AV, k: AK, xs: Map<AK, AV>) => BV;
|
7 | export declare type MapKeyMapper<AK, AV, BK, BV> = (v: AV, k: AK, xs: Map<AK, AV>) => BK;
|
8 | export declare type NodeListElementMapper<A extends Element, B> = (a: A, i: number, xs: NodeListOf<A> | HTMLCollectionOf<A>) => B;
|
9 | export declare namespace maps {
|
10 | function array<A, B>(xs: A[], f: ArrayMapper<A, B>): B[];
|
11 | function object<A, B>(x: A, f: ObjectMapper<A, B>): B;
|
12 | function set<A, B>(xs: Set<A>, f: SetMapper<A, B>): Set<B>;
|
13 | function map<AK, AV, BK, BV>(xs: Map<AK, AV>, valueMapper: MapValueMapper<AK, AV, BK, BV>, keyMapper?: MapKeyMapper<AK, AV, BK, BV>): Map<BK, BV>;
|
14 | function nodeList<A extends Element, B>(xs: NodeListOf<A> | HTMLCollectionOf<A>, f: NodeListElementMapper<A, B>): any[];
|
15 | function any(o: any, f: (a: any) => any): any;
|
16 | }
|
17 | export declare const map_array: typeof maps.array;
|
18 | export declare const map_object: typeof maps.object;
|
19 | export declare const map_set: typeof maps.set;
|
20 | export declare const map_map: typeof maps.map;
|
21 | export declare const map_nodeList: typeof maps.nodeList;
|
22 | export declare const map_any: typeof maps.any;
|