@zubridge/electron
Version:
A streamlined state management library for Electron applications using Zustand.
21 lines (20 loc) • 919 B
TypeScript
import type { StateManager, AnyState } from '@zubridge/types';
import type { Store } from 'redux';
import type { StoreApi } from 'zustand/vanilla';
import { ZustandOptions } from '../adapters/zustand.js';
import { ReduxOptions } from '../adapters/redux.js';
/**
* Gets a state manager for the given store, creating one if it doesn't exist
* @internal This is used by createDispatch and createCoreBridge
*/
export declare function getStateManager<S extends AnyState>(store: StoreApi<S> | Store<S>, options?: ZustandOptions<S> | ReduxOptions<S>): StateManager<S>;
/**
* Removes a state manager from the registry
* Useful when cleaning up to prevent memory leaks in long-running applications
*/
export declare function removeStateManager(store: StoreApi<any> | Store<any>): void;
/**
* Clears all state managers from the registry
* Mainly useful for testing
*/
export declare function clearStateManagers(): void;