export interface DevToolsConfig { name?: string; maxAge?: number; serialize?: boolean | { replacer?: (key: string, value: unknown) => unknown; }; actionsDenylist?: string[]; actionsAllowlist?: string[]; features?: { pause?: boolean; lock?: boolean; persist?: boolean; export?: boolean | 'custom'; import?: boolean | 'custom'; jump?: boolean; skip?: boolean; reorder?: boolean; dispatch?: boolean; test?: boolean; }; trace?: boolean; traceLimit?: number; /** * Arrays longer than this are replaced in the snapshot with a compact * `$summary` marker instead of dumping every element. Default `50`. */ maxArrayItems?: number; /** * Rough byte budget for a single cell value. Strings / objects / nested * arrays whose estimated size exceeds this are summarized. Default `8192`. */ maxValueBytes?: number; /** Nesting depth past which a value is treated as too big. Default `4`. */ maxValueDepth?: number; /** * Path globs/prefixes whose cells are excluded from the snapshot AND the * action timeline entirely — for high-frequency / noisy cells (in the spirit * of `actionsDenylist`). `*` matches any run of characters; a prefix matches * any deeper path. E.g. `["*.animationFrame", "Benchmark#*._items"]`. */ cellsDenylist?: string[]; } /** Action shape we send to the monitor. */ export interface DevToolsAction { type: string; [key: string]: unknown; } /** A message delivered to the `connect()` subscriber (e.g. on time-travel). */ export interface DevToolsMessage { type: string; payload?: { type?: string; [key: string]: unknown; }; state?: string; } /** The object returned by `__REDUX_DEVTOOLS_EXTENSION__.connect(config)`. */ export interface DevToolsConnection { init(state: unknown): void; send(action: DevToolsAction | null, state: unknown): void; subscribe(listener: (message: DevToolsMessage) => void): (() => void) | void; unsubscribe(): void; error(message: string): void; } /** The extension global: an enhancer factory that also carries `connect`. */ export interface ReduxDevToolsExtension { (config?: DevToolsConfig): (createStore: any) => any; connect(config?: DevToolsConfig): DevToolsConnection; disconnect?: () => void; } declare global { interface Window { __REDUX_DEVTOOLS_EXTENSION__?: ReduxDevToolsExtension; } } /** Whether the integration is currently restoring cell state (time-travel). */ export declare function isDevToolsRestoring(): boolean; type AnyObj = Record; /** Public snapshot of the whole reactive tree (used by `createCellState`). */ export declare function snapshotState(): AnyObj; /** * Restore reactive state from a previously snapshotted tree-shaped object * (time-travel — backward OR forward). Navigates the nested state in parallel * with the LIVE component tree, matching nodes by their stable `#` label, and * applies each leaf via `applyCellUpdateSync` (synchronous re-render, no * re-dispatch). The `isRestoringState` guard neutralises any synchronous * write-back a subscriber might perform. * * Entries whose component is no longer live are skipped (you cannot restore a * destroyed component's cells); live nodes absent from the target state are left * untouched. Stable across a session as long as component ids are stable. */ export declare function restoreState(state: AnyObj | null | undefined): void; /** Dev-only introspection for the leak test: count of cells buffered for the * next flush. The integration retains nothing else across snapshots. */ export declare function devtoolsPendingCount(): number; /** * Connect gxt's reactive state to the Redux DevTools extension. * * Opt-in, dev-only, browser-only. Returns a disabler that disconnects the * integration and removes the cell-update hook. Safe to call when the extension * is absent, in SSR, or in production — it simply returns a no-op disabler. * * @example * import { enableReduxDevtools } from '@lifeart/gxt'; * if (IS_DEV_MODE) enableReduxDevtools(); */ export declare function enableReduxDevtools(config?: DevToolsConfig): () => void; /** * Disconnect the DevTools integration and remove the cell-update hook. Fully * detaches with zero residue: the notifier, the coalescing buffers, the * subscription, the connection and the committed baseline are all cleared. */ export declare function disableReduxDevtools(): void; export interface FreezerState { get(): Record; set(state: any): void; skipDispatch: number; trigger(eventName: string, ...args: unknown[]): void; on(eventName: string, callback: (this: FreezerState, reactionName: string, ...args: unknown[]) => void): void; } /** * A `FreezerState` backed by gxt cells — read tree-shaped snapshots via * `snapshotState`, write restores through `restoreState`. Use with * `supportChromeExtension` for the enhancer-based transport. */ export declare function createCellState(): FreezerState; /** * Redux middleware that makes a `FreezerState` and the DevTools talk to each * other (faithful port of the freezer-redux-devtools middleware). */ export declare function FreezerMiddleware(State: FreezerState): (next: any) => (_someReducer: any, _someState: any) => any; /** * Bind a `FreezerState` to the Redux DevTools extension via the enhancer API. */ export declare function supportChromeExtension(State: FreezerState, config?: DevToolsConfig): any; export {};