import { At, Index, Lens, Optional, Traversal } from 'monocle-ts'; import { Eq } from 'fp-ts/lib/Eq'; import * as O from 'fp-ts/lib/Option'; /** * Binary composition for lenses (`monocle-ts`) * * NOTE: This may feel like backwards (left-to-right) composition, * but it's not. Think of it as composing "focusers" instead of "accessors" */ export declare const oLens: (f: Lens, g: Lens) => Lens; /** * Helper that extracts the S type from a Lens */ export declare type ExtractSFromLens> = L extends Lens ? S : never; /** * Helper that extracts the A type from a Lens */ export declare type ExtractAFromLens> = L extends Lens ? A : never; /** * A function that generates monocle-ts Lenses for all top-level key-val pairs * when passed an object */ export declare const lensesFromRecord: ; }, IndexedLensRecord extends Record>>(x: A) => LensRecord; /** * Creates an Optional optic for a given index in some Array */ export declare const mkArrayIndexOptional: (i: number) => Optional; /** * Creates an Optional optic for a given key K in some Record * * TODO: Consider rewriting this in a different way */ export declare const mkRecordKeyOptional: , K extends keyof S & string>(k: K) => Optional; /** * `At` optic for `Map` keys * * Inspired by `atRecord` from `monocle-ts`: * * https://github.com/gcanti/monocle-ts/blob/master/src/At/Record.ts */ export declare function atMap(E: Eq): At, K, O.Option>; /** * `Index` optic for `Map` keys * * Inspired by `indexRecord` from `monocle-ts`: * * https://github.com/gcanti/monocle-ts/blob/master/src/Index/Record.ts */ export declare function indexMap(E: Eq): Index, K, A>; /** * Combines update and insert. Takes a Traversal to some `B`, and a Lens to * an array of `B`s. Attempts to set the existing value to the given value, or * failing that appends it to the array. */ export declare const upsert: (existing: Traversal, list: Lens) => (b: B) => (a: A) => A;