mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
744 B
TypeScript
20 lines
744 B
TypeScript
// Type definitions for redux-socket.io 1.4
|
|
// Project: https://github.com/itaylor/redux-socket.io#readme
|
|
// Definitions by: Igor Voropaev <https://github.com/snakeego>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="socket.io-client" />
|
|
|
|
import { Middleware, Action, Dispatch } from 'redux';
|
|
|
|
export interface MiddlewareOptions {
|
|
eventName?: string;
|
|
execute?: <S>(action: Action, emitBound: SocketIOClient.Socket, next: Dispatch<S>, dispatch: Dispatch<S>) => any;
|
|
}
|
|
|
|
export default function createSocketIoMiddleware(
|
|
socket: SocketIOClient.Socket,
|
|
criteria: (string | ReadonlyArray<string> | ((type: string, action: Action) => boolean)),
|
|
options?: MiddlewareOptions
|
|
): Middleware;
|