import * as React from 'react'; import { Dispatch, Action } from 'redux'; import { ParametricSelector } from 'reselect'; /** * A string or a function accepting the props as an argument and returning a string */ export declare type IdFunction = (props: TProps) => string; export declare type Id = string | IdFunction; /** * A type guard guaranteeing id is a string; */ export declare const idIsString: (id: Id) => id is string; /** * A type guard guaranteeing id is a function that accepts props and returns a string */ export declare const idIsFunction: (id: Id) => id is IdFunction; /** * Returns a string or undefined from the union type of (string | function that returns string) */ export declare const getStringFromId: (id: Id, props: TProps) => string | undefined; /** * The default shape of a store containing the uiState reducer */ export interface DefaultStoreState { ui: UIStateBranch; } /** * The branch of the Redux store governed by reduxUIState's reducer */ export declare type UIStateBranch = Record; /** * The state props passed into a component wrapped by addReduxUIState */ export interface StateProps { uiState: TUIState; } /** * The dispatch props passed into a component wrapped by addReduxUIState */ export interface DispatchProps { setUIState: (state: Partial) => void; } /** * All the props props passed into a component wrapped by addReduxUIState */ export declare type Props = StateProps & DispatchProps; /** * The component passed into addReduxUIState */ export declare type AbstractWrappedComponent = React.StatelessComponent | React.ComponentClass; /** * A component being passed into addReduxUIState that accepts the default props */ export declare type WrappedComponentWithDefaultProps = AbstractWrappedComponent>; /** * A component being passed into addReduxUIState that accepts mapped props */ export declare type WrappedComponentWithMappedProps = AbstractWrappedComponent; /** * A Selector that accepts the full application state and returns the Redux UI State branch */ export interface UIStateBranchSelector extends ParametricSelector { (appState: TAppState): UIStateBranch; } /** * The props representing the key of the UI state data in the store */ export interface UIStateIdProps { uiStateId: Id; } /** * The function used to make changes to the state */ export declare type SetUIState = (state: Partial) => void; export declare const DEFAULT_BRANCH_NAME = "ui"; export declare const UNDEFINED_KEY = "REDUX_UI_STATE_UNDEFINED_KEY"; export declare const stateSelector: (state: TAppState) => TAppState; export declare const propsSelector: (_: any, props: TProps) => TProps; /** * Selects the ui state branch from the default location in the Redux store */ export declare const defaultUIStateBranchSelector: UIStateBranchSelector; /** * The props containing the selector for the uiState branch. */ export interface UIStateBranchSelectorSelectorProps { uiStateBranchSelector?: UIStateBranchSelector; } /** * Selects the uiState branch selector, returning defaultUIStateBranchSelector if a custom is not found in the props */ export declare const uiStateBranchSelectorSelector: (_: any, props: UIStateBranchSelectorSelectorProps) => UIStateBranchSelector; export declare const uiStateBranchSelector: ParametricSelector<{}, {}, Record> & { resultFunc: (res1: UIStateBranchSelector<{}>, res2: {}) => Record; recomputations: () => number; resetRecomputations: () => number; }; export declare const idSelector: (_: any, props: TProps & Partial>) => string | undefined; export declare const UI_STATE_SELECTOR_WARNING_MESSAGE = "redux-ui-state state key is undefined"; export declare const createUIStateSelectorWarningMessage: (id?: string | undefined) => string; export declare const uiStateSelector: ParametricSelector<{}, {}, any> & { resultFunc: (res1: Record, res2: string | undefined) => any; recomputations: () => number; resetRecomputations: () => number; }; export declare const SET_UI_STATE_SELECTOR_WARNING_MESSAGE: string; export declare const SET_UI_STATE_WARNING_MESSAGE: string; /** * Selects the setUIState function. * This differs from normal selectors in that it is a dispatch selector, meaning that it expects dispatch as the first * function and returns a function capable of dispatching through the Redux store. * @param dispatch The dispatch function of the Redux store * @param props The component's props */ export declare const setUIStateSelector: >(dispatch: Dispatch>, props: TProps) => (state: Partial) => void;