///
import * as React from 'react';
import { PureComponent } from 'react';
import Global from './global';
import { Consumer, getInitialState } from './helper';
import { actionMiddlewares, middlewares } from './middlewares';
declare function useModel(state: S | (() => S)): [S, (state: Partial | ((state: S) => S | void)) => void];
declare function createStore(useHook: CustomModelHook): LaneAPI;
declare function createStore(name: string, useHook: CustomModelHook): LaneAPI;
declare function Model>(models: MT, initialState?: E): API;
declare function Model(models: M, initialState?: Global['State']): APIs;
declare const getState: (modelName: keyof typeof Global.State) => any;
declare class Provider extends PureComponent<{}, Global['State']> {
state: {
[modelName: string]: any;
};
render(): JSX.Element;
}
declare const connect: (modelName: string, mapState?: Function | undefined, mapActions?: Function | undefined) => (Component: typeof React.PureComponent | typeof React.Component) => {
new (props: any): {
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
};
new (props: any, context: any): {
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
};
contextType?: React.Context | undefined;
};
export { actionMiddlewares, createStore, useModel, Model, middlewares, Provider, Consumer, connect, getState, getInitialState };