Skip to content

Commit

Permalink
chore: Update Flow library definitions (#3174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntwb authored and jeddy3 committed Feb 18, 2018
1 parent 27fde11 commit 2a5f009
Showing 1 changed file with 80 additions and 59 deletions.
139 changes: 80 additions & 59 deletions decls/flow-typed/lodash.js
@@ -1,5 +1,5 @@
// flow-typed signature: a0ace6ecf9cb0e9f971f651691137591
// flow-typed version: e4e1d58043/lodash_v4.x.x/flow_>=v0.63.x
// flow-typed signature: c2bd6c4724449c7e90898127e704bf59
// flow-typed version: 3aea57ee9c/lodash_v4.x.x/flow_>=v0.63.x

declare module "lodash" {
declare type __CurriedFunction1<A, R, AA: A> = (...r: [AA]) => R;
Expand Down Expand Up @@ -193,7 +193,7 @@ declare module "lodash" {
) => mixed;
declare type Iteratee<T> = _Iteratee<T> | Object | string;
declare type FlatMapIteratee<T, U> =
| ((item: T, index: number, array: ?Array<T>) => Array<U>)
| ((item: T, index: number, array: ?$ReadOnlyArray<T>) => Array<U>)
| Object
| string;
declare type Comparator<T> = (item: T, item2: T) => boolean;
Expand Down Expand Up @@ -568,15 +568,15 @@ declare module "lodash" {
predicate?: ?OPredicate<A, T>
): V;
flatMap<T, U>(
array?: ?Array<T>,
array?: ?$ReadOnlyArray<T>,
iteratee?: ?FlatMapIteratee<T, U>
): Array<U>;
flatMap<T: Object, U>(
object: T,
iteratee?: OFlatMapIteratee<T, U>
): Array<U>;
flatMapDeep<T, U>(
array?: ?Array<T>,
array?: ?$ReadOnlyArray<T>,
iteratee?: ?FlatMapIteratee<T, U>
): Array<U>;
flatMapDeep<T: Object, U>(
Expand All @@ -600,7 +600,7 @@ declare module "lodash" {
forEachRight<T: void | null>(array: T, iteratee?: ?Iteratee<any>): T;
forEachRight<T: Object>(object: T, iteratee?: ?OIteratee<T>): T;
groupBy<V, T>(
array: Array<T>,
array: $ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): { [key: V]: Array<T> };
groupBy(array: void | null, iteratee?: ?ValueOnlyIteratee<any>): {};
Expand All @@ -623,7 +623,7 @@ declare module "lodash" {
...args?: Array<any>
): Array<any>;
keyBy<T, V>(
array: Array<T>,
array: $ReadOnlyArray<T>,
iteratee?: ?ValueOnlyIteratee<T>
): { [key: V]: ?T };
keyBy(array: void | null, iteratee?: ?ValueOnlyIteratee<*>): {};
Expand All @@ -645,19 +645,19 @@ declare module "lodash" {
iteratee?: (char: string, index: number, str: string) => any
): string;
orderBy<T>(
array: Array<T>,
iteratees?: ?Array<Iteratee<T>> | ?string,
orders?: ?Array<"asc" | "desc"> | ?string
array: $ReadOnlyArray<T>,
iteratees?: ?$ReadOnlyArray<Iteratee<T>> | ?string,
orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string
): Array<T>;
orderBy<T>(
array: null | void,
iteratees?: ?Array<Iteratee<T>> | ?string,
orders?: ?Array<"asc" | "desc"> | ?string
iteratees?: ?$ReadOnlyArray<Iteratee<T>> | ?string,
orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string
): Array<T>;
orderBy<V, T: Object>(
object: T,
iteratees?: Array<OIteratee<*>> | string,
orders?: Array<"asc" | "desc"> | string
iteratees?: $ReadOnlyArray<OIteratee<*>> | string,
orders?: $ReadOnlyArray<"asc" | "desc"> | string
): Array<V>;
partition<T>(
array?: ?Array<T>,
Expand Down Expand Up @@ -735,13 +735,22 @@ declare module "lodash" {
object?: ?T,
predicate?: OPredicate<A, T>
): boolean;
sortBy<T>(array: ?Array<T>, ...iteratees?: Array<Iteratee<T>>): Array<T>;
sortBy<T>(array: ?Array<T>, iteratees?: Array<Iteratee<T>>): Array<T>;
sortBy<T>(
array: ?$ReadOnlyArray<T>,
...iteratees?: $ReadOnlyArray<Iteratee<T>>
): Array<T>;
sortBy<T>(
array: ?$ReadOnlyArray<T>,
iteratees?: $ReadOnlyArray<Iteratee<T>>
): Array<T>;
sortBy<V, T: Object>(
object: T,
...iteratees?: Array<OIteratee<T>>
): Array<V>;
sortBy<V, T: Object>(object: T, iteratees?: Array<OIteratee<T>>): Array<V>;
sortBy<V, T: Object>(
object: T,
iteratees?: $ReadOnlyArray<OIteratee<T>>
): Array<V>;

// Date
now(): number;
Expand Down Expand Up @@ -1250,7 +1259,7 @@ declare module "lodash" {
toPairs(object?: ?Object | Array<*>): Array<[string, any]>;
toPairsIn(object?: ?Object): Array<[string, any]>;
transform(
collection: Object | Array<any>,
collection: Object | $ReadOnlyArray<any>,
iteratee?: ?OIteratee<*>,
accumulator?: any
): any;
Expand Down Expand Up @@ -1634,30 +1643,34 @@ declare module "lodash/fp" {
base: A,
elements: B
): Array<T | U>;
difference<T>(values: Array<T>): (array: Array<T>) => Array<T>;
difference<T>(values: Array<T>, array: Array<T>): Array<T>;
difference<T>(values: $ReadOnlyArray<T>): (array: $ReadOnlyArray<T>) => T[];
difference<T>(values: $ReadOnlyArray<T>, array: $ReadOnlyArray<T>): T[];
differenceBy<T>(
iteratee: ValueOnlyIteratee<T>
): ((values: Array<T>) => (array: Array<T>) => T[]) &
((values: Array<T>, array: Array<T>) => T[]);
): ((values: $ReadOnlyArray<T>) => (array: $ReadOnlyArray<T>) => T[]) &
((values: $ReadOnlyArray<T>, array: $ReadOnlyArray<T>) => T[]);
differenceBy<T>(
iteratee: ValueOnlyIteratee<T>,
values: Array<T>
): (array: Array<T>) => T[];
values: $ReadOnlyArray<T>
): (array: $ReadOnlyArray<T>) => T[];
differenceBy<T>(
iteratee: ValueOnlyIteratee<T>,
values: Array<T>,
array: Array<T>
values: $ReadOnlyArray<T>,
array: $ReadOnlyArray<T>
): T[];
differenceWith<T>(
values: T[]
): ((comparator: Comparator<T>) => (array: T[]) => T[]) &
((comparator: Comparator<T>, array: T[]) => T[]);
values: $ReadOnlyArray<T>
): ((comparator: Comparator<T>) => (array: $ReadOnlyArray<T>) => T[]) &
((comparator: Comparator<T>, array: $ReadOnlyArray<T>) => T[]);
differenceWith<T>(
values: T[],
values: $ReadOnlyArray<T>,
comparator: Comparator<T>
): (array: T[]) => T[];
differenceWith<T>(values: T[], comparator: Comparator<T>, array: T[]): T[];
): (array: $ReadOnlyArray<T>) => T[];
differenceWith<T>(
values: $ReadOnlyArray<T>,
comparator: Comparator<T>,
array: $ReadOnlyArray<T>
): T[];
drop<T>(n: number): (array: Array<T>) => Array<T>;
drop<T>(n: number, array: Array<T>): Array<T>;
dropLast<T>(n: number): (array: Array<T>) => Array<T>;
Expand Down Expand Up @@ -2127,15 +2140,17 @@ declare module "lodash/fp" {
): Array<T>;
groupBy<V, T>(
iteratee: ValueOnlyIteratee<T>
): (collection: Array<T> | { [id: any]: T }) => { [key: V]: Array<T> };
): (
collection: $ReadOnlyArray<T> | { [id: any]: T }
) => { [key: V]: Array<T> };
groupBy<V, T>(
iteratee: ValueOnlyIteratee<T>,
collection: Array<T> | { [id: any]: T }
collection: $ReadOnlyArray<T> | { [id: any]: T }
): { [key: V]: Array<T> };
includes(value: string): (str: string) => boolean;
includes(value: string, str: string): boolean;
includes<T>(value: T): (collection: Array<T> | { [id: any]: T }) => boolean;
includes<T>(value: T, collection: Array<T> | { [id: any]: T }): boolean;
includes(value: string): (str: string) => boolean;
includes(value: string, str: string): boolean;
contains(value: string): (str: string) => boolean;
contains(value: string, str: string): boolean;
contains<T>(value: T): (collection: Array<T> | { [id: any]: T }) => boolean;
Expand Down Expand Up @@ -2182,17 +2197,17 @@ declare module "lodash/fp" {
): Array<any>;
keyBy<T, V>(
iteratee: ValueOnlyIteratee<T>
): (collection: Array<T> | { [id: any]: T }) => { [key: V]: T };
): (collection: $ReadOnlyArray<T> | { [id: any]: T }) => { [key: V]: T };
keyBy<T, V>(
iteratee: ValueOnlyIteratee<T>,
collection: Array<T> | { [id: any]: T }
collection: $ReadOnlyArray<T> | { [id: any]: T }
): { [key: V]: T };
indexBy<T, V>(
iteratee: ValueOnlyIteratee<T>
): (collection: Array<T> | { [id: any]: T }) => { [key: V]: T };
): (collection: $ReadOnlyArray<T> | { [id: any]: T }) => { [key: V]: T };
indexBy<T, V>(
iteratee: ValueOnlyIteratee<T>,
collection: Array<T> | { [id: any]: T }
collection: $ReadOnlyArray<T> | { [id: any]: T }
): { [key: V]: T };
map<T, U>(
iteratee: MapIterator<T, U> | OMapIterator<T, U>
Expand All @@ -2213,22 +2228,22 @@ declare module "lodash/fp" {
pluck(iteratee: (char: string) => any): (str: string) => string;
pluck(iteratee: (char: string) => any, str: string): string;
orderBy<T>(
iteratees: Array<Iteratee<T> | OIteratee<*>> | string
iteratees: $ReadOnlyArray<Iteratee<T> | OIteratee<*>> | string
): ((
orders: Array<"asc" | "desc"> | string
) => (collection: Array<T> | { [id: any]: T }) => Array<T>) &
orders: $ReadOnlyArray<"asc" | "desc"> | string
) => (collection: $ReadOnlyArray<T> | { [id: any]: T }) => Array<T>) &
((
orders: Array<"asc" | "desc"> | string,
collection: Array<T> | { [id: any]: T }
orders: $ReadOnlyArray<"asc" | "desc"> | string,
collection: $ReadOnlyArray<T> | { [id: any]: T }
) => Array<T>);
orderBy<T>(
iteratees: Array<Iteratee<T> | OIteratee<*>> | string,
orders: Array<"asc" | "desc"> | string
): (collection: Array<T> | { [id: any]: T }) => Array<T>;
iteratees: $ReadOnlyArray<Iteratee<T> | OIteratee<*>> | string,
orders: $ReadOnlyArray<"asc" | "desc"> | string
): (collection: $ReadOnlyArray<T> | { [id: any]: T }) => Array<T>;
orderBy<T>(
iteratees: Array<Iteratee<T> | OIteratee<*>> | string,
orders: Array<"asc" | "desc"> | string,
collection: Array<T> | { [id: any]: T }
iteratees: $ReadOnlyArray<Iteratee<T> | OIteratee<*>> | string,
orders: $ReadOnlyArray<"asc" | "desc"> | string,
collection: $ReadOnlyArray<T> | { [id: any]: T }
): Array<T>;
partition<T>(
predicate: Predicate<T> | OPredicate<T>
Expand Down Expand Up @@ -2292,11 +2307,15 @@ declare module "lodash/fp" {
collection: Array<T> | { [id: any]: T }
): boolean;
sortBy<T>(
iteratees: Array<Iteratee<T> | OIteratee<T>> | Iteratee<T> | OIteratee<T>
): (collection: Array<T> | { [id: any]: T }) => Array<T>;
iteratees: | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
| Iteratee<T>
| OIteratee<T>
): (collection: $ReadOnlyArray<T> | { [id: any]: T }) => Array<T>;
sortBy<T>(
iteratees: Array<Iteratee<T> | OIteratee<T>> | Iteratee<T> | OIteratee<T>,
collection: Array<T> | { [id: any]: T }
iteratees: | $ReadOnlyArray<Iteratee<T> | OIteratee<T>>
| Iteratee<T>
| OIteratee<T>,
collection: $ReadOnlyArray<T> | { [id: any]: T }
): Array<T>;

// Date
Expand Down Expand Up @@ -2965,16 +2984,18 @@ declare module "lodash/fp" {
toPairsIn(object: Object): Array<[string, any]>;
transform(
iteratee: OIteratee<*>
): ((accumulator: any) => (collection: Object | Array<any>) => any) &
((accumulator: any, collection: Object | Array<any>) => any);
): ((
accumulator: any
) => (collection: Object | $ReadOnlyArray<any>) => any) &
((accumulator: any, collection: Object | $ReadOnlyArray<any>) => any);
transform(
iteratee: OIteratee<*>,
accumulator: any
): (collection: Object | Array<any>) => any;
): (collection: Object | $ReadOnlyArray<any>) => any;
transform(
iteratee: OIteratee<*>,
accumulator: any,
collection: Object | Array<any>
collection: Object | $ReadOnlyArray<any>
): any;
unset(path: Array<string> | string): (object: Object) => boolean;
unset(path: Array<string> | string, object: Object): boolean;
Expand Down

0 comments on commit 2a5f009

Please sign in to comment.