3.1.10 • Published 1 month ago

@types/redux-state-sync v3.1.10

Weekly downloads
2,244
License
MIT
Repository
github
Last release
1 month ago

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

// Type definitions for redux-state-sync 3.1
// Project: https://github.com/AOHUA/redux-state-sync#readme
// Definitions by: MU AOHUA <https://github.com/AOHUA>
//                 AntonioMendez <https://github.com/AntonioMendez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4

import { Store, Reducer, Middleware, AnyAction } from "redux";
import BroadcastChannel, { BroadcastChannelOptions } from "broadcast-channel";

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;
}

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?: (state: any) => any,
): T;
export function initStateWithPrevTab(store: Store): Store;
export function initMessageListener(store: Store): Store;
export function isActionSynced(action: AnyAction): boolean;

Additional Details

Credits

These definitions were written by MU AOHUA, and AntonioMendez.

3.1.10

1 month ago

3.1.7

7 months ago

3.1.6

8 months ago

3.1.9

6 months ago

3.1.8

7 months ago

3.1.5

2 years ago

3.1.4

2 years ago

3.1.3

2 years ago

3.1.2

3 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

5 years ago