UNPKG

1.56 kBTypeScriptView Raw
1/**
2 * **This module is experimental**
3 *
4 * Experimental features are published in order to get early feedback from the community.
5 *
6 * A feature tagged as _Experimental_ is in a high state of flux, you're at risk of it changing without notice.
7 *
8 * @since 2.3.0
9 */
10import { Eq } from 'fp-ts/lib/Eq'
11import * as O from 'fp-ts/lib/Option'
12import { ReadonlyRecord } from 'fp-ts/lib/ReadonlyRecord'
13import { Iso } from './Iso'
14import { Lens } from './Lens'
15import Option = O.Option
16/**
17 * @category model
18 * @since 2.3.0
19 */
20export interface At<S, I, A> {
21 readonly at: (i: I) => Lens<S, A>
22}
23/**
24 * @category constructors
25 * @since 2.3.8
26 */
27export declare const at: <S, I, A>(at: At<S, I, A>['at']) => At<S, I, A>
28/**
29 * Lift an instance of `At` using an `Iso`.
30 *
31 * @category constructors
32 * @since 2.3.0
33 */
34export declare const fromIso: <T, S>(iso: Iso<T, S>) => <I, A>(sia: At<S, I, A>) => At<T, I, A>
35/**
36 * @category constructors
37 * @since 2.3.7
38 */
39export declare const atReadonlyRecord: <A = never>() => At<ReadonlyRecord<string, A>, string, Option<A>>
40/**
41 * @category constructors
42 * @since 2.3.7
43 */
44export declare const atReadonlyMap: <K>(E: Eq<K>) => <A = never>() => At<ReadonlyMap<K, A>, K, O.Option<A>>
45/**
46 * @category constructors
47 * @since 2.3.7
48 */
49export declare const atReadonlySet: <A>(E: Eq<A>) => At<ReadonlySet<A>, A, boolean>
50/**
51 * Use `atReadonlyRecord` instead.
52 *
53 * @category constructors
54 * @since 2.3.2
55 * @deprecated
56 */
57export declare const atRecord: <A = never>() => At<ReadonlyRecord<string, A>, string, Option<A>>