react-native-onyx
Version:
State management for React Native
26 lines (25 loc) • 1.02 kB
TypeScript
import type { IDevTools, DevtoolsOptions, DevtoolsConnection } from './types';
/**
* Real implementation of DevTools that connects to Redux DevTools Extension
*/
declare class RealDevTools implements IDevTools {
private remoteDev?;
private state;
private defaultState;
constructor();
connectViaExtension(options?: DevtoolsOptions): DevtoolsConnection | undefined;
/**
* Registers an action that updated the current state of the storage
*
* @param type - name of the action
* @param payload - data written to the storage
* @param stateChanges - partial state that got updated after the changes
*/
registerAction(type: string, payload: unknown, stateChanges?: Record<string, unknown> | null): void;
initState(initialState?: Record<string, unknown>): void;
/**
* This clears the internal state of the DevTools, preserving the keys included in `keysToPreserve`
*/
clearState(keysToPreserve?: string[]): void;
}
export default RealDevTools;