-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathreact.d.ts
More file actions
29 lines (24 loc) · 985 Bytes
/
react.d.ts
File metadata and controls
29 lines (24 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// T - Wrapped component props
// S - Wrapped component state
// K - Store state
// I - Injected props to wrapped component
// A - actions
declare module 'unistore/react' {
import * as React from 'react';
import { StateMapper, Store, ActionCreatorsObject, MappedActionCreators } from 'unistore';
export function connect<T, S, K, I, A extends ActionCreatorsObject<K>>(
mapStateToProps: string | Array<string> | StateMapper<T, K, I> | null,
actions?: A,
): (
Child: ((props: T & I & MappedActionCreators<A>) => React.ReactNode) | React.ComponentClass<T & I & MappedActionCreators<A>, S> | React.FC<T & I & MappedActionCreators<A>>
) => React.ComponentClass<T | T & I, S> | React.FC<T | T & I>;
export interface ProviderProps<K> {
store: Store<K>;
}
export class Provider<K> extends React.Component<ProviderProps<K>, {}> {
render(): React.ReactNode;
}
interface ComponentConstructor<P = {}, S = {}> {
new (props: P, context?: any): React.Component<P, S>;
}
}