UNPKG

653 BTypeScriptView Raw
1import * as O from 'optics-ts';
2import type { WritableAtom, SetStateAction, PrimitiveAtom } from '../core/types';
3export declare function focusAtom<S, A>(atom: PrimitiveAtom<S>, callback: (optic: O.OpticFor<S>) => O.Prism<S, any, A>): WritableAtom<A | undefined, SetStateAction<A>>;
4export declare function focusAtom<S, A>(atom: PrimitiveAtom<S>, callback: (optic: O.OpticFor<S>) => O.Traversal<S, any, A>): WritableAtom<Array<A>, SetStateAction<A>>;
5export declare function focusAtom<S, A>(atom: PrimitiveAtom<S>, callback: (optic: O.OpticFor<S>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<A, SetStateAction<A>>;