diff --git a/flow-typed/npm/lodash_v4.x.x.js b/flow-typed/npm/lodash_v4.x.x.js new file mode 100644 index 000000000..7bdebcd43 --- /dev/null +++ b/flow-typed/npm/lodash_v4.x.x.js @@ -0,0 +1,514 @@ +// flow-typed signature: 4420d5c49e3270b55524360665da4981 +// flow-typed version: 9821eaaefe/lodash_v4.x.x/flow_>=v0.38.x <=v0.46.x + +declare module 'lodash' { + declare type TemplateSettings = { + escape?: RegExp, + evaluate?: RegExp, + imports?: Object, + interpolate?: RegExp, + variable?: string, + }; + + declare type TruncateOptions = { + length?: number, + omission?: string, + separator?: RegExp|string, + }; + + declare type DebounceOptions = { + leading?: bool, + maxWait?: number, + trailing?: bool, + }; + + declare type ThrottleOptions = { + leading?: bool, + trailing?: bool, + }; + + declare type NestedArray = Array>; + + declare type matchesIterateeShorthand = Object; + declare type matchesPropertyIterateeShorthand = [string, any]; + declare type propertyIterateeShorthand = string; + + declare type OPredicate = + | ((value: A, key: string, object: O) => any) + | matchesIterateeShorthand + | matchesPropertyIterateeShorthand + | propertyIterateeShorthand; + + declare type OIterateeWithResult = Object|string|((value: V, key: string, object: O) => R); + declare type OIteratee = OIterateeWithResult; + declare type OFlatMapIteratee = OIterateeWithResult>; + + declare type Predicate = + | ((value: T, index: number, array: Array) => any) + | matchesIterateeShorthand + | matchesPropertyIterateeShorthand + | propertyIterateeShorthand; + + declare type _ValueOnlyIteratee = (value: T) => mixed; + declare type ValueOnlyIteratee = _ValueOnlyIteratee|string; + declare type _Iteratee = (item: T, index: number, array: ?Array) => mixed; + declare type Iteratee = _Iteratee|Object|string; + declare type FlatMapIteratee = ((item: T, index: number, array: ?Array) => Array)|Object|string; + declare type Comparator = (item: T, item2: T) => bool; + + declare type MapIterator = + | ((item: T, index: number, array: Array) => U) + | propertyIterateeShorthand; + + declare type OMapIterator = + | ((item: T, key: string, object: O) => U) + | propertyIterateeShorthand; + + declare class Lodash { + // Array + chunk(array: ?Array, size?: number): Array>; + compact(array: Array): Array; + concat(base: Array, ...elements: Array): Array; + difference(array: ?Array, values?: Array): Array; + differenceBy(array: ?Array, values: Array, iteratee: ValueOnlyIteratee): T[]; + differenceWith(array: T[], values: T[], comparator?: Comparator): T[]; + drop(array: ?Array, n?: number): Array; + dropRight(array: ?Array, n?: number): Array; + dropRightWhile(array: ?Array, predicate?: Predicate): Array; + dropWhile(array: ?Array, predicate?: Predicate): Array; + fill(array: ?Array, value: U, start?: number, end?: number): Array; + findIndex(array: ?Array, predicate?: Predicate): number; + findLastIndex(array: ?Array, predicate?: Predicate): number; + // alias of _.head + first(array: ?Array): T; + flatten(array: Array|X>): Array; + flattenDeep(array: any[]): Array; + flattenDepth(array: any[], depth?: number): any[]; + fromPairs(pairs: Array): Object; + head(array: ?Array): T; + indexOf(array: ?Array, value: T, fromIndex?: number): number; + initial(array: ?Array): Array; + intersection(...arrays: Array>): Array; + //Workaround until (...parameter: T, parameter2: U) works + intersectionBy(a1: Array, iteratee?: ValueOnlyIteratee): Array; + intersectionBy(a1: Array, a2: Array, iteratee?: ValueOnlyIteratee): Array; + intersectionBy(a1: Array, a2: Array, a3: Array, iteratee?: ValueOnlyIteratee): Array; + intersectionBy(a1: Array, a2: Array, a3: Array, a4: Array, iteratee?: ValueOnlyIteratee): Array; + //Workaround until (...parameter: T, parameter2: U) works + intersectionWith(a1: Array, comparator: Comparator): Array; + intersectionWith(a1: Array, a2: Array, comparator: Comparator): Array; + intersectionWith(a1: Array, a2: Array, a3: Array, comparator: Comparator): Array; + intersectionWith(a1: Array, a2: Array, a3: Array, a4: Array, comparator: Comparator): Array; + join(array: ?Array, separator?: string): string; + last(array: ?Array): T; + lastIndexOf(array: ?Array, value: T, fromIndex?: number): number; + nth(array: T[], n?: number): T; + pull(array: ?Array, ...values?: Array): Array; + pullAll(array: ?Array, values: Array): Array; + pullAllBy(array: ?Array, values: Array, iteratee?: ValueOnlyIteratee): Array; + pullAllWith(array?: T[], values: T[], comparator?: Function): T[]; + pullAt(array: ?Array, ...indexed?: Array): Array; + pullAt(array: ?Array, indexed?: Array): Array; + remove(array: ?Array, predicate?: Predicate): Array; + reverse(array: ?Array): Array; + slice(array: ?Array, start?: number, end?: number): Array; + sortedIndex(array: ?Array, value: T): number; + sortedIndexBy(array: ?Array, value: T, iteratee?: ValueOnlyIteratee): number; + sortedIndexOf(array: ?Array, value: T): number; + sortedLastIndex(array: ?Array, value: T): number; + sortedLastIndexBy(array: ?Array, value: T, iteratee?: ValueOnlyIteratee): number; + sortedLastIndexOf(array: ?Array, value: T): number; + sortedUniq(array: ?Array): Array; + sortedUniqBy(array: ?Array, iteratee?: (value: T) => mixed): Array; + tail(array: ?Array): Array; + take(array: ?Array, n?: number): Array; + takeRight(array: ?Array, n?: number): Array; + takeRightWhile(array: ?Array, predicate?: Predicate): Array; + takeWhile(array: ?Array, predicate?: Predicate): Array; + union(...arrays?: Array>): Array; + //Workaround until (...parameter: T, parameter2: U) works + unionBy(a1: Array, iteratee?: ValueOnlyIteratee): Array; + unionBy(a1: Array, a2: Array, iteratee?: ValueOnlyIteratee): Array; + unionBy(a1: Array, a2: Array, a3: Array, iteratee?: ValueOnlyIteratee): Array; + unionBy(a1: Array, a2: Array, a3: Array, a4: Array, iteratee?: ValueOnlyIteratee): Array; + //Workaround until (...parameter: T, parameter2: U) works + unionWith(a1: Array, comparator?: Comparator): Array; + unionWith(a1: Array, a2: Array, comparator?: Comparator): Array; + unionWith(a1: Array, a2: Array, a3: Array, comparator?: Comparator): Array; + unionWith(a1: Array, a2: Array, a3: Array, a4: Array, comparator?: Comparator): Array; + uniq(array: ?Array): Array; + uniqBy(array: ?Array, iteratee?: ValueOnlyIteratee): Array; + uniqWith(array: ?Array, comparator?: Comparator): Array; + unzip(array: ?Array): Array; + unzipWith(array: ?Array, iteratee?: Iteratee): Array; + without(array: ?Array, ...values?: Array): Array; + xor(...array: Array>): Array; + //Workaround until (...parameter: T, parameter2: U) works + xorBy(a1: Array, iteratee?: ValueOnlyIteratee): Array; + xorBy(a1: Array, a2: Array, iteratee?: ValueOnlyIteratee): Array; + xorBy(a1: Array, a2: Array, a3: Array, iteratee?: ValueOnlyIteratee): Array; + xorBy(a1: Array, a2: Array, a3: Array, a4: Array, iteratee?: ValueOnlyIteratee): Array; + //Workaround until (...parameter: T, parameter2: U) works + xorWith(a1: Array, comparator?: Comparator): Array; + xorWith(a1: Array, a2: Array, comparator?: Comparator): Array; + xorWith(a1: Array, a2: Array, a3: Array, comparator?: Comparator): Array; + xorWith(a1: Array, a2: Array, a3: Array, a4: Array, comparator?: Comparator): Array; + zip(a1: A[], a2: B[]): Array<[A, B]>; + zip(a1: A[], a2: B[], a3: C[]): Array<[A, B, C]>; + zip(a1: A[], a2: B[], a3: C[], a4: D[]): Array<[A, B, C, D]>; + zip(a1: A[], a2: B[], a3: C[], a4: D[], a5: E[]): Array<[A, B, C, D, E]>; + + zipObject(props?: Array, values?: Array): Object; + zipObjectDeep(props?: any[], values?: any): Object; + //Workaround until (...parameter: T, parameter2: U) works + zipWith(a1: NestedArray, iteratee?: Iteratee): Array; + zipWith(a1: NestedArray, a2: NestedArray, iteratee?: Iteratee): Array; + zipWith(a1: NestedArray, a2: NestedArray, a3: NestedArray, iteratee?: Iteratee): Array; + zipWith(a1: NestedArray, a2: NestedArray, a3: NestedArray, a4: NestedArray, iteratee?: Iteratee): Array; + + // Collection + countBy(array: ?Array, iteratee?: ValueOnlyIteratee): Object; + countBy(object: T, iteratee?: ValueOnlyIteratee): Object; + // alias of _.forEach + each(array: ?Array, iteratee?: Iteratee): Array; + each(object: T, iteratee?: OIteratee): T; + // alias of _.forEachRight + eachRight(array: ?Array, iteratee?: Iteratee): Array; + eachRight(object: T, iteratee?: OIteratee): T; + every(array: ?Array, iteratee?: Iteratee): bool; + every(object: T, iteratee?: OIteratee): bool; + filter(array: ?Array, predicate?: Predicate): Array; + filter(object: T, predicate?: OPredicate): Array; + find(array: ?Array, predicate?: Predicate, fromIndex?: number): T|void; + find(object: T, predicate?: OPredicate, fromIndex?: number): V; + findLast(array: ?Array, predicate?: Predicate, fromIndex?: number): T|void; + findLast(object: T, predicate?: OPredicate, fromIndex?: number): V; + flatMap(array: ?Array, iteratee?: FlatMapIteratee): Array; + flatMap(object: T, iteratee?: OFlatMapIteratee): Array; + flatMapDeep(array: ?Array, iteratee?: FlatMapIteratee): Array; + flatMapDeep(object: T, iteratee?: OFlatMapIteratee): Array; + flatMapDepth(array: ?Array, iteratee?: FlatMapIteratee, depth?: number): Array; + flatMapDepth(object: T, iteratee?: OFlatMapIteratee, depth?: number): Array; + forEach(array: ?Array, iteratee?: Iteratee): Array; + forEach(object: T, iteratee?: OIteratee): T; + forEachRight(array: ?Array, iteratee?: Iteratee): Array; + forEachRight(object: T, iteratee?: OIteratee): T; + groupBy(array: ?Array, iteratee?: ValueOnlyIteratee): {[key: V]: Array}; + groupBy(object: T, iteratee?: ValueOnlyIteratee): {[key: V]: Array}; + includes(array: ?Array, value: T, fromIndex?: number): bool; + includes(object: T, value: any, fromIndex?: number): bool; + includes(str: string, value: string, fromIndex?: number): bool; + invokeMap(array: ?Array, path: ((value: T) => Array|string)|Array|string, ...args?: Array): Array; + invokeMap(object: T, path: ((value: any) => Array|string)|Array|string, ...args?: Array): Array; + keyBy(array: ?Array, iteratee?: ValueOnlyIteratee): {[key: V]: ?T}; + keyBy(object: T, iteratee?: ValueOnlyIteratee): {[key: V]: ?A}; + map(array: ?Array, iteratee?: MapIterator): Array; + map(object: ?T, iteratee?: OMapIterator): Array; + map(str: ?string, iteratee?: (char: string, index: number, str: string) => any): string; + orderBy(array: ?Array, iteratees?: Array>|string, orders?: Array<'asc'|'desc'>|string): Array; + orderBy(object: T, iteratees?: Array>|string, orders?: Array<'asc'|'desc'>|string): Array; + partition(array: ?Array, predicate?: Predicate): NestedArray; + partition(object: T, predicate?: OPredicate): NestedArray; + reduce(array: ?Array, iteratee?: (accumulator: U, value: T, index: number, array: ?Array) => U, accumulator?: U): U; + reduce(object: T, iteratee?: (accumulator: U, value: any, key: string, object: T) => U, accumulator?: U): U; + reduceRight(array: ?Array, iteratee?: (accumulator: U, value: T, index: number, array: ?Array) => U, accumulator?: U): U; + reduceRight(object: T, iteratee?: (accumulator: U, value: any, key: string, object: T) => U, accumulator?: U): U; + reject(array: ?Array, predicate?: Predicate): Array; + reject(object: T, predicate?: OPredicate): Array; + sample(array: ?Array): T; + sample(object: T): V; + sampleSize(array: ?Array, n?: number): Array; + sampleSize(object: T, n?: number): Array; + shuffle(array: ?Array): Array; + shuffle(object: T): Array; + size(collection: Array|Object): number; + some(array: ?Array, predicate?: Predicate): bool; + some(object?: ?T, predicate?: OPredicate): bool; + sortBy(array: ?Array, ...iteratees?: Array>): Array; + sortBy(array: ?Array, iteratees?: Array>): Array; + sortBy(object: T, ...iteratees?: Array>): Array; + sortBy(object: T, iteratees?: Array>): Array; + + // Date + now(): number; + + // Function + 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): Function; + bindKey(obj: Object, key: string, ...partials: Array): Function; + curry(func: Function, arity?: number): Function; + curryRight(func: Function, arity?: number): Function; + debounce(func: Function, wait?: number, options?: DebounceOptions): Function; + defer(func: Function, ...args?: Array): number; + delay(func: Function, wait: number, ...args?: Array): number; + flip(func: Function): Function; + memoize(func: Function, resolver?: Function): Function; + negate(predicate: Function): Function; + once(func: Function): Function; + overArgs(func: Function, ...transforms: Array): Function; + overArgs(func: Function, transforms: Array): Function; + partial(func: Function, ...partials: any[]): Function; + partialRight(func: Function, ...partials: Array): Function; + partialRight(func: Function, partials: Array): Function; + rearg(func: Function, ...indexes: Array): Function; + rearg(func: Function, indexes: Array): Function; + rest(func: Function, start?: number): Function; + spread(func: Function): Function; + throttle(func: Function, wait?: number, options?: ThrottleOptions): Function; + unary(func: Function): Function; + wrap(value: any, wrapper: Function): Function; + + // Lang + castArray(value: *): any[]; + clone(value: T): T; + cloneDeep(value: T): T; + cloneDeepWith(value: T, customizer?: ?(value: T, key: number|string, object: T, stack: any) => U): U; + cloneWith(value: T, customizer?: ?(value: T, key: number|string, object: T, stack: any) => U): U; + conformsTo(source: T, predicates: T&{[key:string]:(x:any)=>boolean}): boolean; + eq(value: any, other: any): bool; + gt(value: any, other: any): bool; + gte(value: any, other: any): bool; + isArguments(value: any): bool; + isArray(value: any): bool; + isArrayBuffer(value: any): bool; + isArrayLike(value: any): bool; + isArrayLikeObject(value: any): bool; + isBoolean(value: any): bool; + isBuffer(value: any): bool; + isDate(value: any): bool; + isElement(value: any): bool; + isEmpty(value: any): bool; + isEqual(value: any, other: any): bool; + isEqualWith(value: T, other: U, customizer?: (objValue: any, otherValue: any, key: number|string, object: T, other: U, stack: any) => bool|void): bool; + isError(value: any): bool; + isFinite(value: any): bool; + isFunction(value: Function): true; + isFunction(value: number|string|void|null|Object): false; + isInteger(value: any): bool; + isLength(value: any): bool; + isMap(value: any): bool; + isMatch(object?: ?Object, source: Object): bool; + isMatchWith(object: T, source: U, customizer?: (objValue: any, srcValue: any, key: number|string, object: T, source: U) => bool|void): bool; + isNaN(value: any): bool; + isNative(value: any): bool; + isNil(value: any): bool; + isNull(value: any): bool; + isNumber(value: any): bool; + isObject(value: any): bool; + isObjectLike(value: any): bool; + isPlainObject(value: any): bool; + isRegExp(value: any): bool; + isSafeInteger(value: any): bool; + isSet(value: any): bool; + isString(value: string): true; + isString(value: number|bool|Function|void|null|Object|Array): false; + isSymbol(value: any): bool; + isTypedArray(value: any): bool; + isUndefined(value: any): bool; + isWeakMap(value: any): bool; + isWeakSet(value: any): bool; + lt(value: any, other: any): bool; + lte(value: any, other: any): bool; + toArray(value: any): Array; + toFinite(value: any): number; + toInteger(value: any): number; + toLength(value: any): number; + toNumber(value: any): number; + toPlainObject(value: any): Object; + toSafeInteger(value: any): number; + toString(value: any): string; + + // Math + add(augend: number, addend: number): number; + ceil(number: number, precision?: number): number; + divide(dividend: number, divisor: number): number; + floor(number: number, precision?: number): number; + max(array: ?Array): T; + maxBy(array: ?Array, iteratee?: Iteratee): T; + mean(array: Array<*>): number; + meanBy(array: Array, iteratee?: Iteratee): number; + min(array: ?Array): T; + minBy(array: ?Array, iteratee?: Iteratee): T; + multiply(multiplier: number, multiplicand: number): number; + round(number: number, precision?: number): number; + subtract(minuend: number, subtrahend: number): number; + sum(array: Array<*>): number; + sumBy(array: Array, iteratee?: Iteratee): number; + + // number + clamp(number: number, lower?: number, upper: number): number; + inRange(number: number, start?: number, end: number): bool; + random(lower?: number, upper?: number, floating?: bool): number; + + // Object + assign(object?: ?Object, ...sources?: Array): Object; + assignIn(a: A, b: B): A & B; + assignIn(a: A, b: B, c: C): A & B & C; + assignIn(a: A, b: B, c: C, d: D): A & B & C & D; + assignIn(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; + assignInWith(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object; + assignInWith(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object; + assignInWith(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object; + assignInWith(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object; + assignWith(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object; + assignWith(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object; + assignWith(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object; + assignWith(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object; + at(object?: ?Object, ...paths: Array): Array; + at(object?: ?Object, paths: Array): Array; + create(prototype: T, properties?: Object): $Supertype; + defaults(object?: ?Object, ...sources?: Array): Object; + defaultsDeep(object?: ?Object, ...sources?: Array): Object; + // alias for _.toPairs + entries(object?: ?Object): NestedArray; + // alias for _.toPairsIn + entriesIn(object?: ?Object): NestedArray; + // alias for _.assignIn + extend(a: A, b: B): A & B; + extend(a: A, b: B, c: C): A & B & C; + extend(a: A, b: B, c: C, d: D): A & B & C & D; + extend(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; + // alias for _.assignInWith + extendWith(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object; + extendWith(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object; + extendWith(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object; + extendWith(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object; + findKey(object?: ?T, predicate?: OPredicate): string|void; + findLastKey(object?: ?T, predicate?: OPredicate): string|void; + forIn(object?: ?Object, iteratee?: OIteratee<*>): Object; + forInRight(object?: ?Object, iteratee?: OIteratee<*>): Object; + forOwn(object?: ?Object, iteratee?: OIteratee<*>): Object; + forOwnRight(object?: ?Object, iteratee?: OIteratee<*>): Object; + functions(object?: ?Object): Array; + functionsIn(object?: ?Object): Array; + get(object?: ?Object|?Array, path?: ?Array|string, defaultValue?: any): any; + has(object?: ?Object, path?: ?Array|string): bool; + hasIn(object?: ?Object, path?: ?Array|string): bool; + invert(object?: ?Object, multiVal?: bool): Object; + invertBy(object: ?Object, iteratee?: Function): Object; + invoke(object?: ?Object, path?: ?Array|string, ...args?: Array): any; + keys(object?: ?Object): Array; + keysIn(object?: ?Object): Array; + mapKeys(object?: ?Object, iteratee?: OIteratee<*>): Object; + mapValues(object?: ?Object, iteratee?: OIteratee<*>): Object; + merge(object?: ?Object, ...sources?: Array): Object; + mergeWith(object: T, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object; + mergeWith(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object; + mergeWith(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object; + mergeWith(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object; + omit(object?: ?Object, ...props: Array): Object; + omit(object?: ?Object, props: Array): Object; + omitBy(object?: ?T, predicate?: OPredicate): Object; + pick(object?: ?Object, ...props: Array): Object; + pick(object?: ?Object, props: Array): Object; + pickBy(object?: ?T, predicate?: OPredicate): Object; + result(object?: ?Object, path?: ?Array|string, defaultValue?: any): any; + set(object?: ?Object, path?: ?Array|string, value: any): Object; + setWith(object: T, path?: ?Array|string, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): Object; + toPairs(object?: ?Object|Array<*>): NestedArray; + toPairsIn(object?: ?Object): NestedArray; + transform(collection: Object|Array, iteratee?: OIteratee<*>, accumulator?: any): any; + unset(object?: ?Object, path?: ?Array|string): bool; + update(object: Object, path: string[]|string, updater: Function): Object; + updateWith(object: Object, path: string[]|string, updater: Function, customizer?: Function): Object; + values(object?: ?Object): Array; + valuesIn(object?: ?Object): Array; + + // Seq + // harder to read, but this is _() + (value: any): any; + chain(value: T): any; + tap(value: T, interceptor: (value:T)=>any): T; + thru(value: T1, interceptor: (value:T1)=>T2): T2; + // TODO: _.prototype.* + + // String + camelCase(string?: ?string): string; + capitalize(string?: string): string; + deburr(string?: string): string; + endsWith(string?: string, target?: string, position?: number): bool; + escape(string?: string): string; + escapeRegExp(string?: string): string; + kebabCase(string?: string): string; + lowerCase(string?: string): string; + lowerFirst(string?: string): string; + 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; + replace(string?: string, pattern: RegExp|string, replacement: ((string: string) => string)|string): string; + snakeCase(string?: string): string; + split(string?: string, separator: RegExp|string, limit?: number): Array; + startCase(string?: string): string; + startsWith(string?: string, target?: string, position?: number): bool; + template(string?: string, options?: TemplateSettings): Function; + toLower(string?: string): string; + toUpper(string?: string): string; + trim(string?: string, chars?: string): string; + trimEnd(string?: string, chars?: string): string; + trimStart(string?: string, chars?: string): string; + truncate(string?: string, options?: TruncateOptions): string; + unescape(string?: string): string; + upperCase(string?: string): string; + upperFirst(string?: string): string; + words(string?: string, pattern?: RegExp|string): Array; + + // Util + attempt(func: Function): any; + bindAll(object?: ?Object, methodNames: Array): Object; + bindAll(object?: ?Object, ...methodNames: Array): Object; + cond(pairs: NestedArray): Function; + conforms(source: Object): Function; + constant(value: T): () => T; + defaultTo(value: T1, defaultValue: T2): T1; + // NaN is a number instead of its own type, otherwise it would behave like null/void + defaultTo(value: T1, defaultValue: T2): T1|T2; + defaultTo(value: T1, defaultValue: T2): T2; + flow(...funcs?: Array): Function; + flow(funcs?: Array): Function; + flowRight(...funcs?: Array): Function; + flowRight(funcs?: Array): Function; + identity(value: T): T; + iteratee(func?: any): Function; + matches(source: Object): Function; + matchesProperty(path?: ?Array|string, srcValue: any): Function; + method(path?: ?Array|string, ...args?: Array): Function; + methodOf(object?: ?Object, ...args?: Array): Function; + mixin(object?: T, source: Object, options?: { chain: bool }): T; + noConflict(): Lodash; + noop(...args: Array): void; + nthArg(n?: number): Function; + over(...iteratees: Array): Function; + over(iteratees: Array): Function; + overEvery(...predicates: Array): Function; + overEvery(predicates: Array): Function; + overSome(...predicates: Array): Function; + overSome(predicates: Array): Function; + property(path?: ?Array|string): Function; + propertyOf(object?: ?Object): Function; + range(start: number, end: number, step?: number): Array; + range(end: number, step?: number): Array; + rangeRight(start: number, end: number, step?: number): Array; + rangeRight(end: number, step?: number): Array; + runInContext(context?: Object): Function; + + stubArray(): Array<*>; + stubFalse(): false; + stubObject(): {}; + stubString(): ''; + stubTrue(): true; + times(n: number, ...rest: Array): Array; + times(n: number, iteratee: ((i: number) => T)): Array; + toPath(value: any): Array; + uniqueId(prefix?: string): string; + + // Properties + VERSION: string; + templateSettings: TemplateSettings; + } + + declare var exports: Lodash; +} diff --git a/flow-typed/npm/react-redux_v5.x.x.js b/flow-typed/npm/react-redux_v5.x.x.js index 8be01f19b..3536e46ae 100644 --- a/flow-typed/npm/react-redux_v5.x.x.js +++ b/flow-typed/npm/react-redux_v5.x.x.js @@ -1,10 +1,9 @@ -// flow-typed signature: 0ed284c5a2e97a9e3c0e87af3dedc09d -// flow-typed version: bdf1e66252/react-redux_v5.x.x/flow_>=v0.30.x +// flow-typed signature: c0e8d9867aff7576bb7cf63fe60a6af3 +// flow-typed version: 83053e4020/react-redux_v5.x.x/flow_>=v0.30.x <=v0.52.x -import type { Dispatch, Store } from 'redux' - -declare module 'react-redux' { +import type { Dispatch, Store } from "redux"; +declare module "react-redux" { /* S = State @@ -15,30 +14,58 @@ declare module 'react-redux' { */ - declare type MapStateToProps = (state: S, ownProps: OP) => SP | MapStateToProps; + declare type MapStateToProps = ( + state: S, + ownProps: OP + ) => ((state: S, ownProps: OP) => SP) | SP; - declare type MapDispatchToProps = ((dispatch: Dispatch, ownProps: OP) => DP) | DP; + declare type MapDispatchToProps = + | ((dispatch: Dispatch, ownProps: OP) => DP) + | DP; - declare type MergeProps = (stateProps: SP, dispatchProps: DP, ownProps: OP) => P; + declare type MergeProps = ( + stateProps: SP, + dispatchProps: DP, + ownProps: OP + ) => P; - declare type StatelessComponent

