import type { Atom, AtomSelector } from './types.js'; /** * @description This is the recommended hook to use when a component intends to read computed state. * Using this hook in a React component will subscribe the component to re-render when the computed * state is updated. * * @returns The computed value of the given atom state. * * @example * * // Somewhere outside the component, for example, next to the declaration of the atom: * const selectPlus = (value) => value + 1; * * // In the component: * const plus = useAtomSelector(counterAtom, selectPlus); * * @noinline */ export declare const useAtomSelector: (atom: Atom, selector: AtomSelector) => S; /** * @description This is the recommended hook to use when a component intends to read state * without writing to it. Using this hook in a React component will subscribe the component * to re-render when the state is updated. * * @returns The value of the given atom state. * * @example * * const counter = useAtomValue(counterAtom); * * @nosideeffects */ export declare const useAtomValue: (atom: Atom) => T; /** * @description This is the recommended hook to use when a component intends to write to * state without reading it. Allows a component to set the value without subscribing the * component to re-render when the value changes. * * @returns A setter function for updating the value of atom state. * * @example * * const setCounter = useSetAtomState(counterAtom); * * @nosideeffects */ export declare const useSetAtomState: (atom: Atom) => import("./types.js").AtomSetter; /** * @description This is the recommended hook to use when a component intends to read and * write state. Using this hook in a React component will subscribe the component * to re-render when the state is updated. * * @returns A tuple where the first element is the value of state and the second element * is a setter function that will update the value of the given state when called. * * @example * * const [counter, setCounter] = useAtomState(counterAtom); * * @nosideeffects */ export declare const useAtomState: (atom: Atom) => readonly [T, import("./types.js").AtomSetter]; /** * @description Using this hook allows a component to reset the state to its default value without * subscribing the component to re-render whenever the state changes. * * @returns A function that will reset the value of the given state to its default value. * * @example * * const resetCounter = useResetAtomState(counterAtom); * * @nosideeffects */ export declare const useResetAtomState: (atom: Atom) => () => T; /** * @description This is the recommended hook to use when a component intends to read computed state * only on first render. Using this hook in a React component will **NOT** subscribe the component * to re-render when the state is updated. * * @returns The value of the given atom state. * * @example * * const counter = useAtomConst(counterAtom); * * @nosideeffects */ export declare const useAtomConst: (atom: Atom) => T; /** * @description This is the recommended hook to use when a component intends to read state * only on first render. Using this hook in a React component will **NOT** subscribe the component * to re-render when the state is updated. * * @returns The computed value of the given atom state. * * @example * * const plus = useAtomSelectorConst(counterAtom, (value) => value + 1); * * @nosideeffects */ export declare const useAtomSelectorConst: (atom: Atom, selector: AtomSelector) => S;