export interface partial { partial: 'partial'; } export interface mapped { map: 'map'; } export type readOnly = { readOnly: true; }; export type Modifiers = Partial; export interface Lens { get: (s: S) => A; set: (a: A, s: S) => S; key?: string; type?: 'fold' | 'map' | 'partial' | 'unstable'; } export type TotalLens = Omit, 'type'>; export interface PartialLens { get: (s: S) => A | undefined; set: (a: A, s: S) => S; type: 'partial'; key?: string; } type StrictMode = null extends string ? false : true; export type IsNullable = StrictMode extends false ? false : null extends T ? true : undefined extends T ? true : false; export type ComposeModifiers = TModifiersA & TModifiersB & (IsNullable extends true ? partial : {}) extends infer Final extends Modifiers ? Final : never; export type Prettify = { [K in keyof T]: T[K]; } & {}; export type FocusedValue = Pick extends mapped ? T[] : Pick extends partial ? T | undefined : T; export {};