Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32150845
D15011.1765033827.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
16 KB
Referenced Files
None
Subscribers
None
D15011.1765033827.diff
View Options
diff --git a/keyserver/flow-typed/npm/react-redux_v7.x.x.js b/keyserver/flow-typed/npm/react-redux_v7.x.x.js
--- a/keyserver/flow-typed/npm/react-redux_v7.x.x.js
+++ b/keyserver/flow-typed/npm/react-redux_v7.x.x.js
@@ -57,7 +57,7 @@
// and provide the StateProps type to the SP type parameter.
| ((state: S, ownProps: OP) => (state: S, ownProps: OP) => SP);
- declare type Bind<D> = <A, R>((...A) => R) => (...A) => $Call<D, R>;
+ declare type Bind<D> = <A, R>((...A) => R) => (...A) => ReturnType<D>;
declare type MapDispatchToPropsFn<D, OP, DP> =
| ((dispatch: D, ownProps: OP) => DP)
@@ -91,6 +91,13 @@
declare type MergeOPDP<OP, DP> = {| ...$Exact<OP>, ...DP |};
declare type MergeOPSPDP<OP, SP, DP> = {| ...$Exact<OP>, ...SP, ...DP |};
+ declare type MapDispatch<DP, D, R> = {
+ [K in $Keys<DP>]:
+ DP[K] extends (...args: infer A) => R
+ ? (...A) => ReturnType<D>
+ : empty
+ };
+
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps?: null | void,
mapDispatchToProps?: null | void,
@@ -123,7 +130,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
- ): Connector<P, OP, MergeOPDP<OP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPDP<OP, MapDispatch<DP, D>>>;
declare export function connect<P, OP, SP, DP, S, D>(
// If you get error here try adding return type to your mapStateToProps function
@@ -139,7 +146,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, SP, MergeOPSPDP<OP, SP, DP>>,
- ): Connector<P, OP, MergeOPSPDP<OP, SP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPSPDP<OP, SP, MapDispatch<DP, D>>>;
// With `mergeProps` argument
@@ -180,7 +187,7 @@
declare export function connect<P, OP, SP: {||}, DP, S, D>(
mapStateToProps: null | void,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, {||}, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, {||}, P>,
): Connector<P, OP, P>;
@@ -199,7 +206,7 @@
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps: MapStateToProps<S, OP, SP>,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, SP, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, SP, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, SP, P>,
): Connector<P, OP, P>;
diff --git a/keyserver/flow-typed/npm/redux_v4.x.x.js b/keyserver/flow-typed/npm/redux_v4.x.x.js
--- a/keyserver/flow-typed/npm/redux_v4.x.x.js
+++ b/keyserver/flow-typed/npm/redux_v4.x.x.js
@@ -97,7 +97,7 @@
): C;
declare export function combineReducers<RootState: {...}, A>(
- reducers: $ObjMap<RootState, <V>(V) => Reducer<V, A>>,
+ reducers: {[K in keyof RootState]: Reducer<RootState[K], A>}
): Reducer<RootState, A>;
declare function _compose(): <T>(a: T) => T;
diff --git a/lib/flow-typed/npm/react-redux_v7.x.x.js b/lib/flow-typed/npm/react-redux_v7.x.x.js
--- a/lib/flow-typed/npm/react-redux_v7.x.x.js
+++ b/lib/flow-typed/npm/react-redux_v7.x.x.js
@@ -91,6 +91,13 @@
declare type MergeOPDP<OP, DP> = {| ...$Exact<OP>, ...DP |};
declare type MergeOPSPDP<OP, SP, DP> = {| ...$Exact<OP>, ...SP, ...DP |};
+ declare type MapDispatch<DP, D, R> = {
+ [K in $Keys<DP>]:
+ DP[K] extends (...args: infer A) => R
+ ? (...A) => ReturnType<D>
+ : empty
+ };
+
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps?: null | void,
mapDispatchToProps?: null | void,
@@ -123,7 +130,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
- ): Connector<P, OP, MergeOPDP<OP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPDP<OP, MapDispatch<DP, D>>>;
declare export function connect<P, OP, SP, DP, S, D>(
// If you get error here try adding return type to your mapStateToProps function
@@ -139,7 +146,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, SP, MergeOPSPDP<OP, SP, DP>>,
- ): Connector<P, OP, MergeOPSPDP<OP, SP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPSPDP<OP, SP, MapDispatch<DP, D>>>;
// With `mergeProps` argument
@@ -180,7 +187,7 @@
declare export function connect<P, OP, SP: {||}, DP, S, D>(
mapStateToProps: null | void,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, {||}, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, {||}, P>,
): Connector<P, OP, P>;
@@ -199,7 +206,7 @@
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps: MapStateToProps<S, OP, SP>,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, SP, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, SP, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, SP, P>,
): Connector<P, OP, P>;
diff --git a/lib/flow-typed/npm/redux_v4.x.x.js b/lib/flow-typed/npm/redux_v4.x.x.js
--- a/lib/flow-typed/npm/redux_v4.x.x.js
+++ b/lib/flow-typed/npm/redux_v4.x.x.js
@@ -97,7 +97,7 @@
): C;
declare export function combineReducers<RootState: {...}, A>(
- reducers: $ObjMap<RootState, <V>(V) => Reducer<V, A>>,
+ reducers: {[K in keyof RootState]: Reducer<RootState[K], A>}
): Reducer<RootState, A>;
declare function _compose(): <T>(a: T) => T;
diff --git a/lib/flow-typed/npm/reselect_v3.x.x.js b/lib/flow-typed/npm/reselect_v3.x.x.js
--- a/lib/flow-typed/npm/reselect_v3.x.x.js
+++ b/lib/flow-typed/npm/reselect_v3.x.x.js
@@ -888,7 +888,7 @@
createStructuredSelector: <TState, TProps, InputSelectors: {[k: string | number]: InputSelector<TState, TProps, any>}>(
inputSelectors: InputSelectors,
selectorCreator?: SelectorCreator
- ) => OutputSelector<TState, TProps, $ObjMap<InputSelectors, ExtractReturnType>>
+ ) => OutputSelector<TState, TProps, {[K in keyof InputSelectors]: ReturnType<InputSelectors[K]>}>
};
declare module.exports: Reselect;
diff --git a/lib/flow-typed/npm/tcomb_v3.x.x.js b/lib/flow-typed/npm/tcomb_v3.x.x.js
--- a/lib/flow-typed/npm/tcomb_v3.x.x.js
+++ b/lib/flow-typed/npm/tcomb_v3.x.x.js
@@ -86,7 +86,7 @@
declare type TypeToValidator = <V>(v: V) => TType<V>;
- declare export type TStructProps<+T> = $ObjMap<T, TypeToValidator>;
+ declare export type TStructProps<+T> = {[K in keyof T]: TType<T[K]>};
declare type TStructOptions = {
name?: string,
strict?: boolean,
diff --git a/lib/shared/identity-client-context.js b/lib/shared/identity-client-context.js
--- a/lib/shared/identity-client-context.js
+++ b/lib/shared/identity-client-context.js
@@ -12,11 +12,9 @@
export type PartialAuthMetadata = Partial<AuthMetadata>;
-// TODO: Replace this with mapped type after Flow upgrade
-export type FullAuthMetadata = $ObjMap<
- AuthMetadata,
- <T>(prop: T) => $NonMaybeType<T>,
->;
+export type FullAuthMetadata = {
+ [K in keyof AuthMetadata]: $NonMaybeType<AuthMetadata[K]>,
+};
export type IdentityClientContextType = {
+identityClient: IdentityServiceClient,
diff --git a/lib/socket/inflight-requests.js b/lib/socket/inflight-requests.js
--- a/lib/socket/inflight-requests.js
+++ b/lib/socket/inflight-requests.js
@@ -32,10 +32,11 @@
reject: (error: Error) => void,
messageID: number,
};
-type InflightRequestMap = $ObjMap<
- ValidResponseMessageMap,
- <T>(T) => BaseInflightRequest<$Exact<T>>,
->;
+type InflightRequestMap = {
+ [K in keyof ValidResponseMessageMap]: BaseInflightRequest<
+ $Exact<ValidResponseMessageMap[K]>,
+ >,
+};
type ValidResponseMessage = $Values<ValidResponseMessageMap>;
type InflightRequest = $Values<InflightRequestMap>;
diff --git a/lib/types/subscription-types.js b/lib/types/subscription-types.js
--- a/lib/types/subscription-types.js
+++ b/lib/types/subscription-types.js
@@ -10,10 +10,10 @@
pushNotifs: 'pushNotifs',
});
-export type ThreadSubscription = $ObjMap<
- typeof threadSubscriptions,
- () => boolean,
->;
+export type ThreadSubscription = {
+ // eslint-disable-next-line no-unused-vars
+ [K in keyof typeof threadSubscriptions]: boolean,
+};
export const threadSubscriptionValidator: TInterface<ThreadSubscription> =
tShape<ThreadSubscription>(_mapValues(() => t.Boolean)(threadSubscriptions));
diff --git a/lib/utils/promises.js b/lib/utils/promises.js
--- a/lib/utils/promises.js
+++ b/lib/utils/promises.js
@@ -3,10 +3,13 @@
import sleep from './sleep.js';
type Promisable<T> = Promise<T> | T;
+type PromiseAllResult<T> = {
+ [K in keyof T]: T[K] extends Promisable<infer U> ? U : T[K],
+};
async function promiseAll<T: { +[key: string]: Promisable<mixed> }>(
input: T,
-): Promise<$ObjMap<T, typeof $await>> {
+): Promise<PromiseAllResult<T>> {
const promises = [];
const keys = Object.keys(input);
for (let i = 0; i < keys.length; i++) {
@@ -15,7 +18,7 @@
promises.push(promise);
}
const results = await Promise.all(promises);
- const byName: { [string]: mixed } = {};
+ const byName: PromiseAllResult<T> = { ...input };
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
byName[key] = results[i];
diff --git a/native/flow-typed/npm/@react-navigation/core_v6.x.x.js b/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
--- a/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/core_v6.x.x.js
@@ -952,10 +952,7 @@
declare export type ScreenListeners<
State: NavigationState = NavigationState,
EventMap: EventMapBase = EventMapCore<State>,
- > = $ObjMapi<
- {| [name: $Keys<EventMap>]: empty |},
- <K: $Keys<EventMap>>(K, empty) => EventListenerCallback<K, State, EventMap>,
- >;
+ > = {[K in $Keys<EventMap>]: EventListenerCallback<K, State, EventMap>};
declare type ScreenListenersProp<
ScreenListenersParam: {...},
RouteParam,
diff --git a/native/flow-typed/npm/react-native-reanimated_v2.x.x.js b/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
--- a/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
+++ b/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
@@ -519,7 +519,7 @@
declare type ToValue = (val: mixed) => ValueImpl;
declare type Event = <T: { ... }, E: $Event<T> = $Event<T>>(
defs: $ReadOnlyArray<{
- +nativeEvent: Partial<$ObjMap<E, ToValue>>,
+ +nativeEvent: Partial<{[K in keyof E]: ValueImpl}>,
...
}>,
) => EventResult<T, E>;
diff --git a/native/flow-typed/npm/react-redux_v7.x.x.js b/native/flow-typed/npm/react-redux_v7.x.x.js
--- a/native/flow-typed/npm/react-redux_v7.x.x.js
+++ b/native/flow-typed/npm/react-redux_v7.x.x.js
@@ -91,6 +91,13 @@
declare type MergeOPDP<OP, DP> = {| ...$Exact<OP>, ...DP |};
declare type MergeOPSPDP<OP, SP, DP> = {| ...$Exact<OP>, ...SP, ...DP |};
+ declare type MapDispatch<DP, D, R> = {
+ [K in $Keys<DP>]:
+ DP[K] extends (...args: infer A) => R
+ ? (...A) => ReturnType<D>
+ : empty
+ };
+
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps?: null | void,
mapDispatchToProps?: null | void,
@@ -123,7 +130,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
- ): Connector<P, OP, MergeOPDP<OP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPDP<OP,MapDispatch<DP, D>>>;
declare export function connect<P, OP, SP, DP, S, D>(
// If you get error here try adding return type to your mapStateToProps function
@@ -139,7 +146,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, SP, MergeOPSPDP<OP, SP, DP>>,
- ): Connector<P, OP, MergeOPSPDP<OP, SP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPSPDP<OP, SP, MapDispatch<DP, D>>>;
// With `mergeProps` argument
@@ -180,7 +187,7 @@
declare export function connect<P, OP, SP: {||}, DP, S, D>(
mapStateToProps: null | void,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, {||}, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, {||}, P>,
): Connector<P, OP, P>;
@@ -199,7 +206,7 @@
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps: MapStateToProps<S, OP, SP>,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, SP, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, SP, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, SP, P>,
): Connector<P, OP, P>;
diff --git a/native/flow-typed/npm/reselect_v3.x.x.js b/native/flow-typed/npm/reselect_v3.x.x.js
--- a/native/flow-typed/npm/reselect_v3.x.x.js
+++ b/native/flow-typed/npm/reselect_v3.x.x.js
@@ -888,7 +888,7 @@
createStructuredSelector: <TState, TProps, InputSelectors: {[k: string | number]: InputSelector<TState, TProps, any>}>(
inputSelectors: InputSelectors,
selectorCreator?: SelectorCreator
- ) => OutputSelector<TState, TProps, $ObjMap<InputSelectors, ExtractReturnType>>
+ ) => OutputSelector<TState, TProps, {[K in keyof InputSelectors]: ReturnType<InputSelectors[K]>}>
};
declare module.exports: Reselect;
diff --git a/native/themes/colors.js b/native/themes/colors.js
--- a/native/themes/colors.js
+++ b/native/themes/colors.js
@@ -286,8 +286,7 @@
type Styles = { [name: string]: { [field: string]: mixed } };
-type ReplaceField = (input: any) => any;
-export type StyleSheetOf<S: Styles> = $ReadOnly<$ObjMap<S, ReplaceField>>;
+export type StyleSheetOf<S: Styles> = $ReadOnly<{ [$Keys<S>]: any }>;
function stylesFromColors<IS: Styles>(
obj: IS,
diff --git a/web/flow-typed/npm/react-redux_v7.x.x.js b/web/flow-typed/npm/react-redux_v7.x.x.js
--- a/web/flow-typed/npm/react-redux_v7.x.x.js
+++ b/web/flow-typed/npm/react-redux_v7.x.x.js
@@ -90,6 +90,13 @@
declare type MergeOPSP<OP, SP, D> = {| ...$Exact<OP>, ...SP, dispatch: D |};
declare type MergeOPDP<OP, DP> = {| ...$Exact<OP>, ...DP |};
declare type MergeOPSPDP<OP, SP, DP> = {| ...$Exact<OP>, ...SP, ...DP |};
+
+ declare type MapDispatch<DP, D, R> = {
+ [K in $Keys<DP>]:
+ DP[K] extends (...args: infer A) => R
+ ? (...A) => ReturnType<D>
+ : empty
+ };
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps?: null | void,
@@ -123,7 +130,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
- ): Connector<P, OP, MergeOPDP<OP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPDP<OP, MapDispatch<DP, D>>>;
declare export function connect<P, OP, SP, DP, S, D>(
// If you get error here try adding return type to your mapStateToProps function
@@ -139,7 +146,7 @@
mapDispatchToProps: DP,
mergeProps?: null | void,
options?: ?Options<S, OP, SP, MergeOPSPDP<OP, SP, DP>>,
- ): Connector<P, OP, MergeOPSPDP<OP, SP, $ObjMap<DP, Bind<D>>>>;
+ ): Connector<P, OP, MergeOPSPDP<OP, SP, MapDispatch<DP, D>>>;
// With `mergeProps` argument
@@ -180,7 +187,7 @@
declare export function connect<P, OP, SP: {||}, DP, S, D>(
mapStateToProps: null | void,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, {||}, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, {||}, P>,
): Connector<P, OP, P>;
@@ -199,7 +206,7 @@
declare export function connect<P, OP, SP, DP, S, D>(
mapStateToProps: MapStateToProps<S, OP, SP>,
mapDispatchToProps: DP,
- mergeProps: MergeProps<P, OP, SP, $ObjMap<DP, Bind<D>>>,
+ mergeProps: MergeProps<P, OP, SP, {[K in keyof DP]: ReturnType<D>}>,
options?: ?Options<S, OP, SP, P>,
): Connector<P, OP, P>;
diff --git a/web/flow-typed/npm/reselect_v3.x.x.js b/web/flow-typed/npm/reselect_v3.x.x.js
--- a/web/flow-typed/npm/reselect_v3.x.x.js
+++ b/web/flow-typed/npm/reselect_v3.x.x.js
@@ -888,7 +888,7 @@
createStructuredSelector: <TState, TProps, InputSelectors: {[k: string | number]: InputSelector<TState, TProps, any>}>(
inputSelectors: InputSelectors,
selectorCreator?: SelectorCreator
- ) => OutputSelector<TState, TProps, $ObjMap<InputSelectors, ExtractReturnType>>
+ ) => OutputSelector<TState, TProps, {[K in keyof InputSelectors]: ReturnType<InputSelectors[K]>}>
};
declare module.exports: Reselect;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 3:10 PM (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5838912
Default Alt Text
D15011.1765033827.diff (16 KB)
Attached To
Mode
D15011: [Flow262][skip-ci] Migrate from $ObjMap
Attached
Detach File
Event Timeline
Log In to Comment