import { ElemType, Eq, IfElse, Nth, DottedPath, TuplePath, RequireString, Simplify } from './utils.js'; import { Adapt, Apply, Choice, Compose, DisallowTypeChange, ElemUnion, Elems, HKT, Id, Index, PartsOf, Plant, Prop, Optional, SetNth, SetDottedPath, SetTuplePath, Union } from './hkt.js'; export { Apply, Compose, Eq, HKT }; export type Removable = true | undefined; export interface Params { readonly _T: T; readonly _R: R; } export type OpticParams = Params; export type NextParams = Params, R>; export type NextComposeParams = Params, C2['_R']>; export type OpticFor = Equivalence>, S>; export type OpticFor_ = Equivalence, S>; export interface Equivalence { readonly _tag: 'Equivalence'; readonly _removable: T['_R']; compose(optic: Equivalence): Equivalence, A2>; compose(optic: Iso): Iso, A2>; iso(there: (a: A) => U, back: (u: U) => A): Iso>, U>; indexed(): Iso, [number, ElemType][]>; compose(optic: Lens): Lens, A2>; lens(view: (a: A) => U, update: (a: A, v: U) => A): Lens>, U>; prop(key: K): Lens>, A[K]>; path(path: K): Lens>, DottedPath>; path(...path: K): Lens>, TuplePath>; nth(n: N): Lens>, Nth>; pick(keys: K[]): Lens>, Pick>; filter>(predicate: (item: ElemType) => item is B): Lens>, B[]>; filter(predicate: (item: ElemType) => boolean): Lens>, A>; valueOr(defaultValue: B): Lens, Exclude | B>; partsOf(traversal: Traversal): Lens>, B[]>; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Lens>, B[]>; reread(read: (value: A) => A): Lens>, A>; rewrite(write: (value: A) => A): Lens>, A>; compose(optic: Prism): Prism, A2>; optional(): Prism, Exclude>; guard_(): (g: (a: A) => a is U) => Prism, U>; guard(g: (a: A) => a is U): Prism>, U>; find(predicate: (item: ElemType) => boolean): Prism, true>, ElemType>; when(predicate: (item: A) => boolean): Prism>, A>; at(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; head(): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; index(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; compose(optic: Traversal): Traversal, A2>; elems(): Traversal, ElemType>; chars(): RequireString>, string>>; words(): RequireString>, string>>; compose(optic: Getter): Getter; to(f: (a: A) => B): Getter; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; compose(optic: Setter): Setter, A2>; prependTo(): Setter>, ElemType>; appendTo(): Setter>, ElemType>; } export interface Iso { readonly _tag: 'Iso'; readonly _removable: T['_R']; compose(optic: Equivalence): Iso, A2>; compose(optic: Iso): Iso, A2>; iso(there: (a: A) => U, back: (u: U) => A): Iso>, U>; indexed(): Iso, [number, ElemType][]>; compose(optic: Lens): Lens, A2>; lens(view: (a: A) => U, update: (a: A, v: U) => A): Lens>, U>; prop(key: K): Lens>, A[K]>; path(path: K): Lens>, DottedPath>; path(...path: K): Lens>, TuplePath>; nth(n: N): Lens>, Nth>; pick(keys: K[]): Lens>, Pick>; filter>(predicate: (item: ElemType) => item is B): Lens>, B[]>; filter(predicate: (item: ElemType) => boolean): Lens>, A>; valueOr(defaultValue: B): Lens, Exclude | B>; partsOf(traversal: Traversal): Lens>, B[]>; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Lens>, B[]>; reread(read: (value: A) => A): Lens>, A>; rewrite(write: (value: A) => A): Lens>, A>; compose(optic: Prism): Prism, A2>; optional(): Prism, Exclude>; guard_(): (g: (a: A) => a is U) => Prism, U>; guard(g: (a: A) => a is U): Prism>, U>; find(predicate: (item: ElemType) => boolean): Prism, true>, ElemType>; when(predicate: (item: A) => boolean): Prism>, A>; at(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; head(): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; index(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; compose(optic: Traversal): Traversal, A2>; elems(): Traversal, ElemType>; chars(): RequireString>, string>>; words(): RequireString>, string>>; compose(optic: Getter): Getter; to(f: (a: A) => B): Getter; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; compose(optic: Setter): Setter, A2>; prependTo(): Setter>, ElemType>; appendTo(): Setter>, ElemType>; } export interface Lens { readonly _tag: 'Lens'; readonly _removable: T['_R']; compose(optic: Equivalence): Lens, A2>; compose(optic: Iso): Lens, A2>; iso(there: (a: A) => U, back: (u: U) => A): Lens>, U>; indexed(): Lens, [number, ElemType][]>; compose(optic: Lens): Lens, A2>; lens(view: (a: A) => U, update: (a: A, v: U) => A): Lens>, U>; prop(key: K): Lens>, A[K]>; path(path: K): Lens>, DottedPath>; path(...path: K): Lens>, TuplePath>; nth(n: N): Lens>, Nth>; pick(keys: K[]): Lens>, Pick>; filter>(predicate: (item: ElemType) => item is B): Lens>, B[]>; filter(predicate: (item: ElemType) => boolean): Lens>, A>; valueOr(defaultValue: B): Lens, Exclude | B>; partsOf(traversal: Traversal): Lens>, B[]>; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Lens>, B[]>; reread(read: (value: A) => A): Lens>, A>; rewrite(write: (value: A) => A): Lens>, A>; compose(optic: Prism): Prism, A2>; optional(): Prism, Exclude>; guard_(): (g: (a: A) => a is U) => Prism, U>; guard(g: (a: A) => a is U): Prism>, U>; find(predicate: (item: ElemType) => boolean): Prism, true>, ElemType>; when(predicate: (item: A) => boolean): Prism>, A>; at(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; head(): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; index(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; compose(optic: Traversal): Traversal, A2>; elems(): Traversal, ElemType>; chars(): RequireString>, string>>; words(): RequireString>, string>>; compose(optic: Getter): Getter; to(f: (a: A) => B): Getter; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; compose(optic: Setter): Setter, A2>; prependTo(): Setter>, ElemType>; appendTo(): Setter>, ElemType>; } export interface Prism { readonly _tag: 'Prism'; readonly _removable: T['_R']; compose(optic: Equivalence): Prism, A2>; compose(optic: Iso): Prism, A2>; iso(there: (a: A) => U, back: (u: U) => A): Prism>, U>; indexed(): Prism, [number, ElemType][]>; compose(optic: Lens): Prism, A2>; lens(view: (a: A) => U, update: (a: A, v: U) => A): Prism>, U>; prop(key: K): Prism>, A[K]>; path(path: K): Prism>, DottedPath>; path(...path: K): Prism>, TuplePath>; nth(n: N): Prism>, Nth>; pick(keys: K[]): Prism>, Pick>; filter>(predicate: (item: ElemType) => item is B): Prism>, B[]>; filter(predicate: (item: ElemType) => boolean): Prism>, A>; valueOr(defaultValue: B): Prism, Exclude | B>; partsOf(traversal: Traversal): Prism>, B[]>; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Prism>, B[]>; reread(read: (value: A) => A): Prism>, A>; rewrite(write: (value: A) => A): Prism>, A>; compose(optic: Prism): Prism, A2>; optional(): Prism, Exclude>; guard_(): (g: (a: A) => a is U) => Prism, U>; guard(g: (a: A) => a is U): Prism>, U>; find(predicate: (item: ElemType) => boolean): Prism, true>, ElemType>; when(predicate: (item: A) => boolean): Prism>, A>; at(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; head(): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; index(i: number): IfElse, Prism, true>, string>, Prism, true>, ElemType>>; compose(optic: Traversal): Traversal, A2>; elems(): Traversal, ElemType>; chars(): RequireString>, string>>; words(): RequireString>, string>>; compose(optic: Getter): AffineFold; to(f: (a: A) => B): AffineFold; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; compose(optic: Setter): Setter, A2>; prependTo(): Setter>, ElemType>; appendTo(): Setter>, ElemType>; } export interface Traversal { readonly _tag: 'Traversal'; readonly _removable: T['_R']; compose(optic: Equivalence): Traversal, A2>; compose(optic: Iso): Traversal, A2>; iso(there: (a: A) => U, back: (u: U) => A): Traversal>, U>; indexed(): Traversal, [number, ElemType][]>; compose(optic: Lens): Traversal, A2>; lens(view: (a: A) => U, update: (a: A, v: U) => A): Traversal>, U>; prop(key: K): Traversal>, A[K]>; path(path: K): Traversal>, DottedPath>; path(...path: K): Traversal>, TuplePath>; nth(n: N): Traversal>, Nth>; pick(keys: K[]): Traversal>, Pick>; filter>(predicate: (item: ElemType) => item is B): Traversal>, B[]>; filter(predicate: (item: ElemType) => boolean): Traversal>, A>; valueOr(defaultValue: B): Traversal, Exclude | B>; partsOf(traversal: Traversal): Traversal>, B[]>; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Traversal>, B[]>; reread(read: (value: A) => A): Traversal>, A>; rewrite(write: (value: A) => A): Traversal>, A>; compose(optic: Prism): Traversal, A2>; optional(): Traversal, Exclude>; guard_(): (g: (a: A) => a is U) => Traversal, U>; guard(g: (a: A) => a is U): Traversal>, U>; find(predicate: (item: ElemType) => boolean): Traversal, true>, ElemType>; when(predicate: (item: A) => boolean): Traversal>, A>; at(i: number): IfElse, Traversal, true>, string>, Traversal, true>, ElemType>>; head(): IfElse, Traversal, true>, string>, Traversal, true>, ElemType>>; index(i: number): IfElse, Traversal, true>, string>, Traversal, true>, ElemType>>; compose(optic: Traversal): Traversal, A2>; elems(): Traversal, ElemType>; chars(): RequireString>, string>>; words(): RequireString>, string>>; compose(optic: Getter): Fold; to(f: (a: A) => B): Fold; compose(optic: AffineFold): Fold; compose(optic: Fold): Fold; compose(optic: Setter): Setter, A2>; prependTo(): Setter>, ElemType>; appendTo(): Setter>, ElemType>; } export interface Getter { readonly _tag: 'Getter'; compose(optic: Equivalence): Getter; compose(optic: Iso): Getter; iso(there: (a: A) => U, back: (u: U) => A): Getter; indexed(): Getter][]>; compose(optic: Lens): Getter; lens(view: (a: A) => U, update: (a: A, v: U) => A): Getter; prop(key: K): Getter; path(path: K): Getter>; path(...path: K): Getter>; nth(n: N): Getter>; pick(keys: K[]): Getter>; filter>(predicate: (item: ElemType) => item is B): Getter; filter(predicate: (item: ElemType) => boolean): Getter; valueOr(defaultValue: B): Getter | B>; partsOf(traversal: Traversal): Getter; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Getter; reread(read: (value: A) => A): Getter; rewrite(write: (value: A) => A): Getter; compose(optic: Prism): AffineFold; optional(): AffineFold>; guard_(): (g: (a: A) => a is U) => AffineFold; guard(g: (a: A) => a is U): AffineFold; find(predicate: (item: ElemType) => boolean): AffineFold>; when(predicate: (item: A) => boolean): AffineFold; at(i: number): IfElse, AffineFold, AffineFold>>; head(): IfElse, AffineFold, AffineFold>>; index(i: number): IfElse, AffineFold, AffineFold>>; compose(optic: Traversal): Fold; elems(): Fold>; chars(): RequireString>; words(): RequireString>; compose(optic: Getter): Getter; to(f: (a: A) => B): Getter; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; } export interface AffineFold { readonly _tag: 'AffineFold'; compose(optic: Equivalence): AffineFold; compose(optic: Iso): AffineFold; iso(there: (a: A) => U, back: (u: U) => A): AffineFold; indexed(): AffineFold][]>; compose(optic: Lens): AffineFold; lens(view: (a: A) => U, update: (a: A, v: U) => A): AffineFold; prop(key: K): AffineFold; path(path: K): AffineFold>; path(...path: K): AffineFold>; nth(n: N): AffineFold>; pick(keys: K[]): AffineFold>; filter>(predicate: (item: ElemType) => item is B): AffineFold; filter(predicate: (item: ElemType) => boolean): AffineFold; valueOr(defaultValue: B): AffineFold | B>; partsOf(traversal: Traversal): AffineFold; partsOf(makeTraversal: (o: OpticFor_) => Traversal): AffineFold; reread(read: (value: A) => A): AffineFold; rewrite(write: (value: A) => A): AffineFold; compose(optic: Prism): AffineFold; optional(): AffineFold>; guard_(): (g: (a: A) => a is U) => AffineFold; guard(g: (a: A) => a is U): AffineFold; find(predicate: (item: ElemType) => boolean): AffineFold>; when(predicate: (item: A) => boolean): AffineFold; at(i: number): IfElse, AffineFold, AffineFold>>; head(): IfElse, AffineFold, AffineFold>>; index(i: number): IfElse, AffineFold, AffineFold>>; compose(optic: Traversal): Fold; elems(): Fold>; chars(): RequireString>; words(): RequireString>; compose(optic: Getter): AffineFold; to(f: (a: A) => B): AffineFold; compose(optic: AffineFold): AffineFold; compose(optic: Fold): Fold; } export interface Fold { readonly _tag: 'Fold'; compose(optic: Equivalence): Fold; compose(optic: Iso): Fold; iso(there: (a: A) => U, back: (u: U) => A): Fold; indexed(): Fold][]>; compose(optic: Lens): Fold; lens(view: (a: A) => U, update: (a: A, v: U) => A): Fold; prop(key: K): Fold; path(path: K): Fold>; path(...path: K): Fold>; nth(n: N): Fold>; pick(keys: K[]): Fold>; filter>(predicate: (item: ElemType) => item is B): Fold; filter(predicate: (item: ElemType) => boolean): Fold; valueOr(defaultValue: B): Fold | B>; partsOf(traversal: Traversal): Fold; partsOf(makeTraversal: (o: OpticFor_) => Traversal): Fold; reread(read: (value: A) => A): Fold; rewrite(write: (value: A) => A): Fold; compose(optic: Prism): Fold; optional(): Fold>; guard_(): (g: (a: A) => a is U) => Fold; guard(g: (a: A) => a is U): Fold; find(predicate: (item: ElemType) => boolean): Fold>; when(predicate: (item: A) => boolean): Fold; at(i: number): IfElse, Fold, Fold>>; head(): IfElse, Fold, Fold>>; index(i: number): IfElse, Fold, Fold>>; compose(optic: Traversal): Fold; elems(): Fold>; chars(): RequireString>; words(): RequireString>; compose(optic: Getter): Fold; to(f: (a: A) => B): Fold; compose(optic: AffineFold): Fold; compose(optic: Fold): Fold; } export interface Setter { readonly _tag: 'Setter'; readonly _removable: T['_R']; } export declare function compose(optic1: Equivalence, optic2: Equivalence): Equivalence, A2>; export declare function compose(optic1: Equivalence, optic2: Iso): Iso, A2>; export declare function compose(optic1: Equivalence, optic2: Lens): Lens, A2>; export declare function compose(optic1: Equivalence, optic2: Prism): Prism, A2>; export declare function compose(optic1: Equivalence, optic2: Traversal): Traversal, A2>; export declare function compose(optic1: Equivalence, optic2: Getter): Getter; export declare function compose(optic1: Equivalence, optic2: AffineFold): AffineFold; export declare function compose(optic1: Equivalence, optic2: Fold): Fold; export declare function compose(optic1: Equivalence, optic2: Setter): Setter, A2>; export declare function compose(optic1: Iso, optic2: Equivalence): Iso, A2>; export declare function compose(optic1: Iso, optic2: Iso): Iso, A2>; export declare function compose(optic1: Iso, optic2: Lens): Lens, A2>; export declare function compose(optic1: Iso, optic2: Prism): Prism, A2>; export declare function compose(optic1: Iso, optic2: Traversal): Traversal, A2>; export declare function compose(optic1: Iso, optic2: Getter): Getter; export declare function compose(optic1: Iso, optic2: AffineFold): AffineFold; export declare function compose(optic1: Iso, optic2: Fold): Fold; export declare function compose(optic1: Iso, optic2: Setter): Setter, A2>; export declare function compose(optic1: Lens, optic2: Equivalence): Lens, A2>; export declare function compose(optic1: Lens, optic2: Iso): Lens, A2>; export declare function compose(optic1: Lens, optic2: Lens): Lens, A2>; export declare function compose(optic1: Lens, optic2: Prism): Prism, A2>; export declare function compose(optic1: Lens, optic2: Traversal): Traversal, A2>; export declare function compose(optic1: Lens, optic2: Getter): Getter; export declare function compose(optic1: Lens, optic2: AffineFold): AffineFold; export declare function compose(optic1: Lens, optic2: Fold): Fold; export declare function compose(optic1: Lens, optic2: Setter): Setter, A2>; export declare function compose(optic1: Prism, optic2: Equivalence): Prism, A2>; export declare function compose(optic1: Prism, optic2: Iso): Prism, A2>; export declare function compose(optic1: Prism, optic2: Lens): Prism, A2>; export declare function compose(optic1: Prism, optic2: Prism): Prism, A2>; export declare function compose(optic1: Prism, optic2: Traversal): Traversal, A2>; export declare function compose(optic1: Prism, optic2: Getter): AffineFold; export declare function compose(optic1: Prism, optic2: AffineFold): AffineFold; export declare function compose(optic1: Prism, optic2: Fold): Fold; export declare function compose(optic1: Prism, optic2: Setter): Setter, A2>; export declare function compose(optic1: Traversal, optic2: Equivalence): Traversal, A2>; export declare function compose(optic1: Traversal, optic2: Iso): Traversal, A2>; export declare function compose(optic1: Traversal, optic2: Lens): Traversal, A2>; export declare function compose(optic1: Traversal, optic2: Prism): Traversal, A2>; export declare function compose(optic1: Traversal, optic2: Traversal): Traversal, A2>; export declare function compose(optic1: Traversal, optic2: Getter): Fold; export declare function compose(optic1: Traversal, optic2: AffineFold): Fold; export declare function compose(optic1: Traversal, optic2: Fold): Fold; export declare function compose(optic1: Traversal, optic2: Setter): Setter, A2>; export declare function compose(optic1: Getter, optic2: Equivalence): Getter; export declare function compose(optic1: Getter, optic2: Iso): Getter; export declare function compose(optic1: Getter, optic2: Lens): Getter; export declare function compose(optic1: Getter, optic2: Prism): AffineFold; export declare function compose(optic1: Getter, optic2: Traversal): Fold; export declare function compose(optic1: Getter, optic2: Getter): Getter; export declare function compose(optic1: Getter, optic2: AffineFold): AffineFold; export declare function compose(optic1: Getter, optic2: Fold): Fold; export declare function compose(optic1: AffineFold, optic2: Equivalence): AffineFold; export declare function compose(optic1: AffineFold, optic2: Iso): AffineFold; export declare function compose(optic1: AffineFold, optic2: Lens): AffineFold; export declare function compose(optic1: AffineFold, optic2: Prism): AffineFold; export declare function compose(optic1: AffineFold, optic2: Traversal): Fold; export declare function compose(optic1: AffineFold, optic2: Getter): AffineFold; export declare function compose(optic1: AffineFold, optic2: AffineFold): AffineFold; export declare function compose(optic1: AffineFold, optic2: Fold): Fold; export declare function compose(optic1: Fold, optic2: Equivalence): Fold; export declare function compose(optic1: Fold, optic2: Iso): Fold; export declare function compose(optic1: Fold, optic2: Lens): Fold; export declare function compose(optic1: Fold, optic2: Prism): Fold; export declare function compose(optic1: Fold, optic2: Traversal): Fold; export declare function compose(optic1: Fold, optic2: Getter): Fold; export declare function compose(optic1: Fold, optic2: AffineFold): Fold; export declare function compose(optic1: Fold, optic2: Fold): Fold; export declare function optic(): OpticFor; export declare function optic_(): OpticFor_; export declare function get(optic: Equivalence | Iso | Lens | Getter): (source: S) => A; export declare function preview(optic: Prism | Traversal | AffineFold | Fold): (source: S) => A | undefined; export declare function collect(optic: Prism | Traversal | Fold): (source: S) => A[]; export declare function modify(optic: Equivalence | Iso | Lens | Prism | Traversal): (f: (a: A) => B) => (source: S) => Simplify>; export declare function set(optic: Equivalence | Iso | Lens | Prism | Traversal | Setter): (value: B) => (source: S) => Simplify>; export declare function remove(optic: Prism, any> | Traversal, any>): (source: S) => S; export { pipe } from './standalone/pipe.js';