0.0.21 • Published 6 months ago

@types/redux-ui v0.0.21

Weekly downloads
244
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/redux-ui

Summary

This package contains type definitions for redux-ui (https://github.com/tonyhb/redux-ui).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-ui.

index.d.ts

// Type definitions for redux-ui 0.0
// Project: https://github.com/tonyhb/redux-ui
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

/// <reference types="react" />
import * as Redux from 'redux';

export interface uiParams<UIStateShape> {
  // optional key which is used to determine the UI path in which state will
  // be stored. if omitted this is randomly generated.
  key?: string | undefined;

  // optional persist, defaults to false. if set to true persist will keep UI
  // state for this component after it unmounts. if set to false the UI state
  // will be deleted and recreated when the component remounts
  persist?: boolean | undefined;

  // **required**: UI state for the component
  state: UIStateShape;

  // customReducer: you can handle the UI state for this component's scope
  // by dispatching actions
  reducer?(state: any, action: any): any;

  // optional mergeProps passed to react-redux' @connect
  mergeProps?(stateProps: any, dispatchProps: any, ownProps: any): any;

  // optional `options` passed to react-redux @connect
  options?: {
    pure?: boolean | undefined;
    withRef?: boolean | undefined;
  } | undefined;
}

export interface ReduxUIProps<UIStateShape> {
  // The key passed to the decorator from the decorator
  // (eg. 'some-decorator' with `@ui('some-decorator')`
  uiKey: string;

  // The UI state for the component's `uiKey`
  ui: UIStateShape;

  // A function accepting either a name/value pair or object which updates
  // state within `uiKey`
  updateUI(obj: UIStateShape): void;
  updateUI(key: string, value: any): void;

  // A function which resets the state within `uiKey` to its default
  resetUI(): void;
}

export const reducer: Redux.Reducer<any>;

export default function ui<UIStateShape>(params?: uiParams<UIStateShape>): <T>(component: T) => T;

Additional Details

Credits

These definitions were written by DefinitelyTyped.

0.0.20

7 months ago

0.0.21

6 months ago

0.0.19

7 months ago

0.0.18

2 years ago

0.0.17

3 years ago

0.0.16

4 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago