UNPKG

731 BTypeScriptView Raw
1import type { Context } from 'react';
2import type { Atom } from './atom';
3import { createStoreForExport } from './store';
4import type { Store } from './store';
5type Scope = symbol | string | number;
6type VersionedWrite = (write: (version?: object) => void) => void;
7type RetryFromError = (fn: () => void) => void;
8export interface ScopeContainer {
9 s: Store;
10 w?: VersionedWrite;
11 v?: object;
12 r?: RetryFromError;
13}
14export declare const createScopeContainer: (initialValues?: Iterable<readonly [Atom<unknown>, unknown]>, unstable_createStore?: typeof createStoreForExport) => ScopeContainer;
15type ScopeContext = Context<ScopeContainer>;
16export declare const getScopeContext: (scope?: Scope) => ScopeContext;
17export {};