UNPKG

704 BTypeScriptView Raw
1import { SECRET_INTERNAL_getScopeContext as getScopeContext } from 'jotai';
2import type { Atom } from '../core/atom';
3type Scope = NonNullable<Parameters<typeof getScopeContext>[0]>;
4type AnyAtomValue = unknown;
5type AnyAtom = Atom<AnyAtomValue>;
6type AtomsValues = Map<AnyAtom, AnyAtomValue>;
7type AtomsDependents = Map<AnyAtom, Set<AnyAtom>>;
8type AtomsSnapshot = Readonly<{
9 values: AtomsValues;
10 dependents: AtomsDependents;
11}>;
12/**
13 * @deprecated use object snapshot instead
14 */
15type DeprecatedIterableSnapshot = Iterable<readonly [AnyAtom, AnyAtomValue]>;
16export declare function useGotoAtomsSnapshot(scope?: Scope): (snapshot: AtomsSnapshot | DeprecatedIterableSnapshot) => void;
17export {};