Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

flow: update type definitions

Saúl Ibarra Corretgé278d3a163bdc
diff --git a/flow-typed/npm/jquery_v3.x.x.js b/flow-typed/npm/jquery_v3.x.x.js
index b25c9b85a8..2037585bf5 100644
--- a/flow-typed/npm/jquery_v3.x.x.js
+++ b/flow-typed/npm/jquery_v3.x.x.js
@@ -1,5 +1,5 @@
-// flow-typed signature: d71d314ca25fc6c20610a3ba80af9df0
-// flow-typed version: 9698a46399/jquery_v3.x.x/flow_>=v0.28.x
+// flow-typed signature: f26fda66e3a551aef37d3b0f53058e6a
+// flow-typed version: 44ad941b7a/jquery_v3.x.x/flow_>=v0.28.x
/* eslint-disable max-len, no-unused-vars, flowtype/no-weak-types */
@@ -364,6 +364,13 @@ declare class JQueryGenericPromise<T> {
failFilter?: (...reasons: any[]) => any,
progressFilter?: (...progression: any[]) => any
): JQueryPromise<void>;
+
+ /**
+ * Add handlers to be called when the Deferred object is rejected.
+ *
+ * @param failFilter An function that is called when the Deferred is rejected.
+ */
+ catch(failFilter: (...reasons: any[]) => any): JQueryPromise<T>;
}
/**
@@ -822,7 +829,7 @@ declare class JQueryStatic {
*/
get(
url: string,
- data?: Object | string,
+ data?: {} | string,
success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any,
dataType?: string
): JQueryXHR;
@@ -845,7 +852,7 @@ declare class JQueryStatic {
*/
getJSON(
url: string,
- data?: Object | string,
+ data?: {} | string,
success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any
): JQueryXHR;
/**
@@ -886,7 +893,7 @@ declare class JQueryStatic {
*/
post(
url: string,
- data?: Object | string,
+ data?: {} | string,
success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any,
dataType?: string
): JQueryXHR;
@@ -967,7 +974,7 @@ declare class JQueryStatic {
* @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
* @param attributes An object of attributes, events, and methods to call on the newly-created element.
*/
- (html: string, attributes: Object): JQuery;
+ (html: string, attributes: {}): JQuery;
/**
* Relinquish jQuery's control of the $ variable.
@@ -1425,7 +1432,7 @@ declare class JQuery {
*/
load(
url: string,
- data?: string | Object,
+ data?: string | {},
complete?: (
responseText: string,
textStatus: string,
@@ -1482,7 +1489,7 @@ declare class JQuery {
*
* @param attributes An object of attribute-value pairs to set.
*/
- attr(attributes: Object): JQuery;
+ attr(attributes: {}): JQuery;
/**
* Get the value of an attribute for the first element in the set of matched elements.
*
@@ -1532,7 +1539,7 @@ declare class JQuery {
*
* @param properties An object of property-value pairs to set.
*/
- prop(properties: Object): JQuery;
+ prop(properties: {}): JQuery;
/**
* Set one or more properties for the set of matched elements.
*
@@ -1598,7 +1605,7 @@ declare class JQuery {
/**
* Get the current value of the first element in the set of matched elements.
*/
- val(_: void): any;
+ val(_: void): string | string[] | number;
/**
* Set the value of each element in the set of matched elements.
*
@@ -1634,7 +1641,7 @@ declare class JQuery {
*
* @param properties An object of property-value pairs to set.
*/
- css(properties: Object): JQuery;
+ css(properties: {}): JQuery;
/**
* Get the value of style properties for the first element in the set of matched elements.
*
@@ -1847,7 +1854,7 @@ declare class JQuery {
* @param complete A function to call once the animation is complete.
*/
animate(
- properties: Object,
+ properties: {},
duration?: string | number,
complete?: Function
): JQuery;
@@ -1860,7 +1867,7 @@ declare class JQuery {
* @param complete A function to call once the animation is complete.
*/
animate(
- properties: Object,
+ properties: {},
duration?: string | number,
easing?: string,
complete?: Function
@@ -1871,7 +1878,7 @@ declare class JQuery {
* @param properties An object of CSS properties and values that the animation will move toward.
* @param options A map of additional options to pass to the method.
*/
- animate(properties: Object, options: JQueryAnimationOptions): JQuery;
+ animate(properties: {}, options: JQueryAnimationOptions): JQuery;
/**
* Set a timer to delay execution of subsequent items in the queue.
@@ -2920,14 +2927,14 @@ declare class JQuery {
* @param eventType A string containing a JavaScript event type, such as click or submit.
* @param extraParameters Additional parameters to pass along to the event handler.
*/
- trigger(eventType: string, extraParameters?: any[] | Object): JQuery;
+ trigger(eventType: string, extraParameters?: any[] | {}): JQuery;
/**
* Execute all handlers and behaviors attached to the matched elements for the given event type.
*
* @param event A jQuery.Event object.
* @param extraParameters Additional parameters to pass along to the event handler.
*/
- trigger(event: JQueryEventObject, extraParameters?: any[] | Object): JQuery;
+ trigger(event: JQueryEventObject, extraParameters?: any[] | {}): JQuery;
/**
* Execute all handlers attached to an element for an event.
diff --git a/flow-typed/npm/lodash_v4.x.x.js b/flow-typed/npm/lodash_v4.x.x.js
index ea447164c6..9d64214dea 100644
--- a/flow-typed/npm/lodash_v4.x.x.js
+++ b/flow-typed/npm/lodash_v4.x.x.js
@@ -1,7 +1,8 @@
-// flow-typed signature: 99202f0cce15ad31fae01af918065827
-// flow-typed version: ce66c2353d/lodash_v4.x.x/flow_>=v0.63.x
+// flow-typed signature: a9b75804169260d49cda34b56dcfabe1
+// flow-typed version: e9dac1347c/lodash_v4.x.x/flow_>=v0.63.x
declare module "lodash" {
+ declare type Path = $ReadOnlyArray<string | number> | string | number;
declare type __CurriedFunction1<A, R, AA: A> = (...r: [AA]) => R;
declare type CurriedFunction1<A, R> = __CurriedFunction1<A, R, *>;
@@ -161,7 +162,7 @@ declare module "lodash" {
declare type NestedArray<T> = Array<Array<T>>;
- declare type matchesIterateeShorthand = Object;
+ declare type matchesIterateeShorthand = {[key: any]: any};
declare type matchesPropertyIterateeShorthand = [string, any];
declare type propertyIterateeShorthand = string;
@@ -214,14 +215,24 @@ declare module "lodash" {
// Array
chunk<T>(array?: ?Array<T>, size?: ?number): Array<Array<T>>;
compact<T, N: ?T>(array?: ?Array<N>): Array<T>;
- concat<T>(base?: ?$ReadOnlyArray<T>, ...elements: Array<any>): Array<T | any>;
- difference<T>(array?: ?$ReadOnlyArray<T>, ...values: Array<?$ReadOnlyArray<T>>): Array<T>;
+ concat<T>(
+ base?: ?$ReadOnlyArray<T>,
+ ...elements: Array<any>
+ ): Array<T | any>;
+ difference<T>(
+ array?: ?$ReadOnlyArray<T>,
+ ...values: Array<?$ReadOnlyArray<T>>
+ ): Array<T>;
differenceBy<T>(
array?: ?$ReadOnlyArray<T>,
values?: ?$ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): T[];
- differenceWith<T>(array?: ?$ReadOnlyArray<T>, values?: ?$ReadOnlyArray<T>, comparator?: ?Comparator<T>): T[];
+ differenceWith<T>(
+ array?: ?$ReadOnlyArray<T>,
+ values?: ?$ReadOnlyArray<T>,
+ comparator?: ?Comparator<T>
+ ): T[];
drop<T>(array?: ?Array<T>, n?: ?number): Array<T>;
dropRight<T>(array?: ?Array<T>, n?: ?number): Array<T>;
dropRightWhile<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
@@ -238,7 +249,7 @@ declare module "lodash" {
fromIndex?: ?number
): number;
findIndex<T>(
- array: void | null,
+ array: void | null,
predicate?: ?Predicate<T>,
fromIndex?: ?number
): -1;
@@ -255,162 +266,182 @@ declare module "lodash" {
// alias of _.head
first<T>(array: ?$ReadOnlyArray<T>): T;
flatten<T, X>(array?: ?Array<Array<T> | X>): Array<T | X>;
- flattenDeep<T>(array?: ?any[]): Array<T>;
- flattenDepth(array?: ?any[], depth?: ?number): any[];
+ flattenDeep<T>(array?: ?(any[])): Array<T>;
+ flattenDepth(array?: ?(any[]), depth?: ?number): any[];
fromPairs<A, B>(pairs?: ?Array<[A, B]>): { [key: A]: B };
head<T>(array: ?$ReadOnlyArray<T>): T;
indexOf<T>(array: Array<T>, value: T, fromIndex?: number): number;
- indexOf<T>(array: void | null, value?: ?T, fromIndex?: ?number): -1;
+ indexOf<T>(array: void | null, value?: ?T, fromIndex?: ?number): -1;
initial<T>(array: ?Array<T>): Array<T>;
- intersection<T>(...arrays?: Array<Array<T>>): Array<T>;
+ intersection<T>(...arrays?: Array<$ReadOnlyArray<T>>): Array<T>;
//Workaround until (...parameter: T, parameter2: U) works
- intersectionBy<T>(a1?: ?Array<T>, iteratee?: ?ValueOnlyIteratee<T>): Array<T>;
intersectionBy<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): Array<T>;
intersectionBy<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
- a3?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): Array<T>;
intersectionBy<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
- a3?: ?Array<T>,
- a4?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
+ a3?: ?$ReadOnlyArray<T>,
+ iteratee?: ?ValueOnlyIteratee<T>
+ ): Array<T>;
+ intersectionBy<T>(
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
+ a3?: ?$ReadOnlyArray<T>,
+ a4?: ?$ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): Array<T>;
//Workaround until (...parameter: T, parameter2: U) works
- intersectionWith<T>(a1?: ?Array<T>, comparator?: ?Comparator<T>): Array<T>;
intersectionWith<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
comparator?: ?Comparator<T>
): Array<T>;
intersectionWith<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
- a3?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
comparator?: ?Comparator<T>
): Array<T>;
intersectionWith<T>(
- a1?: ?Array<T>,
- a2?: ?Array<T>,
- a3?: ?Array<T>,
- a4?: ?Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
+ a3?: ?$ReadOnlyArray<T>,
+ comparator?: ?Comparator<T>
+ ): Array<T>;
+ intersectionWith<T>(
+ a1?: ?$ReadOnlyArray<T>,
+ a2?: ?$ReadOnlyArray<T>,
+ a3?: ?$ReadOnlyArray<T>,
+ a4?: ?$ReadOnlyArray<T>,
comparator?: ?Comparator<T>
): Array<T>;
join<T>(array: Array<T>, separator?: ?string): string;
- join<T>(array: void | null, separator?: ?string): '';
- last<T>(array: ?Array<T>): T;
+ join<T>(array: void | null, separator?: ?string): "";
+ last<T>(array: ?$ReadOnlyArray<T>): T;
lastIndexOf<T>(array: Array<T>, value?: ?T, fromIndex?: ?number): number;
- lastIndexOf<T>(array: void | null, value?: ?T, fromIndex?: ?number): -1;
+ lastIndexOf<T>(array: void | null, value?: ?T, fromIndex?: ?number): -1;
nth<T>(array: T[], n?: ?number): T;
- nth(array: void | null, n?: ?number): void;
+ nth(array: void | null, n?: ?number): void;
pull<T>(array: Array<T>, ...values?: Array<?T>): Array<T>;
- pull<T: void | null>(array: T, ...values?: Array<?any>): T;
+ pull<T: void | null>(array: T, ...values?: Array<?any>): T;
pullAll<T>(array: Array<T>, values?: ?Array<T>): Array<T>;
- pullAll<T: void | null>(array: T, values?: ?Array<any>): T;
+ pullAll<T: void | null>(array: T, values?: ?Array<any>): T;
pullAllBy<T>(
array: Array<T>,
values?: ?Array<T>,
iteratee?: ?ValueOnlyIteratee<T>
): Array<T>;
- pullAllBy<T: void | null>(
+ pullAllBy<T: void | null>(
array: T,
values?: ?Array<any>,
iteratee?: ?ValueOnlyIteratee<any>
): T;
- pullAllWith<T>(array: T[], values?: ?T[], comparator?: ?Function): T[];
- pullAllWith<T: void | null>(array: T, values?: ?Array<any>, comparator?: ?Function): T;
+ pullAllWith<T>(array: T[], values?: ?(T[]), comparator?: ?Function): T[];
+ pullAllWith<T: void | null>(
+ array: T,
+ values?: ?Array<any>,
+ comparator?: ?Function
+ ): T;
pullAt<T>(array?: ?Array<T>, ...indexed?: Array<?number>): Array<T>;
pullAt<T>(array?: ?Array<T>, indexed?: ?Array<number>): Array<T>;
remove<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
reverse<T>(array: Array<T>): Array<T>;
- reverse<T: void | null>(array: T): T;
- slice<T>(array?: ?$ReadOnlyArray<T>, start?: ?number, end?: ?number): Array<T>;
+ reverse<T: void | null>(array: T): T;
+ slice<T>(
+ array?: ?$ReadOnlyArray<T>,
+ start?: ?number,
+ end?: ?number
+ ): Array<T>;
sortedIndex<T>(array: Array<T>, value: T): number;
- sortedIndex<T>(array: void | null, value: ?T): 0;
+ sortedIndex<T>(array: void | null, value: ?T): 0;
sortedIndexBy<T>(
array: Array<T>,
value?: ?T,
iteratee?: ?ValueOnlyIteratee<T>
): number;
sortedIndexBy<T>(
- array: void | null,
+ array: void | null,
value?: ?T,
iteratee?: ?ValueOnlyIteratee<T>
): 0;
sortedIndexOf<T>(array: Array<T>, value: T): number;
- sortedIndexOf<T>(array: void | null, value?: ?T): -1;
+ sortedIndexOf<T>(array: void | null, value?: ?T): -1;
sortedLastIndex<T>(array: Array<T>, value: T): number;
- sortedLastIndex<T>(array: void | null, value?: ?T): 0;
+ sortedLastIndex<T>(array: void | null, value?: ?T): 0;
sortedLastIndexBy<T>(
array: Array<T>,
value: T,
iteratee?: ValueOnlyIteratee<T>
): number;
sortedLastIndexBy<T>(
- array: void | null,
+ array: void | null,
value?: ?T,
iteratee?: ?ValueOnlyIteratee<T>
): 0;
sortedLastIndexOf<T>(array: Array<T>, value: T): number;
- sortedLastIndexOf<T>(array: void | null, value?: ?T): -1;
+ sortedLastIndexOf<T>(array: void | null, value?: ?T): -1;
sortedUniq<T>(array?: ?Array<T>): Array<T>;
- sortedUniqBy<T>(array?: ?Array<T>, iteratee?: ?(value: T) => mixed): Array<T>;
+ sortedUniqBy<T>(
+ array?: ?Array<T>,
+ iteratee?: ?ValueOnlyIteratee<T>
+ ): Array<T>;
tail<T>(array?: ?Array<T>): Array<T>;
take<T>(array?: ?Array<T>, n?: ?number): Array<T>;
takeRight<T>(array?: ?Array<T>, n?: ?number): Array<T>;
takeRightWhile<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
takeWhile<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
- union<T>(...arrays?: Array<Array<T>>): Array<T>;
+ union<T>(...arrays?: Array<$ReadOnlyArray<T>>): Array<T>;
//Workaround until (...parameter: T, parameter2: U) works
- unionBy<T>(a1?: ?Array<T>, iteratee?: ?ValueOnlyIteratee<T>): Array<T>;
unionBy<T>(
- a1?: ?Array<T>,
- a2: Array<T>,
+ a1?: ?$ReadOnlyArray<T>,
+ iteratee?: ?ValueOnlyIteratee<T>
+ ): Array<T>;
+ unionBy<T>(
+ a1?: ?$ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
iteratee?: ValueOnlyIteratee<T>
): Array<T>;
unionBy<T>(
- a1: Array<T>,
- a2: Array<T>,
- a3: Array<T>,
+ a1: $ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
+ a3: $ReadOnlyArray<T>,
iteratee?: ValueOnlyIteratee<T>
): Array<T>;
unionBy<T>(
- a1: Array<T>,
- a2: Array<T>,
- a3: Array<T>,
- a4: Array<T>,
+ a1: $ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
+ a3: $ReadOnlyArray<T>,
+ a4: $ReadOnlyArray<T>,
iteratee?: ValueOnlyIteratee<T>
): Array<T>;
//Workaround until (...parameter: T, parameter2: U) works
unionWith<T>(a1?: ?Array<T>, comparator?: ?Comparator<T>): Array<T>;
unionWith<T>(
- a1: Array<T>,
- a2: Array<T>,
+ a1: $ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
comparator?: Comparator<T>
): Array<T>;
unionWith<T>(
- a1: Array<T>,
- a2: Array<T>,
- a3: Array<T>,
+ a1: $ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
+ a3: $ReadOnlyArray<T>,
comparator?: Comparator<T>
): Array<T>;
unionWith<T>(
- a1: Array<T>,
- a2: Array<T>,
- a3: Array<T>,
- a4: Array<T>,
+ a1: $ReadOnlyArray<T>,
+ a2: $ReadOnlyArray<T>,
+ a3: $ReadOnlyArray<T>,
+ a4: $ReadOnlyArray<T>,
comparator?: Comparator<T>
): Array<T>;
- uniq<T>(array?: ?Array<T>): Array<T>;
- uniqBy<T>(array?: ?Array<T>, iteratee?: ?ValueOnlyIteratee<T>): Array<T>;
- uniqWith<T>(array?: ?Array<T>, comparator?: ?Comparator<T>): Array<T>;
+ uniq<T>(array?: ?$ReadOnlyArray<T>): Array<T>;
+ uniqBy<T>(array?: ?$ReadOnlyArray<T>, iteratee?: ?ValueOnlyIteratee<T>): Array<T>;
+ uniqWith<T>(array?: ?$ReadOnlyArray<T>, comparator?: ?Comparator<T>): Array<T>;
unzip<T>(array?: ?Array<T>): Array<T>;
unzipWith<T>(array: ?Array<T>, iteratee?: ?Iteratee<T>): Array<T>;
without<T>(array?: ?$ReadOnlyArray<T>, ...values?: Array<?T>): Array<T>;
@@ -455,7 +486,7 @@ declare module "lodash" {
a4: Array<T>,
comparator?: Comparator<T>
): Array<T>;
- zip<A, B>(a1?: ?A[], a2?: ?B[]): Array<[A, B]>;
+ zip<A, B>(a1?: ?(A[]), a2?: ?(B[])): Array<[A, B]>;
zip<A, B, C>(a1: A[], a2: B[], a3: C[]): Array<[A, B, C]>;
zip<A, B, C, D>(a1: A[], a2: B[], a3: C[], a4: D[]): Array<[A, B, C, D]>;
zip<A, B, C, D, E>(
@@ -467,9 +498,9 @@ declare module "lodash" {
): Array<[A, B, C, D, E]>;
zipObject<K, V>(props: Array<K>, values?: ?Array<V>): { [key: K]: V };
- zipObject<K, V>(props: void | null, values?: ?Array<V>): {};
+ zipObject<K, V>(props: void | null, values?: ?Array<V>): {};
zipObjectDeep(props: any[], values?: ?any): Object;
- zipObjectDeep(props: void | null, values?: ?any): {};
+ zipObjectDeep(props: void | null, values?: ?any): {};
zipWith<A>(a1?: ?Array<A>): Array<[A]>;
zipWith<T, A>(a1: Array<A>, iteratee: (A) => T): Array<T>;
@@ -509,20 +540,20 @@ declare module "lodash" {
// Collection
countBy<T>(array: Array<T>, iteratee?: ?ValueOnlyIteratee<T>): Object;
- countBy<T>(array: void | null, iteratee?: ?ValueOnlyIteratee<T>): {};
+ countBy<T>(array: void | null, iteratee?: ?ValueOnlyIteratee<T>): {};
countBy<T: Object>(object: T, iteratee?: ?ValueOnlyIteratee<T>): Object;
// alias of _.forEach
each<T>(array: $ReadOnlyArray<T>, iteratee?: ?Iteratee<T>): Array<T>;
- each<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
+ each<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
each<T: Object>(object: T, iteratee?: ?OIteratee<T>): T;
// alias of _.forEachRight
eachRight<T>(array: $ReadOnlyArray<T>, iteratee?: ?Iteratee<T>): Array<T>;
- eachRight<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
+ eachRight<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
eachRight<T: Object>(object: T, iteratee?: OIteratee<T>): T;
every<T>(array?: ?$ReadOnlyArray<T>, iteratee?: ?Iteratee<T>): boolean;
every<T: Object>(object: T, iteratee?: OIteratee<T>): boolean;
filter<T>(array?: ?$ReadOnlyArray<T>, predicate?: ?Predicate<T>): Array<T>;
- filter<A, T: { [id: string]: A }>(
+ filter<A, T: { [id: any]: A }>(
object: T,
predicate?: OPredicate<A, T>
): Array<A>;
@@ -532,11 +563,11 @@ declare module "lodash" {
fromIndex?: ?number
): T | void;
find<T>(
- array: void | null,
+ array: void | null,
predicate?: ?Predicate<T>,
fromIndex?: ?number
): void;
- find<V, A, T: { [id: string]: A }>(
+ find<V, A, T: { [id: any]: A }>(
object: T,
predicate?: OPredicate<A, T>,
fromIndex?: number
@@ -546,7 +577,7 @@ declare module "lodash" {
predicate?: ?Predicate<T>,
fromIndex?: ?number
): T | void;
- findLast<V, A, T: { [id: string]: A }>(
+ findLast<V, A, T: { [id: any]: A }>(
object: T,
predicate?: ?OPredicate<A, T>
): V;
@@ -577,54 +608,55 @@ declare module "lodash" {
depth?: number
): Array<U>;
forEach<T>(array: $ReadOnlyArray<T>, iteratee?: ?Iteratee<T>): Array<T>;
- forEach<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
+ forEach<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
forEach<T: Object>(object: T, iteratee?: ?OIteratee<T>): T;
- forEachRight<T>(array: $ReadOnlyArray<T>, iteratee?: ?Iteratee<T>): Array<T>;
- forEachRight<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
+ forEachRight<T>(
+ array: $ReadOnlyArray<T>,
+ iteratee?: ?Iteratee<T>
+ ): Array<T>;
+ forEachRight<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
forEachRight<T: Object>(object: T, iteratee?: ?OIteratee<T>): T;
groupBy<V, T>(
array: $ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): { [key: V]: Array<T> };
- groupBy(
- array: void | null,
- iteratee?: ?ValueOnlyIteratee<any>
- ): {};
- groupBy<V, A, T: { [id: string]: A }>(
+ groupBy(array: void | null, iteratee?: ?ValueOnlyIteratee<any>): {};
+ groupBy<V, A, T: { [id: any]: A }>(
object: T,
iteratee?: ValueOnlyIteratee<A>
): { [key: V]: Array<A> };
- includes<T>(array: $ReadOnlyArray<T>, value: T, fromIndex?: ?number): boolean;
- includes<T>(array: void | null, value?: ?T, fromIndex?: ?number): false;
+ includes<T>(
+ array: $ReadOnlyArray<T>,
+ value: T,
+ fromIndex?: ?number
+ ): boolean;
+ includes<T>(array: void | null, value?: ?T, fromIndex?: ?number): false;
includes<T: Object>(object: T, value: any, fromIndex?: number): boolean;
includes(str: string, value: string, fromIndex?: number): boolean;
invokeMap<T>(
- array?: ?Array<T>,
- path?: ?((value: T) => Array<string> | string) | Array<string> | string,
+ array?: ?$ReadOnlyArray<T>,
+ path?: ?((value: T) => Path) | Path,
...args?: Array<any>
): Array<any>;
invokeMap<T: Object>(
object: T,
- path: ((value: any) => Array<string> | string) | Array<string> | string,
+ path: ((value: any) => Path) | Path,
...args?: Array<any>
): Array<any>;
keyBy<T, V>(
array: $ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
- ): { [key: V]: ?T };
- keyBy(
- array: void | null,
- iteratee?: ?ValueOnlyIteratee<*>
- ): {};
+ ): { [key: V]: T };
+ keyBy(array: void | null, iteratee?: ?ValueOnlyIteratee<*>): {};
keyBy<V, A, I, T: { [id: I]: A }>(
object: T,
iteratee?: ?ValueOnlyIteratee<A>
- ): { [key: V]: ?A };
+ ): { [key: V]: A };
map<T, U>(array?: ?Array<T>, iteratee?: ?MapIterator<T, U>): Array<U>;
map<T, U>(
array: ?$ReadOnlyArray<T>,
iteratee?: ReadOnlyMapIterator<T, U>
- ): Array<U>,
+ ): Array<U>;
map<V, T: Object, U>(
object: ?T,
iteratee?: OMapIterator<V, T, U>
@@ -649,15 +681,15 @@ declare module "lodash" {
orders?: $ReadOnlyArray<"asc" | "desc"> | string
): Array<V>;
partition<T>(
- array?: ?Array<T>,
+ array?: ?$ReadOnlyArray<T>,
predicate?: ?Predicate<T>
): [Array<T>, Array<T>];
- partition<V, A, T: { [id: string]: A }>(
+ partition<V, A, T: { [id: any]: A }>(
object: T,
predicate?: OPredicate<A, T>
): [Array<V>, Array<V>];
reduce<T, U>(
- array: Array<T>,
+ array: $ReadOnlyArray<T>,
iteratee?: (
accumulator: U,
value: T,
@@ -667,7 +699,7 @@ declare module "lodash" {
accumulator?: U
): U;
reduce<T, U>(
- array: void | null,
+ array: void | null,
iteratee?: ?(
accumulator: U,
value: T,
@@ -675,14 +707,14 @@ declare module "lodash" {
array: ?Array<T>
) => U,
accumulator?: ?U
- ): void | null;
+ ): void | null;
reduce<T: Object, U>(
object: T,
iteratee?: (accumulator: U, value: any, key: string, object: T) => U,
accumulator?: U
): U;
reduceRight<T, U>(
- array: void | null,
+ array: void | null,
iteratee?: ?(
accumulator: U,
value: T,
@@ -690,9 +722,9 @@ declare module "lodash" {
array: ?Array<T>
) => U,
accumulator?: ?U
- ): void | null;
+ ): void | null;
reduceRight<T, U>(
- array: Array<T>,
+ array: $ReadOnlyArray<T>,
iteratee?: ?(
accumulator: U,
value: T,
@@ -707,7 +739,7 @@ declare module "lodash" {
accumulator?: ?U
): U;
reject<T>(array: ?$ReadOnlyArray<T>, predicate?: Predicate<T>): Array<T>;
- reject<V: Object, A, T: { [id: string]: A }>(
+ reject<V: Object, A, T: { [id: any]: A }>(
object?: ?T,
predicate?: ?OPredicate<A, T>
): Array<V>;
@@ -718,9 +750,9 @@ declare module "lodash" {
shuffle<T>(array: ?Array<T>): Array<T>;
shuffle<V, T: Object>(object: T): Array<V>;
size(collection: $ReadOnlyArray<any> | Object | string): number;
+ some<T>(array: void | null, predicate?: ?Predicate<T>): false;
some<T>(array: ?$ReadOnlyArray<T>, predicate?: Predicate<T>): boolean;
- some<T>(array: void | null, predicate?: ?Predicate<T>): false;
- some<A, T: { [id: string]: A }>(
+ some<A, T: { [id: any]: A }>(
object?: ?T,
predicate?: OPredicate<A, T>
): boolean;
@@ -748,33 +780,33 @@ declare module "lodash" {
after(n: number, fn: Function): Function;
ary(func: Function, n?: number): Function;
before(n: number, fn: Function): Function;
- bind(func: Function, thisArg: any, ...partials: Array<any>): Function;
+ bind<F:(...any[]) => any>(func: F, thisArg: any, ...partials: Array<any>): F;
bindKey(obj?: ?Object, key?: ?string, ...partials?: Array<?any>): Function;
curry: Curry;
curry(func: Function, arity?: number): Function;
curryRight(func: Function, arity?: number): Function;
- debounce<F: Function>(func: F, wait?: number, options?: DebounceOptions): F;
- defer(func: Function, ...args?: Array<any>): TimeoutID;
+ debounce<F: (...any[]) => any>(func: F, wait?: number, options?: DebounceOptions): F;
+ defer(func: (...any[]) => any, ...args?: Array<any>): TimeoutID;
delay(func: Function, wait: number, ...args?: Array<any>): TimeoutID;
- flip(func: Function): Function;
- memoize<F: Function>(func: F, resolver?: Function): F;
- negate(predicate: Function): Function;
- once(func: Function): Function;
+ flip<R>(func: (...any[]) => R): (...any[]) => R;
+ memoize<A, R>(func: (...A) => R, resolver?: (...A) => any): (...A) => R;
+ negate<A, R>(predicate: (...A) => R): (...A) => boolean;
+ once<F: (...any[]) => any>(func: F): F;
overArgs(func?: ?Function, ...transforms?: Array<Function>): Function;
overArgs(func?: ?Function, transforms?: ?Array<Function>): Function;
- partial(func: Function, ...partials: any[]): Function;
- partialRight(func: Function, ...partials: Array<any>): Function;
- partialRight(func: Function, partials: Array<any>): Function;
+ partial<R>(func: (...any[]) => R, ...partials: any[]): (...any[]) => R;
+ partialRight<R>(func: (...any[]) => R, ...partials: Array<any>): (...any[]) => R;
+ partialRight<R>(func: (...any[]) => R, partials: Array<any>): (...any[]) => R;
rearg(func: Function, ...indexes: Array<number>): Function;
rearg(func: Function, indexes: Array<number>): Function;
rest(func: Function, start?: number): Function;
spread(func: Function): Function;
- throttle(
- func: Function,
+ throttle<F: (...any[]) => any>(
+ func: F,
wait?: number,
options?: ThrottleOptions
- ): Function;
- unary(func: Function): Function;
+ ): F;
+ unary<F: (...any[]) => any>(func: F): F;
wrap(value?: any, wrapper?: ?Function): Function;
// Lang
@@ -796,15 +828,15 @@ declare module "lodash" {
eq(value: any, other: any): boolean;
gt(value: any, other: any): boolean;
gte(value: any, other: any): boolean;
- isArguments(value: void | null): false;
+ isArguments(value: void | null): false;
isArguments(value: any): boolean;
isArray(value: Array<any>): true;
isArray(value: any): false;
isArrayBuffer(value: ArrayBuffer): true;
isArrayBuffer(value: any): false;
- isArrayLike(value: Array<any> | string | {length: number}): true;
+ isArrayLike(value: Array<any> | string | { length: number }): true;
isArrayLike(value: any): false;
- isArrayLikeObject(value: {length: number} | Array<any>): true;
+ isArrayLikeObject(value: { length: number } | Array<any>): true;
isArrayLikeObject(value: any): false;
isBoolean(value: boolean): true;
isBoolean(value: any): false;
@@ -814,7 +846,7 @@ declare module "lodash" {
isDate(value: any): false;
isElement(value: Element): true;
isElement(value: any): false;
- isEmpty(value: void | null | '' | {} | [] | number | boolean): true;
+ isEmpty(value: void | null | "" | {} | [] | number | boolean): true;
isEmpty(value: any): boolean;
isEqual(value: any, other: any): boolean;
isEqualWith<T, U>(
@@ -837,7 +869,7 @@ declare module "lodash" {
isFunction(value: any): false;
isInteger(value: number): boolean;
isInteger(value: any): false;
- isLength(value: void | null): false;
+ isLength(value: void | null): false;
isLength(value: any): boolean;
isMap(value: Map<any, any>): true;
isMap(value: any): false;
@@ -853,22 +885,20 @@ declare module "lodash" {
source: U
) => boolean | void
): boolean;
- isNaN(value: Function | string | void | null | Object): false;
isNaN(value: number): boolean;
- isNative(value: number | string | void | null | Object): false;
+ isNaN(value: any): false;
+ isNative(value: number | string | void | null | Object): false;
isNative(value: any): boolean;
- isNil(value: void | null): true;
+ isNil(value: void | null): true;
isNil(value: any): false;
isNull(value: null): true;
isNull(value: any): false;
isNumber(value: number): true;
isNumber(value: any): false;
- isObject(value: Object): true;
- isObject(value: any): false;
- isObjectLike(value: void | null): false;
+ isObject(value: any): boolean;
+ isObjectLike(value: void | null): false;
isObjectLike(value: any): boolean;
- isPlainObject(value: Object): true;
- isPlainObject(value: any): false;
+ isPlainObject(value: any): boolean;
isRegExp(value: RegExp): true;
isRegExp(value: any): false;
isSafeInteger(value: number): boolean;
@@ -876,9 +906,7 @@ declare module "lodash" {
isSet(value: Set<any>): true;
isSet(value: any): false;
isString(value: string): true;
- isString(
- value: number | boolean | Function | void | null | Object | Array<any>
- ): false;
+ isString(value: any): false;
isSymbol(value: Symbol): true;
isSymbol(value: any): false;
isTypedArray(value: $TypedArray): true;
@@ -892,18 +920,18 @@ declare module "lodash" {
lt(value: any, other: any): boolean;
lte(value: any, other: any): boolean;
toArray(value: any): Array<any>;
- toFinite(value: void | null): 0;
+ toFinite(value: void | null): 0;
toFinite(value: any): number;
- toInteger(value: void | null): 0;
+ toInteger(value: void | null): 0;
toInteger(value: any): number;
- toLength(value: void | null): 0;
+ toLength(value: void | null): 0;
toLength(value: any): number;
- toNumber(value: void | null): 0;
+ toNumber(value: void | null): 0;
toNumber(value: any): number;
toPlainObject(value: any): Object;
- toSafeInteger(value: void | null): 0;
+ toSafeInteger(value: void | null): 0;
toSafeInteger(value: any): number;
- toString(value: void | null): '';
+ toString(value: void | null): "";
toString(value: any): string;
// Math
@@ -912,16 +940,16 @@ declare module "lodash" {
divide(dividend: number, divisor: number): number;
floor(number: number, precision?: number): number;
max<T>(array: ?Array<T>): T;
- maxBy<T>(array: ?Array<T>, iteratee?: Iteratee<T>): T;
+ maxBy<T>(array: ?$ReadOnlyArray<T>, iteratee?: Iteratee<T>): T;
mean(array: Array<*>): number;
meanBy<T>(array: Array<T>, iteratee?: Iteratee<T>): number;
min<T>(array: ?Array<T>): T;
- minBy<T>(array: ?Array<T>, iteratee?: Iteratee<T>): T;
+ minBy<T>(array: ?$ReadOnlyArray<T>, iteratee?: Iteratee<T>): T;
multiply(multiplier: number, multiplicand: number): number;
round(number: number, precision?: number): number;
subtract(minuend: number, subtrahend: number): number;
sum(array: Array<*>): number;
- sumBy<T>(array: Array<T>, iteratee?: Iteratee<T>): number;
+ sumBy<T>(array: $ReadOnlyArray<T>, iteratee?: Iteratee<T>): number;
// number
clamp(number?: number, lower?: ?number, upper?: ?number): number;
@@ -1040,8 +1068,9 @@ declare module "lodash" {
): Object;
at(object?: ?Object, ...paths: Array<string>): Array<any>;
at(object?: ?Object, paths: Array<string>): Array<any>;
- create<T>(prototype: T, properties: Object): $Supertype<T>;
- create(prototype: any, properties: void | null): {};
+ create(prototype: void | null, properties: void | null): {};
+ create<T>(prototype: T, properties: Object): T;
+ create(prototype: any, properties: void | null): {};
defaults(object?: ?Object, ...sources?: Array<?Object>): Object;
defaultsDeep(object?: ?Object, ...sources?: Array<?Object>): Object;
// alias for _.toPairs
@@ -1104,59 +1133,59 @@ declare module "lodash" {
source: A | B | C | D
) => any | void
): Object;
- findKey<A, T: { [id: string]: A }>(
+ findKey<A, T: { [id: any]: A }>(
object: T,
predicate?: ?OPredicate<A, T>
): string | void;
- findKey<A, T: { [id: string]: A }>(
- object: void | null,
+ findKey<A, T: { [id: any]: A }>(
+ object: void | null,
predicate?: ?OPredicate<A, T>
): void;
- findLastKey<A, T: { [id: string]: A }>(
+ findLastKey<A, T: { [id: any]: A }>(
object: T,
predicate?: ?OPredicate<A, T>
): string | void;
- findLastKey<A, T: { [id: string]: A }>(
- object: void | null,
+ findLastKey<A, T: { [id: any]: A }>(
+ object: void | null,
predicate?: ?OPredicate<A, T>
): void;
forIn(object: Object, iteratee?: ?OIteratee<*>): Object;
- forIn(object: void | null, iteratee?: ?OIteratee<*>): null;
+ forIn(object: void | null, iteratee?: ?OIteratee<*>): null;
forInRight(object: Object, iteratee?: ?OIteratee<*>): Object;
- forInRight(object: void | null, iteratee?: ?OIteratee<*>): null;
+ forInRight(object: void | null, iteratee?: ?OIteratee<*>): null;
forOwn(object: Object, iteratee?: ?OIteratee<*>): Object;
- forOwn(object: void | null, iteratee?: ?OIteratee<*>): null;
+ forOwn(object: void | null, iteratee?: ?OIteratee<*>): null;
forOwnRight(object: Object, iteratee?: ?OIteratee<*>): Object;
- forOwnRight(object: void | null, iteratee?: ?OIteratee<*>): null;
+ forOwnRight(object: void | null, iteratee?: ?OIteratee<*>): null;
functions(object?: ?Object): Array<string>;
functionsIn(object?: ?Object): Array<string>;
get(
- object?: ?Object | ?$ReadOnlyArray<any>,
- path?: ?$ReadOnlyArray<string> | string,
+ object?: ?Object | ?$ReadOnlyArray<any> | void | null,
+ path?: ?Path,
defaultValue?: any
): any;
- has(object: Object, path: Array<string> | string): boolean;
- has(object: Object, path: void | null): false;
- has(object: void | null, path?: ?Array<string> | ?string): false;
- hasIn(object: Object, path: Array<string> | string): boolean;
- hasIn(object: Object, path: void | null): false;
- hasIn(object: void | null, path?: ?Array<string> | ?string): false;
+ has(object: Object, path: Path): boolean;
+ has(object: Object, path: void | null): false;
+ has(object: void | null, path?: ?Path): false;
+ hasIn(object: Object, path: Path): boolean;
+ hasIn(object: Object, path: void | null): false;
+ hasIn(object: void | null, path?: ?Path): false;
invert(object: Object, multiVal?: ?boolean): Object;
- invert(object: void | null, multiVal?: ?boolean): {};
+ invert(object: void | null, multiVal?: ?boolean): {};
invertBy(object: Object, iteratee?: ?Function): Object;
- invertBy(object: void | null, iteratee?: ?Function): {};
+ invertBy(object: void | null, iteratee?: ?Function): {};
invoke(
object?: ?Object,
- path?: ?Array<string> | string,
+ path?: ?Path,
...args?: Array<any>
): any;
keys<K>(object?: ?{ [key: K]: any }): Array<K>;
keys(object?: ?Object): Array<string>;
keysIn(object?: ?Object): Array<string>;
mapKeys(object: Object, iteratee?: ?OIteratee<*>): Object;
- mapKeys(object: void | null, iteratee?: ?OIteratee<*>): {};
+ mapKeys(object: void | null, iteratee?: ?OIteratee<*>): {};
mapValues(object: Object, iteratee?: ?OIteratee<*>): Object;
- mapValues(object: void | null, iteratee?: ?OIteratee<*>): {};
+ mapValues(object: void | null, iteratee?: ?OIteratee<*>): {};
merge(object?: ?Object, ...sources?: Array<?Object>): Object;
mergeWith(): {};
mergeWith<T: Object, A: Object>(
@@ -1210,43 +1239,38 @@ declare module "lodash" {
): Object;
omit(object?: ?Object, ...props: Array<string>): Object;
omit(object?: ?Object, props: Array<string>): Object;
- omitBy<A, T: { [id: string]: A }>(
+ omitBy<A, T: { [id: any]: A } | { [id: number]: A }>(
object: T,
predicate?: ?OPredicate<A, T>
): Object;
- omitBy<A, T: void | null>(
- object: T,
- predicate?: ?OPredicate<A, T>
- ): {};
+ omitBy<A, T>(object: void | null, predicate?: ?OPredicate<A, T>): {};
pick(object?: ?Object, ...props: Array<string>): Object;
pick(object?: ?Object, props: Array<string>): Object;
- pickBy<A, T: { [id: string]: A }>(
+ pickBy<A, T: { [id: any]: A } | { [id: number]: A }>(
object: T,
predicate?: ?OPredicate<A, T>
): Object;
- pickBy<A, T: void | null>(
- object: T,
- predicate?: ?OPredicate<A, T>
- ): {};
+ pickBy<A, T>(object: void | null, predicate?: ?OPredicate<A, T>): {};
result(
object?: ?Object,
- path?: ?Array<string> | string,
+ path?: ?Path,
defaultValue?: any
): any;
- set(object: Object, path?: ?Array<string> | string, value: any): Object;
- set<T: void | null>(
+ set(object: Object, path?: ?Path, value: any): Object;
+ set<T: void | null>(
object: T,
- path?: ?Array<string> | string,
- value?: ?any): T;
+ path?: ?Path,
+ value?: ?any
+ ): T;
setWith<T>(
object: T,
- path?: ?Array<string> | string,
+ path?: ?Path,
value: any,
customizer?: (nsValue: any, key: string, nsObject: T) => any
): Object;
- setWith<T: void | null>(
+ setWith<T: void | null>(
object: T,
- path?: ?Array<string> | string,
+ path?: ?Path,
value?: ?any,
customizer?: ?(nsValue: any, key: string, nsObject: T) => any
): T;
@@ -1258,26 +1282,27 @@ declare module "lodash" {
accumulator?: any
): any;
transform(
- collection: void | null,
+ collection: void | null,
iteratee?: ?OIteratee<*>,
accumulator?: ?any
): {};
- unset(object: Object, path?: ?Array<string> | ?string): boolean;
- unset(object: void | null, path?: ?Array<string> | ?string): true;
- update(object: Object, path: string[] | string, updater: Function): Object;
- update<T: void | null>(
+ unset(object: void | null, path?: ?Path): true;
+ unset(object: Object, path?: ?Path): boolean;
+ update(object: Object, path: Path, updater: Function): Object;
+ update<T: void | null>(
object: T,
- path?: ?string[] | ?string,
- updater?: ?Function): T;
+ path?: ?Path,
+ updater?: ?Function
+ ): T;
updateWith(
object: Object,
- path?: ?string[] | ?string,
+ path?: ?Path,
updater?: ?Function,
customizer?: ?Function
): Object;
- updateWith<T: void | null>(
+ updateWith<T: void | null>(
object: T,
- path?: ?string[] | ?string,
+ path?: ?Path,
updater?: ?Function,
customizer?: ?Function
): T;
@@ -1294,93 +1319,97 @@ declare module "lodash" {
// String
camelCase(string: string): string;
- camelCase(string: void | null): '';
+ camelCase(string: void | null): "";
capitalize(string: string): string;
- capitalize(string: void | null): '';
+ capitalize(string: void | null): "";
deburr(string: string): string;
- deburr(string: void | null): '';
+ deburr(string: void | null): "";
endsWith(string: string, target?: string, position?: ?number): boolean;
- endsWith(string: void | null, target?: ?string, position?: ?number): false;
+ endsWith(string: void | null, target?: ?string, position?: ?number): false;
escape(string: string): string;
- escape(string: void | null): '';
+ escape(string: void | null): "";
escapeRegExp(string: string): string;
- escapeRegExp(string: void | null): '';
+ escapeRegExp(string: void | null): "";
kebabCase(string: string): string;
- kebabCase(string: void | null): '';
+ kebabCase(string: void | null): "";
lowerCase(string: string): string;
- lowerCase(string: void | null): '';
+ lowerCase(string: void | null): "";
lowerFirst(string: string): string;
- lowerFirst(string: void | null): '';
+ lowerFirst(string: void | null): "";
pad(string?: ?string, length?: ?number, chars?: ?string): string;
padEnd(string?: ?string, length?: ?number, chars?: ?string): string;
padStart(string?: ?string, length?: ?number, chars?: ?string): string;
parseInt(string: string, radix?: ?number): number;
repeat(string: string, n?: ?number): string;
- repeat(string: void | null, n?: ?number): '';
+ repeat(string: void | null, n?: ?number): "";
replace(
string: string,
pattern: RegExp | string,
replacement: ((string: string) => string) | string
): string;
replace(
- string: void | null,
+ string: void | null,
pattern?: ?RegExp | ?string,
replacement: ?((string: string) => string) | ?string
- ): '';
+ ): "";
snakeCase(string: string): string;
- snakeCase(string: void | null): '';
+ snakeCase(string: void | null): "";
split(
string?: ?string,
separator?: ?RegExp | ?string,
limit?: ?number
): Array<string>;
startCase(string: string): string;
- startCase(string: void | null): '';
+ startCase(string: void | null): "";
startsWith(string: string, target?: string, position?: number): boolean;
- startsWith(string: void | null, target?: ?string, position?: ?number): false;
+ startsWith(
+ string: void | null,
+ target?: ?string,
+ position?: ?number
+ ): false;
template(string?: ?string, options?: ?TemplateSettings): Function;
toLower(string: string): string;
- toLower(string: void | null): '';
+ toLower(string: void | null): "";
toUpper(string: string): string;
- toUpper(string: void | null): '';
+ toUpper(string: void | null): "";
trim(string: string, chars?: string): string;
- trim(string: void | null, chars?: ?string): '';
+ trim(string: void | null, chars?: ?string): "";
trimEnd(string: string, chars?: ?string): string;
- trimEnd(string: void | null, chars?: ?string): '';
+ trimEnd(string: void | null, chars?: ?string): "";
trimStart(string: string, chars?: ?string): string;
- trimStart(string: void | null, chars?: ?string): '';
+ trimStart(string: void | null, chars?: ?string): "";
truncate(string: string, options?: TruncateOptions): string;
- truncate(string: void | null, options?: ?TruncateOptions): '';
+ truncate(string: void | null, options?: ?TruncateOptions): "";
unescape(string: string): string;
- unescape(string: void | null): '';
+ unescape(string: void | null): "";
upperCase(string: string): string;
- upperCase(string: void | null): '';
+ upperCase(string: void | null): "";
upperFirst(string: string): string;
- upperFirst(string: void | null): '';
+ upperFirst(string: void | null): "";
words(string?: ?string, pattern?: ?RegExp | ?string): Array<string>;
// Util
attempt(func: Function, ...args: Array<any>): any;
bindAll(object: Object, methodNames?: ?Array<string>): Object;
- bindAll<T: void | null>(object: T, methodNames?: ?Array<string>): T;
+ bindAll<T: void | null>(object: T, methodNames?: ?Array<string>): T;
bindAll(object: Object, ...methodNames: Array<string>): Object;
cond(pairs?: ?NestedArray<Function>): Function;
conforms(source?: ?Object): Function;
constant<T>(value: T): () => T;
- defaultTo<T1: string | boolean | Object, T2>(
+ defaultTo<T1: void | null, T2>(value: T1, defaultValue: T2): T2;
+ defaultTo<T1: string | boolean, T2>(
value: T1,
defaultValue: T2
): T1;
// NaN is a number instead of its own type, otherwise it would behave like null/void
defaultTo<T1: number, T2>(value: T1, defaultValue: T2): T1 | T2;
- defaultTo<T1: void | null, T2>(value: T1, defaultValue: T2): T2;
- flow: ($ComposeReverse & (funcs: Array<Function>) => Function);
- flowRight: ($Compose & (funcs: Array<Function>) => Function);
+ flow: $ComposeReverse & ((funcs: Array<Function>) => Function);
+ flowRight: $Compose & ((funcs: Array<Function>) => Function);
identity<T>(value: T): T;
iteratee(func?: any): Function;
matches(source?: ?Object): Function;
- matchesProperty(path?: ?Array<string> | string, srcValue: any): Function;
- method(path?: ?Array<string> | string, ...args?: Array<any>): Function;
+ matchesProperty(path?: ?Path, srcValue: any): Function;
+ method(path?: ?Path, ...args?: Array<any>): Function;
methodOf(object?: ?Object, ...args?: Array<any>): Function;
mixin<T: Function | Object>(
object?: T,
@@ -1396,7 +1425,7 @@ declare module "lodash" {
overEvery(predicates: Array<Function>): Function;
overSome(...predicates: Array<Function>): Function;
overSome(predicates: Array<Function>): Function;
- property(path?: ?Array<string> | string): Function;
+ property(path?: ?Path): Function;
propertyOf(object?: ?Object): Function;
range(start: number, end: number, step?: number): Array<number>;
range(end: number, step?: number): Array<number>;
@@ -1409,7 +1438,7 @@ declare module "lodash" {
stubObject(): {};
stubString(): "";
stubTrue(): true;
- times(n?: ?number, ...rest?: Array<void | null>): Array<number>;
+ times(n?: ?number, ...rest?: Array<void | null>): Array<number>;
times<T>(n: number, iteratee: (i: number) => T): Array<T>;
toPath(value: any): Array<string>;
uniqueId(prefix?: ?string): string;
@@ -1423,6 +1452,7 @@ declare module "lodash" {
}
declare module "lodash/fp" {
+ declare type Path = $ReadOnlyArray<string | number> | string | number;
declare type __CurriedFunction1<A, R, AA: A> = (...r: [AA]) => R;
declare type CurriedFunction1<A, R> = __CurriedFunction1<A, R, *>;
@@ -1582,7 +1612,7 @@ declare module "lodash/fp" {
declare type NestedArray<T> = Array<Array<T>>;
- declare type matchesIterateeShorthand = Object;
+ declare type matchesIterateeShorthand = {[string | number]: any};
declare type matchesPropertyIterateeShorthand = [string, any];
declare type propertyIterateeShorthand = string;
@@ -1646,12 +1676,12 @@ declare module "lodash/fp" {
array: $ReadOnlyArray<T>
): T[];
differenceWith<T>(
- comparator: Comparator<T>,
+ comparator: Comparator<T>
): ((first: $ReadOnly<T>) => (second: $ReadOnly<T>) => T[]) &
((first: $ReadOnly<T>, second: $ReadOnly<T>) => T[]);
differenceWith<T>(
comparator: Comparator<T>,
- first: $ReadOnly<T>,
+ first: $ReadOnly<T>
): (second: $ReadOnly<T>) => T[];
differenceWith<T>(
comparator: Comparator<T>,
@@ -1858,10 +1888,7 @@ declare module "lodash/fp" {
sortedLastIndexOf<T>(value: T): (array: Array<T>) => number;
sortedLastIndexOf<T>(value: T, array: Array<T>): number;
sortedUniq<T>(array: Array<T>): Array<T>;
- sortedUniqBy<T>(
- iteratee: (value: T) => mixed
- ): (array: Array<T>) => Array<T>;
- sortedUniqBy<T>(iteratee: (value: T) => mixed, array: Array<T>): Array<T>;
+ sortedUniqBy<T>(iteratee: ValueOnlyIteratee<T>, array: Array<T>): Array<T>;
tail<T>(array: Array<T>): Array<T>;
take<T>(n: number): (array: Array<T>) => Array<T>;
take<T>(n: number, array: Array<T>): Array<T>;
@@ -2158,14 +2185,14 @@ declare module "lodash/fp" {
): (collection: Array<T>) => boolean;
includesFrom<T>(value: T, fromIndex: number, collection: Array<T>): boolean;
invokeMap<T>(
- path: ((value: T) => Array<string> | string) | Array<string> | string
+ path: ((value: T) => Path) | Path
): (collection: Array<T> | { [id: any]: T }) => Array<any>;
invokeMap<T>(
- path: ((value: T) => Array<string> | string) | Array<string> | string,
+ path: ((value: T) => Path) | Path,
collection: Array<T> | { [id: any]: T }
): Array<any>;
invokeArgsMap<T>(
- path: ((value: T) => Array<string> | string) | Array<string> | string
+ path: ((value: T) => Path) | Path
): ((
collection: Array<T> | { [id: any]: T }
) => (args: Array<any>) => Array<any>) &
@@ -2174,11 +2201,11 @@ declare module "lodash/fp" {
args: Array<any>
) => Array<any>);
invokeArgsMap<T>(
- path: ((value: T) => Array<string> | string) | Array<string> | string,
+ path: ((value: T) => Path) | Path,
collection: Array<T> | { [id: any]: T }
): (args: Array<any>) => Array<any>;
invokeArgsMap<T>(
- path: ((value: T) => Array<string> | string) | Array<string> | string,
+ path: ((value: T) => Path) | Path,
collection: Array<T> | { [id: any]: T },
args: Array<any>
): Array<any>;
@@ -2294,15 +2321,17 @@ declare module "lodash/fp" {
collection: $ReadOnlyArray<T> | { [id: any]: T }
): boolean;
sortBy<T>(
- iteratees: | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
- | Iteratee<T>
- | OIteratee<T>
+ iteratees:
+ | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
+ | Iteratee<T>
+ | OIteratee<T>
): (collection: $ReadOnlyArray<T> | { [id: any]: T }) => Array<T>;
sortBy<T>(
- iteratees: | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
- | Iteratee<T>
- | OIteratee<T>,
- collection: $ReadOnlyArray<T> | { [id: any]: T },
+ iteratees:
+ | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
+ | Iteratee<T>
+ | OIteratee<T>,
+ collection: $ReadOnlyArray<T> | { [id: any]: T }
): Array<T>;
// Date
@@ -2326,14 +2355,14 @@ declare module "lodash/fp" {
curryRight(func: Function): Function;
curryRightN(arity: number): (func: Function) => Function;
curryRightN(arity: number, func: Function): Function;
- debounce(wait: number): <F: Function>(func: F) => F;
- debounce<F: Function>(wait: number, func: F): F;
- defer(func: Function): TimeoutID;
+ debounce(wait: number): <A, R>(func: (...A) => R) => (...A) => R;
+ debounce<A, R>(wait: number, func: (...A) => R): (...A) => R;
+ defer(func: (...any[]) => any): TimeoutID;
delay(wait: number): (func: Function) => TimeoutID;
delay(wait: number, func: Function): TimeoutID;
flip(func: Function): Function;
memoize<F: Function>(func: F): F;
- negate(predicate: Function): Function;
+ negate<A, R>(predicate: (...A) => R): (...A) => boolean;
complement(predicate: Function): Function;
once(func: Function): Function;
overArgs(func: Function): (transforms: Array<Function>) => Function;
@@ -2354,9 +2383,9 @@ declare module "lodash/fp" {
apply(func: Function): Function;
spreadFrom(start: number): (func: Function) => Function;
spreadFrom(start: number, func: Function): Function;
- throttle(wait: number): (func: Function) => Function;
- throttle(wait: number, func: Function): Function;
- unary(func: Function): Function;
+ throttle<A, R>(wait: number): (func: (...A) => R) => (...A) => R;
+ throttle<A, R>(wait: number, func: (...A) => R): (...A) => R;
+ unary<T, R>(func: (T, ...any[]) => R): (T) => R;
wrap(wrapper: Function): (value: any) => Function;
wrap(wrapper: Function, value: any): Function;
@@ -2457,8 +2486,7 @@ declare module "lodash/fp" {
): boolean;
isError(value: any): boolean;
isFinite(value: any): boolean;
- isFunction(value: Function): true;
- isFunction(value: number | string | void | null | Object): false;
+ isFunction(value: any): boolean;
isInteger(value: any): boolean;
isLength(value: any): boolean;
isMap(value: any): boolean;
@@ -2509,9 +2537,7 @@ declare module "lodash/fp" {
isSafeInteger(value: any): boolean;
isSet(value: any): boolean;
isString(value: string): true;
- isString(
- value: number | boolean | Function | void | null | Object | Array<any>
- ): false;
+ isString(value: any): false;
isSymbol(value: any): boolean;
isTypedArray(value: any): boolean;
isUndefined(value: any): boolean;
@@ -2702,7 +2728,7 @@ declare module "lodash/fp" {
props(paths: Array<string>, object: Object): Array<any>;
paths(paths: Array<string>): (object: Object) => Array<any>;
paths(paths: Array<string>, object: Object): Array<any>;
- create<T>(prototype: T): $Supertype<T>;
+ create<T>(prototype: T): T;
defaults(source: Object): (object: Object) => Object;
defaults(source: Object, object: Object): Object;
defaultsAll(objects: Array<Object>): Object;
@@ -2771,77 +2797,85 @@ declare module "lodash/fp" {
forOwnRight(iteratee: OIteratee<*>, object: Object): Object;
functions(object: Object): Array<string>;
functionsIn(object: Object): Array<string>;
- get(path: $ReadOnlyArray<string> | string): (object: Object | $ReadOnlyArray<any>) => any;
- get(path: $ReadOnlyArray<string> | string, object: Object | $ReadOnlyArray<any>): any;
- prop(path: Array<string> | string): (object: Object | Array<any>) => any;
- prop(path: Array<string> | string, object: Object | Array<any>): any;
- path(path: Array<string> | string): (object: Object | Array<any>) => any;
- path(path: Array<string> | string, object: Object | Array<any>): any;
+ get(
+ path: Path
+ ): (object: Object | $ReadOnlyArray<any> | void | null) => any;
+ get(
+ path: Path,
+ object: Object | $ReadOnlyArray<any> | void | null
+ ): any;
+ prop(path: Path): (object: Object | Array<any>) => any;
+ prop(path: Path, object: Object | Array<any>): any;
+ path(path: Path): (object: Object | Array<any>) => any;
+ path(path: Path, object: Object | Array<any>): any;
getOr(
defaultValue: any
): ((
- path: Array<string> | string
+ path: Path
) => (object: Object | Array<any>) => any) &
- ((path: Array<string> | string, object: Object | Array<any>) => any);
+ ((
+ path: Path,
+ object: Object | $ReadOnlyArray<any> | void | null
+ ) => any);
getOr(
defaultValue: any,
- path: Array<string> | string
- ): (object: Object | Array<any>) => any;
+ path: Path
+ ): (object: Object | $ReadOnlyArray<any> | void | null) => any;
getOr(
defaultValue: any,
- path: Array<string> | string,
- object: Object | Array<any>
+ path: Path,
+ object: Object | $ReadOnlyArray<any> | void | null
): any;
propOr(
defaultValue: any
): ((
- path: Array<string> | string
+ path: Path
) => (object: Object | Array<any>) => any) &
- ((path: Array<string> | string, object: Object | Array<any>) => any);
+ ((path: Path, object: Object | Array<any>) => any);
propOr(
defaultValue: any,
- path: Array<string> | string
+ path: Path
): (object: Object | Array<any>) => any;
propOr(
defaultValue: any,
- path: Array<string> | string,
+ path: Path,
object: Object | Array<any>
): any;
pathOr(
defaultValue: any
): ((
- path: Array<string> | string
+ path: Path
) => (object: Object | Array<any>) => any) &
- ((path: Array<string> | string, object: Object | Array<any>) => any);
+ ((path: Path, object: Object | Array<any>) => any);
pathOr(
defaultValue: any,
- path: Array<string> | string
+ path: Path
): (object: Object | Array<any>) => any;
pathOr(
defaultValue: any,
- path: Array<string> | string,
+ path: Path,
object: Object | Array<any>
): any;
- has(path: Array<string> | string): (object: Object) => boolean;
- has(path: Array<string> | string, object: Object): boolean;
- hasIn(path: Array<string> | string): (object: Object) => boolean;
- hasIn(path: Array<string> | string, object: Object): boolean;
+ has(path: Path): (object: Object) => boolean;
+ has(path: Path, object: Object): boolean;
+ hasIn(path: Path): (object: Object) => boolean;
+ hasIn(path: Path, object: Object): boolean;
invert(object: Object): Object;
invertObj(object: Object): Object;
invertBy(iteratee: Function): (object: Object) => Object;
invertBy(iteratee: Function, object: Object): Object;
- invoke(path: Array<string> | string): (object: Object) => any;
- invoke(path: Array<string> | string, object: Object): any;
+ invoke(path: Path): (object: Object) => any;
+ invoke(path: Path, object: Object): any;
invokeArgs(
- path: Array<string> | string
+ path: Path
): ((object: Object) => (args: Array<any>) => any) &
((object: Object, args: Array<any>) => any);
invokeArgs(
- path: Array<string> | string,
+ path: Path,
object: Object
): (args: Array<any>) => any;
invokeArgs(
- path: Array<string> | string,
+ path: Path,
object: Object,
args: Array<any>
): any;
@@ -2920,50 +2954,50 @@ declare module "lodash/fp" {
predicate: OPredicate<A>
): (object: T) => Object;
pickBy<A, T: { [id: any]: A }>(predicate: OPredicate<A>, object: T): Object;
- result(path: Array<string> | string): (object: Object) => any;
- result(path: Array<string> | string, object: Object): any;
+ result(path: Path): (object: Object) => any;
+ result(path: Path, object: Object): any;
set(
- path: Array<string> | string
+ path: Path
): ((value: any) => (object: Object) => Object) &
((value: any, object: Object) => Object);
- set(path: Array<string> | string, value: any): (object: Object) => Object;
- set(path: Array<string> | string, value: any, object: Object): Object;
+ set(path: Path, value: any): (object: Object) => Object;
+ set(path: Path, value: any, object: Object): Object;
assoc(
- path: Array<string> | string
+ path: Path
): ((value: any) => (object: Object) => Object) &
((value: any, object: Object) => Object);
- assoc(path: Array<string> | string, value: any): (object: Object) => Object;
- assoc(path: Array<string> | string, value: any, object: Object): Object;
+ assoc(path: Path, value: any): (object: Object) => Object;
+ assoc(path: Path, value: any, object: Object): Object;
assocPath(
- path: Array<string> | string
+ path: Path
): ((value: any) => (object: Object) => Object) &
((value: any, object: Object) => Object);
assocPath(
- path: Array<string> | string,
+ path: Path,
value: any
): (object: Object) => Object;
- assocPath(path: Array<string> | string, value: any, object: Object): Object;
+ assocPath(path: Path, value: any, object: Object): Object;
setWith<T>(
customizer: (nsValue: any, key: string, nsObject: T) => any
): ((
- path: Array<string> | string
+ path: Path
) => ((value: any) => (object: T) => Object) &
((value: any, object: T) => Object)) &
- ((path: Array<string> | string, value: any) => (object: T) => Object) &
- ((path: Array<string> | string, value: any, object: T) => Object);
+ ((path: Path, value: any) => (object: T) => Object) &
+ ((path: Path, value: any, object: T) => Object);
setWith<T>(
customizer: (nsValue: any, key: string, nsObject: T) => any,
- path: Array<string> | string
+ path: Path
): ((value: any) => (object: T) => Object) &
((value: any, object: T) => Object);
setWith<T>(
customizer: (nsValue: any, key: string, nsObject: T) => any,
- path: Array<string> | string,
+ path: Path,
value: any
): (object: T) => Object;
setWith<T>(
customizer: (nsValue: any, key: string, nsObject: T) => any,
- path: Array<string> | string,
+ path: Path,
value: any,
object: T
): Object;
@@ -2984,45 +3018,45 @@ declare module "lodash/fp" {
accumulator: any,
collection: Object | $ReadOnlyArray<any>
): any;
- unset(path: Array<string> | string): (object: Object) => Object;
- unset(path: Array<string> | string, object: Object): Object;
- dissoc(path: Array<string> | string): (object: Object) => Object;
- dissoc(path: Array<string> | string, object: Object): Object;
- dissocPath(path: Array<string> | string): (object: Object) => Object;
- dissocPath(path: Array<string> | string, object: Object): Object;
+ unset(path: Path): (object: Object) => Object;
+ unset(path: Path, object: Object): Object;
+ dissoc(path: Path): (object: Object) => Object;
+ dissoc(path: Path, object: Object): Object;
+ dissocPath(path: Path): (object: Object) => Object;
+ dissocPath(path: Path, object: Object): Object;
update(
- path: string[] | string
+ path: Path
): ((updater: Function) => (object: Object) => Object) &
((updater: Function, object: Object) => Object);
update(
- path: string[] | string,
+ path: Path,
updater: Function
): (object: Object) => Object;
- update(path: string[] | string, updater: Function, object: Object): Object;
+ update(path: Path, updater: Function, object: Object): Object;
updateWith(
customizer: Function
): ((
- path: string[] | string
+ path: Path
) => ((updater: Function) => (object: Object) => Object) &
((updater: Function, object: Object) => Object)) &
((
- path: string[] | string,
+ path: Path,
updater: Function
) => (object: Object) => Object) &
- ((path: string[] | string, updater: Function, object: Object) => Object);
+ ((path: Path, updater: Function, object: Object) => Object);
updateWith(
customizer: Function,
- path: string[] | string
+ path: Path
): ((updater: Function) => (object: Object) => Object) &
((updater: Function, object: Object) => Object);
updateWith(
customizer: Function,
- path: string[] | string,
+ path: Path,
updater: Function
): (object: Object) => Object;
updateWith(
customizer: Function,
- path: string[] | string,
+ path: Path,
updater: Function,
object: Object
): Object;
@@ -3123,34 +3157,34 @@ declare module "lodash/fp" {
cond(pairs: NestedArray<Function>): Function;
constant<T>(value: T): () => T;
always<T>(value: T): () => T;
- defaultTo<T1: string | boolean | Object, T2>(
+ defaultTo<T1: void | null, T2>(defaultValue: T2): (value: T1) => T2;
+ defaultTo<T1: void | null, T2>(defaultValue: T2, value: T1): T2;
+ defaultTo<T1: string | boolean, T2>(
defaultValue: T2
): (value: T1) => T1;
- defaultTo<T1: string | boolean | Object, T2>(
+ defaultTo<T1: string | boolean, T2>(
defaultValue: T2,
value: T1
): T1;
// NaN is a number instead of its own type, otherwise it would behave like null/void
defaultTo<T1: number, T2>(defaultValue: T2): (value: T1) => T1 | T2;
defaultTo<T1: number, T2>(defaultValue: T2, value: T1): T1 | T2;
- defaultTo<T1: void | null, T2>(defaultValue: T2): (value: T1) => T2;
- defaultTo<T1: void | null, T2>(defaultValue: T2, value: T1): T2;
- flow: ($ComposeReverse & (funcs: Array<Function>) => Function);
- pipe: ($ComposeReverse & (funcs: Array<Function>) => Function);
- flowRight: ($Compose & (funcs: Array<Function>) => Function);
- compose: ($Compose & (funcs: Array<Function>) => Function);
+ flow: $ComposeReverse & ((funcs: Array<Function>) => Function);
+ pipe: $ComposeReverse & ((funcs: Array<Function>) => Function);
+ flowRight: $Compose & ((funcs: Array<Function>) => Function);
+ compose: $Compose & ((funcs: Array<Function>) => Function);
compose(funcs: Array<Function>): Function;
identity<T>(value: T): T;
iteratee(func: any): Function;
matches(source: Object): (object: Object) => boolean;
matches(source: Object, object: Object): boolean;
- matchesProperty(path: Array<string> | string): (srcValue: any) => Function;
- matchesProperty(path: Array<string> | string, srcValue: any): Function;
- propEq(path: Array<string> | string): (srcValue: any) => Function;
- propEq(path: Array<string> | string, srcValue: any): Function;
- pathEq(path: Array<string> | string): (srcValue: any) => Function;
- pathEq(path: Array<string> | string, srcValue: any): Function;
- method(path: Array<string> | string): Function;
+ matchesProperty(path: Path): (srcValue: any) => Function;
+ matchesProperty(path: Path, srcValue: any): Function;
+ propEq(path: Path): (srcValue: any) => Function;
+ propEq(path: Path, srcValue: any): Function;
+ pathEq(path: Path): (srcValue: any) => Function;
+ pathEq(path: Path, srcValue: any): Function;
+ method(path: Path): Function;
methodOf(object: Object): Function;
mixin<T: Function | Object>(
object: T
@@ -3175,11 +3209,11 @@ declare module "lodash/fp" {
overSome(predicates: Array<Function>): Function;
anyPass(predicates: Array<Function>): Function;
property(
- path: Array<string> | string
+ path: Path
): (object: Object | Array<any>) => any;
- property(path: Array<string> | string, object: Object | Array<any>): any;
- propertyOf(object: Object): (path: Array<string> | string) => Function;
- propertyOf(object: Object, path: Array<string> | string): Function;
+ property(path: Path, object: Object | Array<any>): any;
+ propertyOf(object: Object): (path: Path) => Function;
+ propertyOf(object: Object, path: Path): Function;
range(start: number): (end: number) => Array<number>;
range(start: number, end: number): Array<number>;
rangeStep(
@@ -4479,7 +4513,10 @@ declare module "lodash/fp/differenceBy" {
}
declare module "lodash/fp/differenceWith" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "differenceWith">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "differenceWith"
+ >;
}
declare module "lodash/fp/drop" {
@@ -4495,7 +4532,10 @@ declare module "lodash/fp/dropRight" {
}
declare module "lodash/fp/dropRightWhile" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropRightWhile">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "dropRightWhile"
+ >;
}
declare module "lodash/fp/dropWhile" {
@@ -4523,7 +4563,10 @@ declare module "lodash/fp/findLastIndex" {
}
declare module "lodash/fp/findLastIndexFrom" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastIndexFrom">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "findLastIndexFrom"
+ >;
}
declare module "lodash/fp/first" {
@@ -4575,11 +4618,17 @@ declare module "lodash/fp/intersection" {
}
declare module "lodash/fp/intersectionBy" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "intersectionBy">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "intersectionBy"
+ >;
}
declare module "lodash/fp/intersectionWith" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "intersectionWith">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "intersectionWith"
+ >;
}
declare module "lodash/fp/join" {
@@ -4595,7 +4644,10 @@ declare module "lodash/fp/lastIndexOf" {
}
declare module "lodash/fp/lastIndexOfFrom" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lastIndexOfFrom">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "lastIndexOfFrom"
+ >;
}
declare module "lodash/fp/nth" {
@@ -4647,15 +4699,24 @@ declare module "lodash/fp/sortedIndexOf" {
}
declare module "lodash/fp/sortedLastIndex" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedLastIndex">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "sortedLastIndex"
+ >;
}
declare module "lodash/fp/sortedLastIndexBy" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedLastIndexBy">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "sortedLastIndexBy"
+ >;
}
declare module "lodash/fp/sortedLastIndexOf" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedLastIndexOf">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "sortedLastIndexOf"
+ >;
}
declare module "lodash/fp/sortedUniq" {
@@ -4683,7 +4744,10 @@ declare module "lodash/fp/takeLast" {
}
declare module "lodash/fp/takeRightWhile" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeRightWhile">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "takeRightWhile"
+ >;
}
declare module "lodash/fp/takeLastWhile" {
@@ -4735,7 +4799,10 @@ declare module "lodash/fp/xor" {
}
declare module "lodash/fp/symmetricDifference" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "symmetricDifference">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "symmetricDifference"
+ >;
}
declare module "lodash/fp/xorBy" {
@@ -4743,7 +4810,10 @@ declare module "lodash/fp/xorBy" {
}
declare module "lodash/fp/symmetricDifferenceBy" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "symmetricDifferenceBy">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "symmetricDifferenceBy"
+ >;
}
declare module "lodash/fp/xorWith" {
@@ -4751,7 +4821,10 @@ declare module "lodash/fp/xorWith" {
}
declare module "lodash/fp/symmetricDifferenceWith" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "symmetricDifferenceWith">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "symmetricDifferenceWith"
+ >;
}
declare module "lodash/fp/zip" {
@@ -5123,7 +5196,10 @@ declare module "lodash/fp/isArrayLike" {
}
declare module "lodash/fp/isArrayLikeObject" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArrayLikeObject">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "isArrayLikeObject"
+ >;
}
declare module "lodash/fp/isBoolean" {
@@ -5403,7 +5479,10 @@ declare module "lodash/fp/assignWith" {
}
declare module "lodash/fp/assignInAllWith" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignInAllWith">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "assignInAllWith"
+ >;
}
declare module "lodash/fp/extendAllWith" {
@@ -5443,7 +5522,10 @@ declare module "lodash/fp/defaultsDeep" {
}
declare module "lodash/fp/defaultsDeepAll" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultsDeepAll">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "defaultsDeepAll"
+ >;
}
declare module "lodash/fp/entries" {
@@ -5791,7 +5873,10 @@ declare module "lodash/fp/trimStart" {
}
declare module "lodash/fp/trimCharsStart" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimCharsStart">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "trimCharsStart"
+ >;
}
declare module "lodash/fp/truncate" {
@@ -5867,7 +5952,10 @@ declare module "lodash/fp/matches" {
}
declare module "lodash/fp/matchesProperty" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "matchesProperty">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "matchesProperty"
+ >;
}
declare module "lodash/fp/propEq" {
@@ -5947,7 +6035,10 @@ declare module "lodash/fp/rangeRight" {
}
declare module "lodash/fp/rangeStepRight" {
- declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rangeStepRight">;
+ declare module.exports: $PropertyType<
+ $Exports<"lodash/fp">,
+ "rangeStepRight"
+ >;
}
declare module "lodash/fp/runInContext" {
diff --git a/flow-typed/npm/moment_v2.3.x.js b/flow-typed/npm/moment_v2.3.x.js
deleted file mode 100644
index c9177b024b..0000000000
--- a/flow-typed/npm/moment_v2.3.x.js
+++ /dev/null
@@ -1,329 +0,0 @@
-// flow-typed signature: c30aa20539f52183d4d30dd36d8ab9c2
-// flow-typed version: 886cf7c002/moment_v2.3.x/flow_>=v0.63.x
-
-type moment$MomentOptions = {
- y?: number | string,
- year?: number | string,
- years?: number | string,
- M?: number | string,
- month?: number | string,
- months?: number | string,
- d?: number | string,
- day?: number | string,
- days?: number | string,
- date?: number | string,
- h?: number | string,
- hour?: number | string,
- hours?: number | string,
- m?: number | string,
- minute?: number | string,
- minutes?: number | string,
- s?: number | string,
- second?: number | string,
- seconds?: number | string,
- ms?: number | string,
- millisecond?: number | string,
- milliseconds?: number | string
-};
-
-type moment$MomentObject = {
- years: number,
- months: number,
- date: number,
- hours: number,
- minutes: number,
- seconds: number,
- milliseconds: number
-};
-
-type moment$MomentCreationData = {
- input: string,
- format: string,
- locale: Object,
- isUTC: boolean,
- strict: boolean
-};
-
-type moment$CalendarFormat = string | ((moment: moment$Moment) => string);
-
-type moment$CalendarFormats = {
- sameDay?: moment$CalendarFormat,
- nextDay?: moment$CalendarFormat,
- nextWeek?: moment$CalendarFormat,
- lastDay?: moment$CalendarFormat,
- lastWeek?: moment$CalendarFormat,
- sameElse?: moment$CalendarFormat
-};
-
-declare class moment$LocaleData {
- months(moment: moment$Moment): string,
- monthsShort(moment: moment$Moment): string,
- monthsParse(month: string): number,
- weekdays(moment: moment$Moment): string,
- weekdaysShort(moment: moment$Moment): string,
- weekdaysMin(moment: moment$Moment): string,
- weekdaysParse(weekDay: string): number,
- longDateFormat(dateFormat: string): string,
- isPM(date: string): boolean,
- meridiem(hours: number, minutes: number, isLower: boolean): string,
- calendar(
- key:
- | "sameDay"
- | "nextDay"
- | "lastDay"
- | "nextWeek"
- | "prevWeek"
- | "sameElse",
- moment: moment$Moment
- ): string,
- relativeTime(
- number: number,
- withoutSuffix: boolean,
- key: "s" | "m" | "mm" | "h" | "hh" | "d" | "dd" | "M" | "MM" | "y" | "yy",
- isFuture: boolean
- ): string,
- pastFuture(diff: any, relTime: string): string,
- ordinal(number: number): string,
- preparse(str: string): any,
- postformat(str: string): any,
- week(moment: moment$Moment): string,
- invalidDate(): string,
- firstDayOfWeek(): number,
- firstDayOfYear(): number
-}
-declare class moment$MomentDuration {
- humanize(suffix?: boolean): string,
- milliseconds(): number,
- asMilliseconds(): number,
- seconds(): number,
- asSeconds(): number,
- minutes(): number,
- asMinutes(): number,
- hours(): number,
- asHours(): number,
- days(): number,
- asDays(): number,
- months(): number,
- asMonths(): number,
- years(): number,
- asYears(): number,
- add(value: number | moment$MomentDuration | Object, unit?: string): this,
- subtract(value: number | moment$MomentDuration | Object, unit?: string): this,
- as(unit: string): number,
- get(unit: string): number,
- toJSON(): string,
- toISOString(): string,
- isValid(): boolean
-}
-declare class moment$Moment {
- static ISO_8601: string,
- static (
- string?: string,
- format?: string | Array<string>,
- strict?: boolean
- ): moment$Moment,
- static (
- string?: string,
- format?: string | Array<string>,
- locale?: string,
- strict?: boolean
- ): moment$Moment,
- static (
- initDate: ?Object | number | Date | Array<number> | moment$Moment | string
- ): moment$Moment,
- static unix(seconds: number): moment$Moment,
- static utc(): moment$Moment,
- static utc(number: number | Array<number>): moment$Moment,
- static utc(
- str: string,
- str2?: string | Array<string>,
- str3?: string
- ): moment$Moment,
- static utc(moment: moment$Moment): moment$Moment,
- static utc(date: Date): moment$Moment,
- static parseZone(): moment$Moment,
- static parseZone(rawDate: string): moment$Moment,
- static parseZone(
- rawDate: string,
- format: string | Array<string>
- ): moment$Moment,
- static parseZone(
- rawDate: string,
- format: string,
- strict: boolean
- ): moment$Moment,
- static parseZone(
- rawDate: string,
- format: string,
- locale: string,
- strict: boolean
- ): moment$Moment,
- isValid(): boolean,
- invalidAt(): 0 | 1 | 2 | 3 | 4 | 5 | 6,
- creationData(): moment$MomentCreationData,
- millisecond(number: number): this,
- milliseconds(number: number): this,
- millisecond(): number,
- milliseconds(): number,
- second(number: number): this,
- seconds(number: number): this,
- second(): number,
- seconds(): number,
- minute(number: number): this,
- minutes(number: number): this,
- minute(): number,
- minutes(): number,
- hour(number: number): this,
- hours(number: number): this,
- hour(): number,
- hours(): number,
- date(number: number): this,
- dates(number: number): this,
- date(): number,
- dates(): number,
- day(day: number | string): this,
- days(day: number | string): this,
- day(): number,
- days(): number,
- weekday(number: number): this,
- weekday(): number,
- isoWeekday(number: number): this,
- isoWeekday(): number,
- dayOfYear(number: number): this,
- dayOfYear(): number,
- week(number: number): this,
- weeks(number: number): this,
- week(): number,
- weeks(): number,
- isoWeek(number: number): this,
- isoWeeks(number: number): this,
- isoWeek(): number,
- isoWeeks(): number,
- month(number: number): this,
- months(number: number): this,
- month(): number,
- months(): number,
- quarter(number: number): this,
- quarter(): number,
- year(number: number): this,
- years(number: number): this,
- year(): number,
- years(): number,
- weekYear(number: number): this,
- weekYear(): number,
- isoWeekYear(number: number): this,
- isoWeekYear(): number,
- weeksInYear(): number,
- isoWeeksInYear(): number,
- get(string: string): number,
- set(unit: string, value: number): this,
- set(options: { [unit: string]: number }): this,
- static max(...dates: Array<moment$Moment>): moment$Moment,
- static max(dates: Array<moment$Moment>): moment$Moment,
- static min(...dates: Array<moment$Moment>): moment$Moment,
- static min(dates: Array<moment$Moment>): moment$Moment,
- add(
- value: number | moment$MomentDuration | moment$Moment | Object,
- unit?: string
- ): this,
- subtract(
- value: number | moment$MomentDuration | moment$Moment | string | Object,
- unit?: string
- ): this,
- startOf(unit: string): this,
- endOf(unit: string): this,
- local(): this,
- utc(): this,
- utcOffset(
- offset: number | string,
- keepLocalTime?: boolean,
- keepMinutes?: boolean
- ): this,
- utcOffset(): number,
- format(format?: string): string,
- fromNow(removeSuffix?: boolean): string,
- from(
- value: moment$Moment | string | number | Date | Array<number>,
- removePrefix?: boolean
- ): string,
- toNow(removePrefix?: boolean): string,
- to(
- value: moment$Moment | string | number | Date | Array<number>,
- removePrefix?: boolean
- ): string,
- calendar(refTime?: any, formats?: moment$CalendarFormats): string,
- diff(
- date: moment$Moment | string | number | Date | Array<number>,
- format?: string,
- floating?: boolean
- ): number,
- valueOf(): number,
- unix(): number,
- daysInMonth(): number,
- toDate(): Date,
- toArray(): Array<number>,
- toJSON(): string,
- toISOString(
- keepOffset?: boolean
- ): string,
- toObject(): moment$MomentObject,
- isBefore(
- date?: moment$Moment | string | number | Date | Array<number>,
- units?: ?string
- ): boolean,
- isSame(
- date?: moment$Moment | string | number | Date | Array<number>,
- units?: ?string
- ): boolean,
- isAfter(
- date?: moment$Moment | string | number | Date | Array<number>,
- units?: ?string
- ): boolean,
- isSameOrBefore(
- date?: moment$Moment | string | number | Date | Array<number>,
- units?: ?string
- ): boolean,
- isSameOrAfter(
- date?: moment$Moment | string | number | Date | Array<number>,
- units?: ?string
- ): boolean,
- isBetween(
- fromDate: moment$Moment | string | number | Date | Array<number>,
- toDate?: ?moment$Moment | string | number | Date | Array<number>,
- granularity?: ?string,
- inclusion?: ?string
- ): boolean,
- isDST(): boolean,
- isDSTShifted(): boolean,
- isLeapYear(): boolean,
- clone(): moment$Moment,
- static isMoment(obj: any): boolean,
- static isDate(obj: any): boolean,
- static locale(locale: string, localeData?: Object): string,
- static updateLocale(locale: string, localeData?: ?Object): void,
- static locale(locales: Array<string>): string,
- locale(locale: string, customization?: Object | null): moment$Moment,
- locale(): string,
- static months(): Array<string>,
- static monthsShort(): Array<string>,
- static weekdays(): Array<string>,
- static weekdaysShort(): Array<string>,
- static weekdaysMin(): Array<string>,
- static months(): string,
- static monthsShort(): string,
- static weekdays(): string,
- static weekdaysShort(): string,
- static weekdaysMin(): string,
- static localeData(key?: string): moment$LocaleData,
- static duration(
- value: number | Object | string,
- unit?: string
- ): moment$MomentDuration,
- static isDuration(obj: any): boolean,
- static normalizeUnits(unit: string): string,
- static invalid(object: any): moment$Moment
-}
-
-declare module "moment" {
- declare module.exports: Class<moment$Moment>;
-}
diff --git a/flow-typed/npm/react-redux_v5.x.x.js b/flow-typed/npm/react-redux_v5.x.x.js
index 0c3e7d0cc9..eeeab17df9 100644
--- a/flow-typed/npm/react-redux_v5.x.x.js
+++ b/flow-typed/npm/react-redux_v5.x.x.js
@@ -1,192 +1,276 @@
-// flow-typed signature: d4e793bc07ef1dc9906a244b12960f7b
-// flow-typed version: cf33ff8762/react-redux_v5.x.x/flow_>=v0.63.0
+// flow-typed signature: f06f00c3ad0cfedb90c0c6de04b219f3
+// flow-typed version: 3a6d556e4b/react-redux_v5.x.x/flow_>=v0.89.x
-import type { Dispatch, Store } from "redux";
+/**
+The order of type arguments for connect() is as follows:
-declare module "react-redux" {
- import type { ComponentType, ElementConfig } from 'react';
+connect<Props, OwnProps, StateProps, DispatchProps, State, Dispatch>(…)
- declare export class Provider<S, A> extends React$Component<{
- store: Store<S, A>,
- children?: any
- }> {}
+In Flow v0.89 only the first two are mandatory to specify. Other 4 can be repaced with the new awesome type placeholder:
- declare export function createProvider(
- storeKey?: string,
- subKey?: string
- ): Provider<*, *>;
+connect<Props, OwnProps, _, _, _, _>(…)
- /*
+But beware, in case of weird type errors somewhere in random places
+just type everything and get to a green field and only then try to
+remove the definitions you see bogus.
+Decrypting the abbreviations:
+ WC = Component being wrapped
S = State
- A = Action
+ D = Dispatch
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
- */
+ ST = Static properties of Com
+ EFO = Extra factory options (used only in connectAdvanced)
+*/
- 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 module "react-redux" {
+ // ------------------------------------------------------------
+ // Typings for connect()
+ // ------------------------------------------------------------
- declare type ConnectOptions<S: Object, OP: Object, RSP: Object, RMP: Object> = {|
+ declare export type Options<S, OP, SP, MP> = {|
pure?: 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
+ areStatePropsEqual?: (next: SP, prev: SP) => boolean,
+ areMergedPropsEqual?: (next: MP, prev: MP) => boolean,
+ storeKey?: string,
|};
- declare type OmitDispatch<Component> = $Diff<Component, {dispatch: Dispatch<*>}>;
+ declare type MapStateToProps<-S, -OP, +SP> =
+ | ((state: S, ownProps: OP) => SP)
+ // If you want to use the factory function but get a strange error
+ // like "function is not an object" then just type the factory function
+ // like this:
+ // const factory: (State, OwnProps) => (State, OwnProps) => StateProps
+ // and provide the StateProps type to the SP type parameter.
+ | ((state: S, ownProps: OP) => (state: S, ownProps: OP) => SP);
- 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,
+ declare type Bind<D> = <A, R>((...A) => R) => (...A) => $Call<D, R>;
+
+ declare type MapDispatchToPropsFn<D, -OP, +DP> =
+ | ((dispatch: D, ownProps: OP) => DP)
+ // If you want to use the factory function but get a strange error
+ // like "function is not an object" then just type the factory function
+ // like this:
+ // const factory: (Dispatch, OwnProps) => (Dispatch, OwnProps) => DispatchProps
+ // and provide the DispatchProps type to the DP type parameter.
+ | ((dispatch: D, ownProps: OP) => (dispatch: D, ownProps: OP) => DP);
+
+ declare class ConnectedComponent<OP, +WC> extends React$Component<OP> {
+ static +WrappedComponent: WC;
+ getWrappedInstance(): React$ElementRef<WC>;
+ }
+ // The connection of the Wrapped Component and the Connected Component
+ // happens here in `MP: P`. It means that type wise MP belongs to P,
+ // so to say MP >= P.
+ declare type Connector<P, OP, MP: P> = <WC: React$ComponentType<P>>(
+ WC,
+ ) => Class<ConnectedComponent<OP, WC>> & WC;
+
+ // No `mergeProps` argument
+
+ // Got error like inexact OwnProps is incompatible with exact object type?
+ // Just make the OP parameter for `connect()` an exact object.
+ declare type MergeOP<OP, D> = {| ...$Exact<OP>, dispatch: D |};
+ 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 export function connect<-P, -OP, -SP, -DP, -S, -D>(
+ mapStateToProps?: null | void,
+ mapDispatchToProps?: null | void,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, {||}, MergeOP<OP, D>>,
+ ): Connector<P, OP, MergeOP<OP, D>>;
+
+ declare export function connect<-P, -OP, -SP, -DP, -S, -D>(
+ // If you get error here try adding return type to your mapStateToProps function
+ mapStateToProps: MapStateToProps<S, OP, SP>,
+ mapDispatchToProps?: null | void,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, SP, MergeOPSP<OP, SP, D>>,
+ ): Connector<P, OP, MergeOPSP<OP, SP, D>>;
+
+ // In this case DP is an object of functions which has been bound to dispatch
+ // by the given mapDispatchToProps function.
+ declare export function connect<-P, -OP, -SP, -DP, S, D>(
+ mapStateToProps: null | void,
+ mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
+ ): Connector<P, OP, MergeOPDP<OP, DP>>;
+
+ // In this case DP is an object of action creators not yet bound to dispatch,
+ // this difference is not important in the vanila redux,
+ // but in case of usage with redux-thunk, the return type may differ.
+ declare export function connect<-P, -OP, -SP, -DP, S, D>(
+ mapStateToProps: null | void,
+ mapDispatchToProps: DP,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, {||}, MergeOPDP<OP, DP>>,
+ ): Connector<P, OP, MergeOPDP<OP, $ObjMap<DP, Bind<D>>>>;
+
+ declare export function connect<-P, -OP, -SP, -DP, S, D>(
+ // If you get error here try adding return type to your mapStateToProps function
+ mapStateToProps: MapStateToProps<S, OP, SP>,
+ mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, SP, {| ...OP, ...SP, ...DP |}>,
+ ): Connector<P, OP, {| ...OP, ...SP, ...DP |}>;
+
+ declare export function connect<-P, -OP, -SP, -DP, S, D>(
+ // If you get error here try adding return type to your mapStateToProps function
+ mapStateToProps: MapStateToProps<S, OP, SP>,
+ mapDispatchToProps: DP,
+ mergeProps?: null | void,
+ options?: ?Options<S, OP, SP, MergeOPSPDP<OP, SP, DP>>,
+ ): Connector<P, OP, MergeOPSPDP<OP, SP, $ObjMap<DP, Bind<D>>>>;
+
+ // With `mergeProps` argument
+
+ declare type MergeProps<+P, -OP, -SP, -DP> = (
+ stateProps: SP,
+ dispatchProps: DP,
+ ownProps: OP,
+ ) => P;
+
+ declare export function connect<-P, -OP, -SP: {||}, -DP: {||}, S, D>(
+ mapStateToProps: null | void,
+ mapDispatchToProps: null | void,
+ // If you get error here try adding return type to you mapStateToProps function
+ mergeProps: MergeProps<P, OP, {||}, {| dispatch: D |}>,
+ options?: ?Options<S, OP, {||}, P>,
+ ): Connector<P, OP, P>;
+
+ declare export function connect<-P, -OP, -SP, -DP: {||}, S, D>(
+ mapStateToProps: MapStateToProps<S, OP, SP>,
+ mapDispatchToProps: null | void,
+ // If you get error here try adding return type to you mapStateToProps function
+ mergeProps: MergeProps<P, OP, SP, {| dispatch: D |}>,
+ options?: ?Options<S, OP, SP, P>,
+ ): Connector<P, OP, P>;
+
+ // In this case DP is an object of functions which has been bound to dispatch
+ // by the given mapDispatchToProps function.
+ declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>(
+ mapStateToProps: null | void,
+ mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
+ mergeProps: MergeProps<P, OP, {||}, DP>,
+ options?: ?Options<S, OP, {||}, P>,
+ ): Connector<P, OP, P>;
+
+ // In this case DP is an object of action creators not yet bound to dispatch,
+ // this difference is not important in the vanila redux,
+ // but in case of usage with redux-thunk, the return type may differ.
+ declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>(
+ mapStateToProps: null | void,
+ mapDispatchToProps: DP,
+ mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
+ options?: ?Options<S, OP, {||}, P>,
+ ): Connector<P, OP, P>;
+
+ // In this case DP is an object of functions which has been bound to dispatch
+ // by the given mapDispatchToProps function.
+ declare export function connect<-P, -OP, -SP, -DP, S, D>(
+ mapStateToProps: MapStateToProps<S, OP, SP>,
+ mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
+ mergeProps: MergeProps<P, OP, SP, DP>,
+ options?: ?Options<S, OP, SP, P>,
+ ): Connector<P, OP, P>;
+
+ // In this case DP is an object of action creators not yet bound to dispatch,
+ // this difference is not important in the vanila redux,
+ // but in case of usage with redux-thunk, the return type may differ.
+ 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>>>,
+ options?: ?Options<S, OP, SP, P>,
+ ): Connector<P, OP, P>;
+
+ // ------------------------------------------------------------
+ // Typings for Provider
+ // ------------------------------------------------------------
+
+ declare export class Provider<Store> extends React$Component<{
+ store: Store,
+ children?: React$Node,
+ }> {}
+
+ declare export function createProvider(
+ storeKey?: string,
+ subKey?: string,
+ ): Class<Provider<*>>;
+
+ // ------------------------------------------------------------
+ // Typings for connectAdvanced()
+ // ------------------------------------------------------------
+
+ declare type ConnectAdvancedOptions = {
+ getDisplayName?: (name: string) => string,
+ methodName?: string,
+ renderCountProp?: string,
+ shouldHandleStateChanges?: boolean,
+ storeKey?: string,
+ withRef?: boolean,
+ };
+
+ declare type SelectorFactoryOptions<Com> = {
+ getDisplayName: (name: string) => string,
+ methodName: string,
+ renderCountProp: ?string,
+ shouldHandleStateChanges: boolean,
+ storeKey: string,
+ withRef: boolean,
+ displayName: string,
+ wrappedComponentName: string,
+ WrappedComponent: Com,
+ };
+
+ declare type MapStateToPropsEx<S: Object, SP: Object, RSP: Object> = (
+ state: S,
+ props: SP,
+ ) => RSP;
+
+ declare type SelectorFactory<
+ Com: React$ComponentType<*>,
+ Dispatch,
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,
- MDP: Object,
- MP: Object,
- RMP: Object,
- CP: $Diff<ElementConfig<Com>, RMP>
- >(
- mapStateToProps: MapStateToProps<S, SP, RSP>,
- mapDispatchToProps: MDP,
- 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 function connect<Com: ComponentType<*>,
- A,
+ EFO: Object,
+ CP: Object,
+ > = (
+ dispatch: Dispatch,
+ factoryOptions: SelectorFactoryOptions<Com> & EFO,
+ ) => MapStateToPropsEx<S, OP, CP>;
+
+ declare export function connectAdvanced<
+ Com: React$ComponentType<*>,
+ D,
S: Object,
- DP: Object,
- SP: Object,
- RSP: Object,
- RDP: Object,
- MDP: Object,
- MP: Object,
- RMP: Object
- >(
- mapStateToProps: ?MapStateToProps<S, SP, RSP>,
- mapDispatchToProps: ?MapDispatchToProps<A, DP, RDP>,
- mergeProps: MDP,
- options: ConnectOptions<S, SP & DP & MP, RSP, RMP>
- ): (component: Com) => ComponentType<$Diff<ElementConfig<Com>, RMP> & SP & DP & MP>;
+ OP: Object,
+ CP: Object,
+ EFO: Object,
+ ST: { [_: $Keys<Com>]: any },
+ >(
+ selectorFactory: SelectorFactory<Com, D, S, OP, EFO, CP>,
+ connectAdvancedOptions: ?(ConnectAdvancedOptions & EFO),
+ ): (component: Com) => React$ComponentType<OP> & $Shape<ST>;
declare export default {
Provider: typeof Provider,
createProvider: typeof createProvider,
connect: typeof connect,
+ connectAdvanced: typeof connectAdvanced,
};
}
diff --git a/flow-typed/npm/redux_v3.x.x.js b/flow-typed/npm/redux_v4.x.x.js
similarity index 94%
rename from flow-typed/npm/redux_v3.x.x.js
rename to flow-typed/npm/redux_v4.x.x.js
index 5d88cb53d9..d7a909d56a 100644
--- a/flow-typed/npm/redux_v3.x.x.js
+++ b/flow-typed/npm/redux_v4.x.x.js
@@ -1,3 +1,6 @@
+// flow-typed signature: df80bdd535bfed9cf3223e077f3b4543
+// flow-typed version: c4c8963c9c/redux_v4.x.x/flow_>=v0.55.x
+
declare module 'redux' {
/*