mirror of https://github.com/jitsi/jitsi-meet
parent
e93c9dde5d
commit
2b7976380e
File diff suppressed because it is too large
Load Diff
@ -1,132 +1,154 @@ |
||||
// flow-typed signature: 59b0c4be0e1408f21e2446be96c79804
|
||||
// flow-typed version: 9092387fd2/react-redux_v5.x.x/flow_>=v0.54.x
|
||||
|
||||
import type { Dispatch, Store } from "redux"; |
||||
|
||||
declare module "react-redux" { |
||||
/* |
||||
|
||||
S = State |
||||
A = Action |
||||
OP = OwnProps |
||||
SP = StateProps |
||||
DP = DispatchProps |
||||
|
||||
*/ |
||||
import type { ComponentType, ElementConfig } from 'react'; |
||||
|
||||
declare type MapStateToProps<S, OP: Object, SP: Object> = ( |
||||
state: S, |
||||
ownProps: OP |
||||
) => ((state: S, ownProps: OP) => SP) | SP; |
||||
|
||||
declare type MapDispatchToProps<A, OP: Object, DP: Object> = |
||||
| ((dispatch: Dispatch<A>, ownProps: OP) => DP) |
||||
| DP; |
||||
|
||||
declare type MergeProps<SP, DP: Object, OP: Object, P: Object> = ( |
||||
stateProps: SP, |
||||
dispatchProps: DP, |
||||
ownProps: OP |
||||
) => P; |
||||
|
||||
declare type Context = { store: Store<*, *> }; |
||||
|
||||
declare type ComponentWithDefaultProps<DP: {}, P: {}, CP: P> = Class< |
||||
React$Component<CP> |
||||
> & { defaultProps: DP }; |
||||
|
||||
declare class ConnectedComponentWithDefaultProps< |
||||
OP, |
||||
DP, |
||||
CP |
||||
> extends React$Component<OP> { |
||||
static defaultProps: DP, // <= workaround for https://github.com/facebook/flow/issues/4644
|
||||
static WrappedComponent: Class<React$Component<CP>>, |
||||
getWrappedInstance(): React$Component<CP>, |
||||
props: OP, |
||||
state: void |
||||
} |
||||
|
||||
declare class ConnectedComponent<OP, P> extends React$Component<OP> { |
||||
static WrappedComponent: Class<React$Component<P>>, |
||||
getWrappedInstance(): React$Component<P>, |
||||
props: OP, |
||||
state: void |
||||
} |
||||
|
||||
declare type ConnectedComponentWithDefaultPropsClass<OP, DP, CP> = Class< |
||||
ConnectedComponentWithDefaultProps<OP, DP, CP> |
||||
>; |
||||
|
||||
declare type ConnectedComponentClass<OP, P> = Class< |
||||
ConnectedComponent<OP, P> |
||||
>; |
||||
|
||||
declare type Connector<OP, P> = (<DP: {}, CP: {}>( |
||||
component: ComponentWithDefaultProps<DP, P, CP> |
||||
) => ConnectedComponentWithDefaultPropsClass<OP, DP, CP>) & |
||||
((component: React$ComponentType<P>) => ConnectedComponentClass<OP, P>); |
||||
|
||||
declare class Provider<S, A> extends React$Component<{ |
||||
declare export class Provider<S, A> extends React$Component<{ |
||||
store: Store<S, A>, |
||||
children?: any |
||||
}> {} |
||||
|
||||
declare function createProvider( |
||||
declare export function createProvider( |
||||
storeKey?: string, |
||||
subKey?: string |
||||
): Provider<*, *>; |
||||
|
||||
declare type ConnectOptions = { |
||||
/* |
||||
|
||||
S = State |
||||
A = Action |
||||
OP = OwnProps |
||||
SP = StateProps |
||||
DP = DispatchProps |
||||
MP = Merge props |
||||
MDP = Map dispatch to props object |
||||
RSP = Returned state props |
||||
RDP = Returned dispatch props |
||||
RMP = Returned merge props |
||||
CP = Props for returned component |
||||
Com = React Component |
||||
*/ |
||||
|
||||
declare type MapStateToProps<S: Object, SP: Object, RSP: Object> = (state: S, props: SP) => RSP; |
||||
|
||||
declare type MapDispatchToProps<A, OP: Object, RDP: Object> = (dispatch: Dispatch<A>, ownProps: OP) => RDP; |
||||
|
||||
declare type MergeProps<SP: Object, DP: Object, MP: Object, RMP: Object> = ( |
||||
stateProps: SP, |
||||
dispatchProps: DP, |
||||
ownProps: MP |
||||
) => RMP; |
||||
|
||||
declare type ConnectOptions<S: Object, OP: Object, RSP: Object, RMP: Object> = {| |
||||
pure?: boolean, |
||||
withRef?: boolean |
||||
withRef?: boolean, |
||||
areStatesEqual?: (next: S, prev: S) => boolean, |
||||
areOwnPropsEqual?: (next: OP, prev: OP) => boolean, |
||||
areStatePropsEqual?: (next: RSP, prev: RSP) => boolean, |
||||
areMergedPropsEqual?: (next: RMP, prev: RMP) => boolean, |
||||
storeKey?: string |
||||
|}; |
||||
|
||||
declare type OmitDispatch<Component> = $Diff<Component, {dispatch: Dispatch<*>}>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
S: Object, |
||||
DP: Object, |
||||
RSP: Object, |
||||
CP: $Diff<OmitDispatch<ElementConfig<Com>>, RSP> |
||||
>( |
||||
mapStateToProps: MapStateToProps<S, DP, RSP>, |
||||
mapDispatchToProps?: null |
||||
): (component: Com) => ComponentType<CP & DP>; |
||||
|
||||
declare export function connect<Com: ComponentType<*>>( |
||||
mapStateToProps?: null, |
||||
mapDispatchToProps?: null |
||||
): (component: Com) => ComponentType<OmitDispatch<ElementConfig<Com>>>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
A, |
||||
S: Object, |
||||
DP: Object, |
||||
SP: Object, |
||||
RSP: Object, |
||||
RDP: Object, |
||||
CP: $Diff<$Diff<ElementConfig<Com>, RSP>, RDP> |
||||
>( |
||||
mapStateToProps: MapStateToProps<S, SP, RSP>, |
||||
mapDispatchToProps: MapDispatchToProps<A, DP, RDP> |
||||
): (component: Com) => ComponentType<CP & SP & DP>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
A, |
||||
OP: Object, |
||||
DP: Object, |
||||
PR: Object, |
||||
CP: $Diff<ElementConfig<Com>, DP> |
||||
>( |
||||
mapStateToProps?: null, |
||||
mapDispatchToProps: MapDispatchToProps<A, OP, DP> |
||||
): (Com) => ComponentType<CP & OP>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
MDP: Object |
||||
>( |
||||
mapStateToProps?: null, |
||||
mapDispatchToProps: MDP |
||||
): (component: Com) => ComponentType<$Diff<ElementConfig<Com>, MDP>>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
S: Object, |
||||
SP: Object, |
||||
RSP: Object, |
||||
MDP: Object, |
||||
CP: $Diff<ElementConfig<Com>, RSP> |
||||
>( |
||||
mapStateToProps: MapStateToProps<S, SP, RSP>, |
||||
mapDispatchToPRops: MDP |
||||
): (component: Com) => ComponentType<$Diff<CP, MDP> & SP>; |
||||
|
||||
declare export function connect< |
||||
Com: ComponentType<*>, |
||||
A, |
||||
S: Object, |
||||
DP: Object, |
||||
SP: Object, |
||||
RSP: Object, |
||||
RDP: Object, |
||||
MP: Object, |
||||
RMP: Object, |
||||
CP: $Diff<ElementConfig<Com>, RMP> |
||||
>( |
||||
mapStateToProps: MapStateToProps<S, SP, RSP>, |
||||
mapDispatchToProps: ?MapDispatchToProps<A, DP, RDP>, |
||||
mergeProps: MergeProps<RSP, RDP, MP, RMP> |
||||
): (component: Com) => ComponentType<CP & SP & DP & MP>; |
||||
|
||||
declare export function connect<Com: ComponentType<*>, |
||||
A, |
||||
S: Object, |
||||
DP: Object, |
||||
SP: Object, |
||||
RSP: Object, |
||||
RDP: Object, |
||||
MP: Object, |
||||
RMP: Object |
||||
>( |
||||
mapStateToProps: ?MapStateToProps<S, SP, RSP>, |
||||
mapDispatchToProps: ?MapDispatchToProps<A, DP, RDP>, |
||||
mergeProps: ?MergeProps<RSP, RDP, MP, RMP>, |
||||
options: ConnectOptions<S, SP & DP & MP, RSP, RMP> |
||||
): (component: Com) => ComponentType<$Diff<ElementConfig<Com>, RMP> & SP & DP & MP>; |
||||
|
||||
declare export default { |
||||
Provider: typeof Provider, |
||||
createProvider: typeof createProvider, |
||||
connect: typeof connect, |
||||
}; |
||||
|
||||
declare type Null = null | void; |
||||
|
||||
declare function connect<A, OP>( |
||||
...rest: Array<void> // <= workaround for https://github.com/facebook/flow/issues/2360
|
||||
): Connector<OP, $Supertype<{ dispatch: Dispatch<A> } & OP>>; |
||||
|
||||
declare function connect<A, OP>( |
||||
mapStateToProps: Null, |
||||
mapDispatchToProps: Null, |
||||
mergeProps: Null, |
||||
options: ConnectOptions |
||||
): Connector<OP, $Supertype<{ dispatch: Dispatch<A> } & OP>>; |
||||
|
||||
// declare function connect<S, A, OP, SP>(
|
||||
// mapStateToProps: MapStateToProps<S, OP, SP>,
|
||||
// mapDispatchToProps: Null,
|
||||
// mergeProps: Null,
|
||||
// options?: ConnectOptions
|
||||
// ): Connector<OP, $Supertype<SP & { dispatch: Dispatch<A> } & OP>>;
|
||||
|
||||
declare function connect<A, OP, DP>( |
||||
mapStateToProps: Null, |
||||
mapDispatchToProps: MapDispatchToProps<A, OP, DP>, |
||||
mergeProps: Null, |
||||
options?: ConnectOptions |
||||
): Connector<OP, $Supertype<DP & OP>>; |
||||
|
||||
declare function connect<S, A, OP, SP, DP>( |
||||
mapStateToProps: MapStateToProps<S, OP, SP>, |
||||
mapDispatchToProps: MapDispatchToProps<A, OP, DP> | Null, |
||||
mergeProps: Null, |
||||
options?: ConnectOptions |
||||
): Connector<OP, $Supertype<SP & DP & OP>>; |
||||
|
||||
declare function connect<S, A, OP, SP, DP, P>( |
||||
mapStateToProps: MapStateToProps<S, OP, SP>, |
||||
mapDispatchToProps: Null, |
||||
mergeProps: MergeProps<SP, DP, OP, P>, |
||||
options?: ConnectOptions |
||||
): Connector<OP, P>; |
||||
|
||||
declare function connect<S, A, OP, SP, DP, P>( |
||||
mapStateToProps: MapStateToProps<S, OP, SP>, |
||||
mapDispatchToProps: MapDispatchToProps<A, OP, DP>, |
||||
mergeProps: MergeProps<SP, DP, OP, P>, |
||||
options?: ConnectOptions |
||||
): Connector<OP, P>; |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue