1 | import type { Atom, WritableAtom } from 'jotai';
|
2 | type Getter = Parameters<Atom<unknown>['read']>[0];
|
3 | type WriteGetter = Parameters<WritableAtom<unknown, unknown>['write']>[0];
|
4 | type Setter = Parameters<WritableAtom<unknown, unknown>['write']>[1];
|
5 | type Read<Value> = (get: Getter, options: {
|
6 | signal: AbortSignal;
|
7 | }) => Value;
|
8 | type Write<Update, Result extends void | Promise<void>> = (get: WriteGetter, set: Setter, update: Update) => Result;
|
9 | export declare function abortableAtom<Value, Update, Result extends void | Promise<void> = void>(read: Read<Value>, write: Write<Update, Result>): WritableAtom<Value, Update, Result>;
|
10 | export declare function abortableAtom<Value>(read: Read<Value>): Atom<Value>;
|
11 | export {};
|