import type { DispatchBand, FluxDispatcher as Dispatcher } from "./fluxDispatcher"; type DispatchToken = string; type ActionType = string; interface Action { type: ActionType; } export type ActionHandler = (action: A) => boolean | void; export type ActionHandlerRecord = { [A in ActionType]: ActionHandler<{ type: A; [key: string]: any; }>; }; export declare class Emitter { static changeSentinel: number; static changedStores: Set; static isBatchEmitting: boolean; static isDispatching: boolean; static isPaused: boolean; static pauseTimer: ReturnType | undefined; static reactChangedStores: Set; batched(func: () => void): void; destroy(): void; emit(): void; emitReactOnce(): void; emitNonReactOnce(callbacks: Set<() => boolean>, stores: Set): void; getChangeSentinel(): number; getIsPaused(): boolean; injectBatchEmitChanges(func: () => void): void; markChanged(store: Store): void; pause(timeout?: number): void; resume(shouldEmit?: boolean): void; } type Callback = () => void; declare class ChangeListeners { listeners: Set; add(listener: Callback): void; remove(listener: Callback): void; addConditional(listener: Callback, condition: boolean): void; has(listener: Callback): boolean; hasAny(): boolean; invokeAll(): void; } interface SyncWiths { func: () => boolean; store: Store; } export declare class Store { constructor(dispatcher: Dispatcher, actionHandler?: ActionHandlerRecord, band?: DispatchBand); static destroy(): void; static getAll(): Store[]; static initialize(): void; static initialized: Promise; _isInitialized: boolean; _dispatchToken: DispatchToken; _dispatcher: Dispatcher; _syncWiths: SyncWiths[]; _changeCallbacks: ChangeListeners; _reactChangeCallbacks: ChangeListeners; _mustEmitChanges: Parameters[0]; initialize(): void; initializeIfNeeded(): void; getDispatchToken(): DispatchToken; getName(): string; emitChange(): void; mustEmitChanges(actionHandler?: ActionHandler): void; syncWith(stores: Store[], callback: () => boolean, timeout?: number): void; waitFor(...stores: Store[]): void; addChangeListener(listener: Callback): void; addConditionalChangeListener(listener: Callback, condition: boolean): void; addReactChangeListener(listener: Callback): void; removeChangeListener(listener: Callback): void; removeReactChangeListener(listener: Callback): void; registerActionHandlers(actionHandlers: ActionHandlerRecord, band?: DispatchBand): void; __getLocalVars?(): Record; } interface ClearOptions { omit?: string[]; type: "all" | "user-data-only"; } type State = Record; type States = Record; type Migration = () => void; export declare class PersistedStore extends Store { static allPersistKeys: Set; static clearAll(options: ClearOptions): Promise; static clearPersistQueue(options: ClearOptions): void; static destroy(): void; static disableWrite: boolean; static disableWrites: boolean; static getAllStates(): States; static initializeAll(states: States): void; static migrateAndReadStoreState(persistKey: string, migrations: Migration[] | undefined): { state: State; requiresPersist: boolean; }; static shouldClear(options: ClearOptions, persistKey: string): boolean; static throttleDelay: number; static userAgnosticPersistKeys: Set; static _writePromises: Map; static _writeResolvers: Map; asyncPersist(): Promise; clear(): void; getClass(): any; initializeFromState(state: any): void; initializeIfNeeded(): void; persist(): void; } export type DeviceSettingsStore = typeof PersistedStore; export type OfflineCacheStore = typeof PersistedStore; export interface FluxMod { DeviceSettingsStore: DeviceSettingsStore; Emitter: Emitter; OfflineCacheStore: OfflineCacheStore; PersistedStore: typeof PersistedStore; Store: typeof Store; connectStores(stores: Store[], callback: (props: OuterProps) => InnerProps, options?: { forwardRef: boolean; }): (component: React.ComponentType) => React.ComponentClass; destroy(): void; initialize(): void; get initialized(): Promise; } interface Snapshot { data: Data; version: number; } export declare class SnapshotStore> extends Store { static allStores: SnapshotStore[]; static clearAll: () => void; get persistKey(): string; clear: () => void; getClass: () => any; readSnapshot: (version: number) => Snapshot["data"] | null; save: () => void; } declare const _default: { useStateFromStores: (stores: Store[], callback: () => T, deps?: React.DependencyList, compare?: ((a: T_1, b: T_1) => boolean) | (>(a: T_1, b: T_1) => boolean)) => T; statesWillNeverBeEqual: (a: T, b: T) => boolean; useStateFromStoresArray: (stores: Store[], callback: () => T, deps?: React.DependencyList) => T; useStateFromStoresObject: (stores: Store[], callback: () => T, deps?: React.DependencyList) => T; SnapshotStore: typeof SnapshotStore; DeviceSettingsStore: DeviceSettingsStore; Emitter: Emitter; OfflineCacheStore: OfflineCacheStore; PersistedStore: typeof PersistedStore; Store: typeof Store; connectStores(stores: Store[], callback: (props: OuterProps) => InnerProps, options?: { forwardRef: boolean; }): (component: React.ComponentType) => React.ComponentClass; destroy(): void; initialize(): void; initialized: Promise; }; export default _default;