1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import * as O from 'fp-ts/lib/Option'
|
11 | import { At } from './At'
|
12 | import { Iso } from './Iso'
|
13 | import { Optional } from './Optional'
|
14 | import { Eq } from 'fp-ts/lib/Eq'
|
15 | import Option = O.Option
|
16 | import { ReadonlyRecord } from 'fp-ts/lib/ReadonlyRecord'
|
17 | import { ReadonlyNonEmptyArray } from 'fp-ts/lib/ReadonlyNonEmptyArray'
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export interface Index<S, I, A> {
|
23 | readonly index: (i: I) => Optional<S, A>
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare const index: <S, I, A>(index: Index<S, I, A>['index']) => Index<S, I, A>
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | export declare const fromAt: <T, J, B>(at: At<T, J, O.Option<B>>) => Index<T, J, B>
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export declare const fromIso: <T, S>(iso: Iso<T, S>) => <I, A>(sia: Index<S, I, A>) => Index<T, I, A>
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | export declare const indexReadonlyArray: <A = never>() => Index<ReadonlyArray<A>, number, A>
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | export declare const indexReadonlyNonEmptyArray: <A = never>() => Index<ReadonlyNonEmptyArray<A>, number, A>
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare const indexReadonlyRecord: <A = never>() => Index<ReadonlyRecord<string, A>, string, A>
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | export declare const indexReadonlyMap: <K>(E: Eq<K>) => <A = never>() => Index<ReadonlyMap<K, A>, K, A>
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | export declare const indexArray: <A = never>() => Index<ReadonlyArray<A>, number, A>
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | export declare const indexRecord: <A = never>() => Index<ReadonlyRecord<string, A>, string, A>
|