3.1.10 • Published 1 month ago
@types/redux-state-sync v3.1.10
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
- Last updated: Wed, 18 May 2022 20:31:37 GMT
- Dependencies: @types/redux, @types/broadcast-channel
- Global values: none
Credits
These definitions were written by MU AOHUA, and AntonioMendez.