Created
August 16, 2018 06:22
-
-
Save lanwin/67ab9a1e6fd89dfb32eda525d4cd0def to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "react-copy-write" { | |
interface ConsumerProps<TState> { | |
select?: any; | |
children: (store: TState) => any; | |
} | |
interface ISelector<TState, TRet> { | |
select: (store: TState) => TRet; | |
} | |
class Consumer<T> extends Component<ConsumerProps<T>> {} | |
interface IState<TState> { | |
Consumer: new () => Consumer<TState>; | |
createSelector<TRet>( | |
selector: (state: TState) => TRet | |
): ISelector<TState, TRet>; | |
createConsumer<TState, T1>( | |
selector1: ISelector<TState, T1> | |
): new () => Consumer<T1>; | |
createConsumer<TState, T1, T2>( | |
selector1: ISelector<TState, T1>, | |
selector2: ISelector<TState, T2> | |
): new () => Consumer<T1 & T2>; | |
} | |
export function createStore<TState>(state: TState): IState<TState>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment