import * as React from 'react'; import { ORIGINAL, PATH } from './constants'; /** * Define the shape of your store in your project - see README.md */ export interface Store { } /** * Extend or intersect component `props` with `WithStoreProp` * when using `connect` */ export interface WithStoreProp { store: Store; } export interface CollectorComponent extends React.Component { update(): void; _name: string; } export declare type AfterChangeEvent = { /** The store props that changed */ changedProps: string[]; /** The store, after the change occurred */ store: Store; /** Components updated as a result of the change */ renderedComponents: CollectorComponent[]; }; /** * The internal state of Recollect. For internal/debugging use only. */ export declare type State = { currentComponent: CollectorComponent | null; isBatchUpdating: boolean; isInBrowser: boolean; listeners: Map>; manualListeners: ((e: AfterChangeEvent) => void)[]; /** Records the next version of any target */ nextVersionMap: WeakMap; proxyIsMuted: boolean; /** Usually true, this will redirect reads to the latest version of the store */ redirectToNext: boolean; store: Store; }; export declare type PropPath = any[]; export declare type UpdateInStoreProps = { target: Target; prop?: any; notifyTarget?: boolean; value?: any; /** The updater must return the result of Reflect for the active trap */ updater: (target: Target, value: any) => any; }; export declare type UpdateInStore = { (props: UpdateInStoreProps): any; }; /** * All proxyable objects have these shared keys. */ interface SharedBase { [PATH]?: PropPath; [ORIGINAL]?: T; [p: string]: any; [p: number]: any; } export declare type ObjWithSymbols = SharedBase & object; export declare type ArrWithSymbols = SharedBase & any[]; export declare type MapWithSymbols = SharedBase & Map; export declare type SetWithSymbols = SharedBase & Set; /** * A Target is any item that can be proxied */ export declare type Target = ObjWithSymbols | ArrWithSymbols | MapWithSymbols | SetWithSymbols; export {};