# @types/redux-state-sync

> TypeScript definitions for redux-state-sync

Latest version **3.1.10** (published 2024-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/redux-state-sync
pnpm add @types/redux-state-sync
yarn add @types/redux-state-sync
bun add @types/redux-state-sync
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.1.10 |
| Published | 2024-04-03 |
| First published | 2019-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51448 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/redux-state-sync
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-state-sync
- npm.io page: https://npm.io/package/@types/redux-state-sync

## Dependencies (2)

- [redux](https://npm.io/package/redux.md) ^4.0.1
- [broadcast-channel](https://npm.io/package/broadcast-channel.md) ^2.1.8

## Recent versions

- 3.1.10 (latest) — 2024-04-03
- 3.1.9 (ts4.5) — 2023-11-07
- 3.1.5 (ts4.1) — 2022-09-24
- 3.1.3 (ts3.9) — 2022-05-18
- 3.1.2 (ts3.6) — 2021-07-08
- 3.1.1 (ts3.0) — 2020-08-01
- 3.1.0 (ts2.8) — 2020-03-10
- 2.0.0 (ts2.4) — 2019-01-31
- 3.1.8 — 2023-10-18
- 3.1.7 — 2023-10-10
- 3.1.6 — 2023-09-27
- 3.1.4 — 2022-09-20
- 3.0.1 — 2020-01-28
- 3.0.0 — 2019-12-26

## README

# Installation
> `npm install --save @types/redux-state-sync`

# Summary
This package contains type definitions for redux-state-sync (https://github.com/AOHUA/redux-state-sync#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-state-sync.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-state-sync/index.d.ts)
````ts
import BroadcastChannel, { BroadcastChannelOptions } from "broadcast-channel";
import { AnyAction, Middleware, Reducer, Store } from "redux";

export const GET_INIT_STATE = "&_GET_INIT_STATE";
export const SEND_INIT_STATE = "&_SEND_INIT_STATE";
export const RECEIVE_INIT_STATE = "&_RECEIVE_INIT_STATE";
export const INIT_MESSAGE_LISTENER = "&_INIT_MESSAGE_LISTENER";
export const WINDOW_STATE_SYNC_ID: string;

export interface Stamp {
    $uuid: string;
    $wuid: string;
    $isSync: boolean;
}
export type StampedAction = Stamp & AnyAction;

export interface Config {
    channel?: string | undefined;
    predicate?: ((action: AnyAction) => boolean | null) | undefined;
    blacklist?: string[] | undefined;
    whitelist?: string[] | undefined;
    broadcastChannelOption?: BroadcastChannelOptions | undefined;
    prepareState?: ((state: any) => any) | undefined;
    receiveState?: ((prevState: any, nextState: any) => any) | undefined;
}

export interface MessageListenerConfig {
    channel: BroadcastChannel;
    dispatch: (action: AnyAction | StampedAction) => void;
    allowed: (action: AnyAction) => boolean;
}

export function generateUuidForAction(action: AnyAction): StampedAction;
export function isActionAllowed(config: Config): (type: string) => boolean;
export function createMessageListener(config: MessageListenerConfig): void;
export function createStateSyncMiddleware(config?: Config): Middleware;
export function withReduxStateSync<T extends Reducer>(
    appReducer: T,
    prepareInitialStateForStore?: Config["receiveState"],
): T;
export function initStateWithPrevTab(store: Store): Store;
export function initMessageListener(store: Store): Store;
export function isActionSynced(action: AnyAction): boolean;

/** @deprecated Undocumented alias to withReduxStateSync */
export const createReduxStateSync: typeof withReduxStateSync;

````

### Additional Details
 * Last updated: Wed, 03 Apr 2024 18:35:48 GMT
 * Dependencies: [broadcast-channel](https://npmjs.com/package/broadcast-channel), [redux](https://npmjs.com/package/redux)

# Credits
These definitions were written by [MU AOHUA](https://github.com/AOHUA).

---
_Source: https://npm.io/package/@types/redux-state-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
