1 | import type { Atom, PrimitiveAtom, WritableAtom } from 'jotai';
|
2 | type SplitAtomAction<Item> = {
|
3 | type: 'remove';
|
4 | atom: PrimitiveAtom<Item>;
|
5 | } | {
|
6 | type: 'insert';
|
7 | value: Item;
|
8 | before?: PrimitiveAtom<Item>;
|
9 | } | {
|
10 | type: 'move';
|
11 | atom: PrimitiveAtom<Item>;
|
12 | before?: PrimitiveAtom<Item>;
|
13 | };
|
14 | type DeprecatedAtomToRemove<Item> = PrimitiveAtom<Item>;
|
15 | export declare function splitAtom<Item, Key>(arrAtom: WritableAtom<Item[], Item[]>, keyExtractor?: (item: Item) => Key): WritableAtom<PrimitiveAtom<Item>[], SplitAtomAction<Item> | DeprecatedAtomToRemove<Item>>;
|
16 | export declare function splitAtom<Item, Key>(arrAtom: Atom<Item[]>, keyExtractor?: (item: Item) => Key): Atom<Atom<Item>[]>;
|
17 | export {};
|