/** * A `Lens` is an optic used to zoom inside a product. * * `Lens`es have two type parameters generally called `S` and `A`: `Lens` where `S` represents the product and `A` * an element inside of `S`. * * Laws: * * 1. get(set(a)(s)) = a * 2. set(get(s))(s) = s * 3. set(a)(set(a)(s)) = set(a)(s) */ import type { Either } from "@effect-ts/core/Either"; import type { Predicate, Refinement } from "@effect-ts/core/Function"; import type { Option } from "@effect-ts/core/Option"; import type { URI } from "@effect-ts/core/Prelude"; import * as P from "@effect-ts/core/Prelude"; import type { HashMap } from "@effect-ts/system/Collections/Immutable/HashMap"; import * as _ from "../Internal/index.js"; import { Lens } from "../Internal/index.js"; import type { Optional } from "../Optional/index.js"; import type { Prism } from "../Prism/index.js"; import type { Traversal } from "../Traversal/index.js"; export { Lens }; export declare const id: () => Lens; /** * View a `Lens` as a `Optional` */ export declare const asOptional: (sa: Lens) => Optional; /** * View a `Lens` as a `Traversal` */ export declare const asTraversal: (sa: Lens) => Traversal; /** * Compose a `Lens` with a `Lens` */ export declare const compose: (ab: Lens) => (sa: Lens) => Lens; /** * Compose a `Lens` with a `Prism` */ export declare const composePrism: (ab: Prism) => (sa: Lens) => Optional; /** * Compose a `Lens` with an `Optional` */ export declare const composeOptional: (ab: _.Optional) => (sa: _.Lens) => _.Optional; export declare const modify: (f: (a: A) => A) => (sa: _.Lens) => (s: S) => S; /** * Return a `Optional` from a `Lens` focused on a nullable value */ export declare const fromNullable: (sa: _.Lens) => _.Optional>; export declare function filter(refinement: Refinement): (sa: Lens) => Optional; export declare function filter(predicate: Predicate): (sa: Lens) => Optional; /** * Return a `Lens` from a `Lens` and a prop */ export declare const prop: (prop: P) => (sa: Lens) => Lens; /** * Return a `Lens` from a `Lens` and a list of props */ export declare const props: (...props: [P, P, ...Array

]) => (sa: Lens) => Lens; /** * Return a `Lens` from a `Lens` and a component */ export declare const component: , P extends keyof A>(prop: P) => (sa: Lens) => Lens; /** * Return a `Optional` from a `Lens` focused on a `ReadonlyArray` */ export declare const index: (i: number) => (sa: _.Lens) => _.Optional; /** * Return a `Optional` from a `Lens` focused on a `ReadonlyRecord` and a key */ export declare const keyInRecord: (key: string) => (sa: _.Lens>>) => _.Optional; /** * Return a `Lens` from a `Lens` focused on a `ReadonlyRecord` and a required key */ export declare const atKeyInRecord: (key: string) => (sa: _.Lens>>) => _.Lens>; /** * Return a `Optional` from a `Lens` focused on a `HashMap` and a key */ export declare const keyInHashMap: (key: K) => (sa: _.Lens>>) => _.Optional; /** * Return a `Lens` from a `Lens` focused on a `HashMap` and a required key */ export declare const atKeyInHashMap: (key: K) => (sa: _.Lens>>) => _.Lens>; /** * Return a `Optional` from a `Lens` focused on the `Some` of a `Option` type */ export declare const some: (soa: Lens>) => Optional; /** * Return a `Optional` from a `Lens` focused on the `Right` of a `Either` type */ export declare const right: (sea: Lens>) => Optional; /** * Return a `Optional` from a `Lens` focused on the `Left` of a `Either` type */ export declare const left: (sea: Lens>) => Optional; /** * Pipeable set */ export declare const set: (a: A) => (lens: _.Lens) => (s: S) => S; /** * Pipeable get */ export declare const get: (lens: _.Lens) => (s: S) => A; /** * Return a `Traversal` from a `Lens` focused on a `ForEach` */ export declare function forEach(T: P.ForEach): (sta: Lens>) => Traversal; export declare const find: (predicate: Predicate) => (sa: Lens>) => Optional; export declare const imap: (f: (a: A) => B, g: (b: B) => A) => (sa: Lens) => Lens; export declare const LensURI = "monocle/Lens"; export declare type LensURI = typeof LensURI; declare module "@effect-ts/core/Prelude/HKT" { interface URItoKind { [LensURI]: Lens; } } export declare const Category: P.Category<[URI<"monocle/Lens", {}>], P.Auto>; export declare const Invariant: P.Invariant<[URI<"monocle/Lens", {}>], P.Auto>; //# sourceMappingURL=index.d.ts.map