Installation
npm install --save @types/redux-shortcuts
Summary
This package contains type definitions for redux-shortcuts (https://github.com/nak2k/node-redux-shortcuts).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-shortcuts.
index.d.ts
import { Action, ActionCreator, Dispatch } from "redux";
import Mousetrap = require("mousetrap");
import "mousetrap/extensions/global";
export { Mousetrap };
export const mousetrap: Mousetrap.MousetrapInstance;
export function bindShortcut(
keys: KeyBindings,
actionCreator: ActionBindings,
preventDefault?: boolean,
): (dispatch: Dispatch<any>) => void;
export function bindShortcuts(
...shortcut: ShortcutDefinition[]
): (dispatch: Dispatch<any>) => void;
export type KeyBindings = string | string[];
export type ActionBindings =
| ActionCreator<Action>
| Array<ActionCreator<Action>>;
export type ShortcutDefinition =
| BasicShortcutDefinition
| ShortcutDefinitionWithPreventDefault;
export type BasicShortcutDefinition = [KeyBindings, ActionBindings];
export type ShortcutDefinitionWithPreventDefault = [
KeyBindings,
ActionBindings,
boolean,
];
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: @types/mousetrap, redux
Credits
These definitions were written by Tim Stirrat.