= (props: P) => ?React$Element; + declare type Context = { store: Store<*, *> }; - declare class ConnectedComponent extends React$Component { - static WrappedComponent: Class>; - getWrappedInstance(): React$Component; - static defaultProps: void; - props: OP; - state: void; + declare type StatelessComponent

= ( + props: P, + context: Context + ) => ?React$Element; + + declare class ConnectedComponent extends React$Component< + void, + OP, + void + > { + static WrappedComponent: Class>, + getWrappedInstance(): React$Component, + static defaultProps: void, + props: OP, + state: void } - declare type ConnectedComponentClass = Class>; + declare type ConnectedComponentClass = Class< + ConnectedComponent + >; declare type Connector = { - (component: StatelessComponent

): ConnectedComponentClass; - (component: Class>): ConnectedComponentClass; + ( + component: StatelessComponent

+ ): ConnectedComponentClass, + ( + component: Class> + ): ConnectedComponentClass }; - declare class Provider extends React$Component, children?: any }, void> { } + declare class Provider extends React$Component< + void, + { store: Store, children?: any }, + void + > {} declare type ConnectOptions = { pure?: boolean, @@ -81,9 +108,15 @@ declare module 'react-redux' { declare function connect( mapStateToProps: MapStateToProps, - mapDispatchToProps: MapDispatchToProps, + mapDispatchToProps: Null, mergeProps: MergeProps, options?: ConnectOptions ): Connector; + declare function connect( + mapStateToProps: MapStateToProps, + mapDispatchToProps: MapDispatchToProps, + mergeProps: MergeProps, + options?: ConnectOptions + ): Connector; } diff --git a/flow-typed/npm/redux_v3.x.x.js b/flow-typed/npm/redux_v3.x.x.js index d2dece6e2..f6445d9cf 100644 --- a/flow-typed/npm/redux_v3.x.x.js +++ b/flow-typed/npm/redux_v3.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 7f1a115f75043c44385071ea3f33c586 -// flow-typed version: 358375125e/redux_v3.x.x/flow_>=v0.33.x +// flow-typed signature: 86993bd000012d3e1ef10d757d16952d +// flow-typed version: a165222d28/redux_v3.x.x/flow_>=v0.33.x declare module 'redux' { @@ -7,19 +7,21 @@ declare module 'redux' { S = State A = Action + D = Dispatch */ - declare type Dispatch }> = (action: A) => A; + declare type DispatchAPI = (action: A) => A; + declare type Dispatch }> = DispatchAPI; - declare type MiddlewareAPI = { - dispatch: Dispatch; + declare type MiddlewareAPI> = { + dispatch: D; getState(): S; }; - declare type Store = { + declare type Store> = { // rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) - dispatch: Dispatch; + dispatch: D; getState(): S; subscribe(listener: () => void): () => void; replaceReducer(nextReducer: Reducer): void @@ -29,29 +31,79 @@ declare module 'redux' { declare type CombinedReducer = (state: $Shape & {} | void, action: A) => S; - declare type Middleware = - (api: MiddlewareAPI) => - (next: Dispatch) => Dispatch; + declare type Middleware> = + (api: MiddlewareAPI) => + (next: D) => D; - declare type StoreCreator = { - (reducer: Reducer, enhancer?: StoreEnhancer): Store; - (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; + declare type StoreCreator> = { + (reducer: Reducer, enhancer?: StoreEnhancer): Store; + (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; }; - declare type StoreEnhancer = (next: StoreCreator) => StoreCreator; + declare type StoreEnhancer> = (next: StoreCreator) => StoreCreator; - declare function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store; - declare function createStore(reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; + declare function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store; + declare function createStore(reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; - declare function applyMiddleware(...middlewares: Array>): StoreEnhancer; + declare function applyMiddleware(...middlewares: Array>): StoreEnhancer; declare type ActionCreator = (...args: Array) => A; declare type ActionCreators = { [key: K]: ActionCreator }; - declare function bindActionCreators>(actionCreator: C, dispatch: Dispatch): C; - declare function bindActionCreators>(actionCreators: C, dispatch: Dispatch): C; + declare function bindActionCreators, D: DispatchAPI>(actionCreator: C, dispatch: D): C; + declare function bindActionCreators, D: DispatchAPI>(actionCreators: C, dispatch: D): C; declare function combineReducers(reducers: O): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; - declare function compose(...fns: Array>): Function; + declare function compose(ab: (a: A) => B): (a: A) => B + declare function compose( + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => C + declare function compose( + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => D + declare function compose( + de: (d: D) => E, + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => E + declare function compose( + ef: (e: E) => F, + de: (d: D) => E, + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => F + declare function compose( + fg: (f: F) => G, + ef: (e: E) => F, + de: (d: D) => E, + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => G + declare function compose( + gh: (g: G) => H, + fg: (f: F) => G, + ef: (e: E) => F, + de: (d: D) => E, + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => H + declare function compose( + hi: (h: H) => I, + gh: (g: G) => H, + fg: (f: F) => G, + ef: (e: E) => F, + de: (d: D) => E, + cd: (c: C) => D, + bc: (b: B) => C, + ab: (a: A) => B + ): (a: A) => I + } diff --git a/flow-typed/npm/uuid_v3.x.x.js b/flow-typed/npm/uuid_v3.x.x.js new file mode 100644 index 000000000..674f69441 --- /dev/null +++ b/flow-typed/npm/uuid_v3.x.x.js @@ -0,0 +1,81 @@ +// flow-typed signature: 615e568e95029d58f116dd157e320137 +// flow-typed version: 2b95c0dfc1/uuid_v3.x.x/flow_>=v0.32.x + +declare module "uuid" { + declare class uuid { + static ( + options?: {| + random?: number[], + rng?: () => number[] | Buffer + |}, + buffer?: number[] | Buffer, + offset?: number + ): string, + + static v1( + options?: {| + node?: number[], + clockseq?: number, + msecs?: number | Date, + nsecs?: number + |}, + buffer?: number[] | Buffer, + offset?: number + ): string, + + static v4( + options?: {| + random?: number[], + rng?: () => number[] | Buffer + |}, + buffer?: number[] | Buffer, + offset?: number + ): string + } + declare module.exports: Class; +} + +declare module "uuid/v1" { + declare class v1 { + static ( + options?: {| + node?: number[], + clockseq?: number, + msecs?: number | Date, + nsecs?: number + |}, + buffer?: number[] | Buffer, + offset?: number + ): string + } + + declare module.exports: Class; +} + +declare module "uuid/v4" { + declare class v4 { + static ( + options?: {| + random?: number[], + rng?: () => number[] | Buffer + |}, + buffer?: number[] | Buffer, + offset?: number + ): string + } + + declare module.exports: Class; +} + +declare module "uuid/v5" { + declare class v5 { + static ( + name?: string | number[], + namespace?: string | number[], + buffer?: number[] | Buffer, + offset?: number + ): string + } + + declare module.exports: Class; +}