1 | import React from 'react';
|
2 | import { Atom, WritableAtom, AnyAtom } from './types';
|
3 | export declare type AtomState<Value = unknown> = {
|
4 | readE?: Error;
|
5 | readP?: Promise<void>;
|
6 | writeP?: Promise<void>;
|
7 | value: Value;
|
8 | };
|
9 | declare type State = Map<AnyAtom, AtomState>;
|
10 | export declare type Actions = {
|
11 | add: <Value>(id: symbol, atom: Atom<Value>) => void;
|
12 | del: (id: symbol) => void;
|
13 | read: <Value>(state: State, atom: Atom<Value>) => AtomState<Value>;
|
14 | write: <Value, Update>(atom: WritableAtom<Value, Update>, update: Update) => void | Promise<void>;
|
15 | };
|
16 | export declare const ActionsContext: React.Context<Actions>;
|
17 | export declare const StateContext: React.Context<State>;
|
18 | export declare const Provider: React.FC;
|
19 | export {};
|