import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The * iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. * @return Returns the composed aggregate object. */ countBy(collection: List | null | undefined, iteratee?: ValueIteratee): Dictionary; /** * @see _.countBy */ countBy(collection: T | null | undefined, iteratee?: ValueIteratee): Dictionary; } interface Object { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): Object>; } interface String { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): Object>; } interface Collection { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): Object>; } interface ObjectChain { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): ObjectChain>; } interface StringChain { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): ObjectChain>; } interface StringNullableChain { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): ObjectChain>; } interface CollectionChain { /** * @see _.countBy */ countBy(iteratee?: ValueIteratee): ObjectChain>; } interface LoDashStatic { /** * @see _.forEach */ each: LoDashStatic['forEach']; } interface String { /** * @see _.each */ each: String['forEach']; } interface Collection { /** * @see _.each */ each: Collection['forEach']; } interface Object { /** * @see _.each */ each: Object['forEach']; } interface StringChain { /** * @see _.each */ each: StringChain['forEach']; } interface StringNullableChain { /** * @see _.each */ each: StringNullableChain['forEach']; } interface CollectionChain { /** * @see _.each */ each: CollectionChain['forEach']; } interface ObjectChain { /** * @see _.each */ each: ObjectChain['forEach']; } interface LoDashStatic { /** * @see _.forEachRight */ eachRight: LoDashStatic["forEachRight"]; } interface String { /** * @see _.eachRight */ eachRight: String['forEachRight']; } interface Collection { /** * @see _.eachRight */ eachRight: Collection['forEachRight']; } interface Object { /** * @see _.eachRight */ eachRight: Object['forEachRight']; } interface StringChain { /** * @see _.eachRight */ eachRight: StringChain['forEachRight']; } interface StringNullableChain { /** * @see _.eachRight */ eachRight: StringNullableChain['forEachRight']; } interface CollectionChain { /** * @see _.eachRight */ eachRight: CollectionChain['forEachRight']; } interface ObjectChain { /** * @see _.eachRight */ eachRight: ObjectChain['forEachRight']; } interface LoDashStatic { /** * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. * @return Returns true if all elements pass the predicate check, else false. */ every(collection: List | null | undefined, predicate?: ListIterateeCustom): boolean; /** * @see _.every */ every(collection: T | null | undefined, predicate?: ObjectIterateeCustom): boolean; } interface Collection { /** * @see _.every */ every(predicate?: ListIterateeCustom): boolean; } interface Object { /** * @see _.every */ every(predicate?: ObjectIterateeCustom): boolean; } interface CollectionChain { /** * @see _.every */ every(predicate?: ListIterateeCustom): PrimitiveChain; } interface ObjectChain { /** * @see _.every */ every(predicate?: ObjectIterateeCustom): PrimitiveChain; } interface LoDashStatic { /** * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The * predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. * @return Returns the new filtered array. */ filter(collection: string | null | undefined, predicate?: StringIterator): string[]; /** * @see _.filter */ filter(collection: List | null | undefined, predicate: ListIteratorTypeGuard): S[]; /** * @see _.filter */ filter(collection: List | null | undefined, predicate?: ListIterateeCustom): T[]; /** * @see _.filter */ filter(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard): S[]; /** * @see _.filter */ filter(collection: T | null | undefined, predicate?: ObjectIterateeCustom): Array; } interface String { /** * @see _.filter */ filter(predicate?: StringIterator): Collection; } interface Collection { /** * @see _.filter */ filter(predicate: ListIteratorTypeGuard): Collection; /** * @see _.filter */ filter(predicate?: ListIterateeCustom): Collection; } interface Object { /** * @see _.filter */ filter(predicate: ObjectIteratorTypeGuard): Collection; /** * @see _.filter */ filter(predicate?: ObjectIterateeCustom): Collection; } interface StringChain { /** * @see _.filter */ filter(predicate?: StringIterator): CollectionChain; } interface StringNullableChain { /** * @see _.filter */ filter(predicate?: StringIterator): CollectionChain; } interface CollectionChain { /** * @see _.filter */ filter(predicate: ListIteratorTypeGuard): CollectionChain; /** * @see _.filter */ filter(predicate?: ListIterateeCustom): CollectionChain; } interface ObjectChain { /** * @see _.filter */ filter(predicate: ObjectIteratorTypeGuard): CollectionChain; /** * @see _.filter */ filter(predicate?: ObjectIterateeCustom): CollectionChain; } interface LoDashStatic { /** * Iterates over elements of collection, returning the first element predicate returns truthy for. * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to search. * @param predicate The function invoked per iteration. * @param fromIndex The index to search from. * @return Returns the matched element, else undefined. */ find(collection: List | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.find */ find(collection: List | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T|undefined; /** * @see _.find */ find(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.find */ find(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T]|undefined; } interface Collection { /** * @see _.find */ find(predicate: ListIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.find */ find(predicate?: ListIterateeCustom, fromIndex?: number): T|undefined; } interface Object { /** * @see _.find */ find< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.find */ find(predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T]|undefined; } interface CollectionChain { /** * @see _.find */ find< S extends T>(predicate: ListIteratorTypeGuard, fromIndex?: number): ExpChain; /** * @see _.find */ find(predicate?: ListIterateeCustom, fromIndex?: number): ExpChain; } interface ObjectChain { /** * @see _.find */ find< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard, fromIndex?: number): ExpChain; /** * @see _.find */ find(predicate?: ObjectIterateeCustom, fromIndex?: number): ExpChain; } interface LoDashStatic { /** * This method is like _.find except that it iterates over elements of a collection from * right to left. * @param collection Searches for a value in this list. * @param predicate The function called per iteration. * @param fromIndex The index to search from. * @return The found element, else undefined. */ findLast(collection: List | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.findLast */ findLast(collection: List | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T|undefined; /** * @see _.findLast */ findLast(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.findLast */ findLast(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T]|undefined; } interface Collection { /** * @see _.findLast */ findLast(predicate: ListIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.findLast */ findLast(predicate?: ListIterateeCustom, fromIndex?: number): T|undefined; } interface Object { /** * @see _.findLast */ findLast< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard, fromIndex?: number): S|undefined; /** * @see _.findLast */ findLast(predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T]|undefined; } interface CollectionChain { /** * @see _.findLast */ findLast< S extends T>(predicate: ListIteratorTypeGuard, fromIndex?: number): ExpChain; /** * @see _.findLast */ findLast(predicate?: ListIterateeCustom, fromIndex?: number): ExpChain; } interface ObjectChain { /** * @see _.findLast */ findLast< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard, fromIndex?: number): ExpChain; /** * @see _.findLast */ findLast(predicate?: ObjectIterateeCustom, fromIndex?: number): ExpChain; } interface LoDashStatic { /** * Creates an array of flattened values by running each element in collection through iteratee * and concating its result to the other mapped values. The iteratee is invoked with three arguments: * (value, index|key, collection). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. * @return Returns the new flattened array. */ flatMap(collection: Dictionary> | NumericDictionary> | null | undefined): T[]; /** * @see _.flatMap */ flatMap(collection: object | null | undefined): any[]; /** * @see _.flatMap */ flatMap(collection: List | null | undefined, iteratee: ListIterator>): TResult[]; /** * @see _.flatMap */ flatMap(collection: T | null | undefined, iteratee: ObjectIterator>): TResult[]; /** * @see _.flatMap */ flatMap(collection: object | null | undefined, iteratee: string): any[]; /** * @see _.flatMap */ flatMap(collection: object | null | undefined, iteratee: object): boolean[]; } interface String { /** * @see _.flatMap */ flatMap(iteratee: StringIterator>): Collection; /** * @see _.flatMap */ flatMap(): Collection; } interface Collection { /** * @see _.flatMap */ flatMap(iteratee: ListIterator> | PropertyName): Collection; /** * @see _.flatMap */ flatMap(iteratee: [PropertyName, any] | object): Collection; /** * @see _.flatMap */ flatMap(): T extends Many ? Collection : Collection; } interface Object { /** * @see _.flatMap */ flatMap(iteratee: ObjectIterator> | PropertyName): Collection; /** * @see _.flatMap */ flatMap(iteratee: [PropertyName, any] | object): Collection; /** * @see _.flatMap */ flatMap(): Collection; } interface StringChain { /** * @see _.flatMap */ flatMap(iteratee: StringIterator>): CollectionChain; /** * @see _.flatMap */ flatMap(): CollectionChain; } interface StringNullableChain { /** * @see _.flatMap */ flatMap(iteratee: StringIterator>): CollectionChain; /** * @see _.flatMap */ flatMap(): CollectionChain; } interface CollectionChain { /** * @see _.flatMap */ flatMap(iteratee: ListIterator> | PropertyName): CollectionChain; /** * @see _.flatMap */ flatMap(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.flatMap */ flatMap(): T extends Many ? CollectionChain : CollectionChain; } interface ObjectChain { /** * @see _.flatMap */ flatMap(iteratee: ObjectIterator> | PropertyName): CollectionChain; /** * @see _.flatMap */ flatMap(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.flatMap */ flatMap(): CollectionChain; } interface LoDashStatic { /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @since 4.7.0 * @category Collection * @param collection The collection to iterate over. * @param [iteratee=_.identity] The function invoked per iteration. * @returns Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ flatMapDeep(collection: Dictionary | T> | NumericDictionary | T> | null | undefined): T[]; /** * @see _.flatMapDeep */ flatMapDeep(collection: List | null | undefined, iteratee: ListIterator | TResult>): TResult[]; /** * @see _.flatMapDeep */ flatMapDeep(collection: T | null | undefined, iteratee: ObjectIterator | TResult>): TResult[]; /** * @see _.flatMapDeep */ flatMapDeep(collection: object | null | undefined, iteratee: string): any[]; /** * @see _.flatMapDeep */ flatMapDeep(collection: object | null | undefined, iteratee: object): boolean[]; } interface String { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: StringIterator | TResult>): Collection; /** * @see _.flatMapDeep */ flatMapDeep(): Collection; } interface Collection { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: ListIterator | TResult> | PropertyName): Collection; /** * @see _.flatMapDeep */ flatMapDeep(iteratee: [PropertyName, any] | object): Collection; /** * @see _.flatMapDeep */ flatMapDeep(): Collection; } interface Object { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: ObjectIterator | TResult> | PropertyName): Collection; /** * @see _.flatMapDeep */ flatMapDeep(iteratee: [PropertyName, any] | object): Collection; /** * @see _.flatMapDeep */ flatMapDeep(): Collection; } interface StringChain { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: StringIterator | TResult>): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(): CollectionChain; } interface StringNullableChain { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: StringIterator | TResult>): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(): CollectionChain; } interface CollectionChain { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: ListIterator | TResult> | PropertyName): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(): CollectionChain; } interface ObjectChain { /** * @see _.flatMapDeep */ flatMapDeep(iteratee: ObjectIterator | TResult> | PropertyName): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.flatMapDeep */ flatMapDeep(): CollectionChain; } interface LoDashStatic { /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @since 4.7.0 * @category Collection * @param collection The collection to iterate over. * @param [iteratee=_.identity] The function invoked per iteration. * @param [depth=1] The maximum recursion depth. * @returns Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ flatMapDepth(collection: Dictionary | T> | NumericDictionary | T> | null | undefined): T[]; /** * @see _.flatMapDepth */ flatMapDepth(collection: List | null | undefined, iteratee: ListIterator | TResult>, depth?: number): TResult[]; /** * @see _.flatMapDepth */ flatMapDepth(collection: T | null | undefined, iteratee: ObjectIterator | TResult>, depth?: number): TResult[]; /** * @see _.flatMapDepth */ flatMapDepth(collection: object | null | undefined, iteratee: string, depth?: number): any[]; /** * @see _.flatMapDepth */ flatMapDepth(collection: object | null | undefined, iteratee: object, depth?: number): boolean[]; } interface String { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: StringIterator | TResult>, depth?: number): Collection; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): Collection; } interface Collection { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: ListIterator | TResult> | PropertyName, depth?: number): Collection; /** * @see _.flatMapDepth */ flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): Collection; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): Collection; } interface Object { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: ObjectIterator | TResult> | PropertyName, depth?: number): Collection; /** * @see _.flatMapDepth */ flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): Collection; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): Collection; } interface StringChain { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: StringIterator | TResult>, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): CollectionChain; } interface StringNullableChain { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: StringIterator | TResult>, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): CollectionChain; } interface CollectionChain { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: ListIterator | TResult> | PropertyName, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): CollectionChain; } interface ObjectChain { /** * @see _.flatMapDepth */ flatMapDepth(iteratee: ObjectIterator | TResult> | PropertyName, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): CollectionChain; /** * @see _.flatMapDepth */ flatMapDepth(depth?: number): CollectionChain; } interface LoDashStatic { /** * Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. * * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To * avoid this behavior _.forIn or _.forOwn may be used for object iteration. * * @alias _.each * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. */ forEach(collection: T[], iteratee?: ArrayIterator): T[]; /** * @see _.forEach */ forEach(collection: string, iteratee?: StringIterator): string; /** * @see _.forEach */ forEach(collection: List, iteratee?: ListIterator): List; /** * @see _.forEach */ forEach(collection: T, iteratee?: ObjectIterator): T; /** * @see _.forEach */ forEach(collection: TArray & (T[] | null | undefined), iteratee?: ArrayIterator): TArray; /** * @see _.forEach */ forEach(collection: TString, iteratee?: StringIterator): TString; /** * @see _.forEach */ forEach | null | undefined>(collection: TList & (List | null | undefined), iteratee?: ListIterator): TList; /** * @see _.forEach */ forEach(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; } interface String { /** * @see _.forEach */ forEach(iteratee?: StringIterator): String; } interface Object { /** * @see _.forEach */ forEach(iteratee?: ObjectIterator): Object; } interface Collection { /** * @see _.forEach */ forEach(iteratee?: ListIterator): Collection; } interface StringChain { /** * @see _.forEach */ forEach(iteratee?: StringIterator): StringChain; } interface StringNullableChain { /** * @see _.forEach */ forEach(iteratee?: StringIterator): StringNullableChain; } interface ObjectChain { /** * @see _.forEach */ forEach(iteratee?: ObjectIterator): ObjectChain; } interface CollectionChain { /** * @see _.forEach */ forEach(iteratee?: ListIterator): CollectionChain; } interface LoDashStatic { /** * This method is like _.forEach except that it iterates over elements of collection from right to left. * * @alias _.eachRight * * @param collection The collection to iterate over. * @param iteratee The function called per iteration. */ forEachRight(collection: T[], iteratee?: ArrayIterator): T[]; /** * @see _.forEachRight */ forEachRight(collection: string, iteratee?: StringIterator): string; /** * @see _.forEachRight */ forEachRight(collection: List, iteratee?: ListIterator): List; /** * @see _.forEachRight */ forEachRight(collection: T, iteratee?: ObjectIterator): T; /** * @see _.forEachRight */ forEachRight(collection: TArray & (T[] | null | undefined), iteratee?: ArrayIterator): TArray; /** * @see _.forEachRight */ forEachRight(collection: TString, iteratee?: StringIterator): TString; /** * @see _.forEachRight */ forEachRight | null | undefined>(collection: TList & (List | null | undefined), iteratee?: ListIterator): TList; /** * @see _.forEachRight */ forEachRight(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; } interface String { /** * @see _.forEachRight */ forEachRight(iteratee?: StringIterator): String; } interface Object { /** * @see _.forEachRight */ forEachRight(iteratee?: ObjectIterator): Object; } interface Collection { /** * @see _.forEachRight */ forEachRight(iteratee?: ListIterator): Collection; } interface StringChain { /** * @see _.forEachRight */ forEachRight(iteratee?: StringIterator): StringChain; } interface StringNullableChain { /** * @see _.forEachRight */ forEachRight(iteratee?: StringIterator): StringNullableChain; } interface ObjectChain { /** * @see _.forEachRight */ forEachRight(iteratee?: ObjectIterator): ObjectChain; } interface CollectionChain { /** * @see _.forEachRight */ forEachRight(iteratee?: ListIterator): CollectionChain; } interface LoDashStatic { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is an array of the elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. * @return Returns the composed aggregate object. */ groupBy(collection: List | null | undefined, iteratee?: ValueIteratee): Dictionary; /** * @see _.groupBy */ groupBy(collection: T | null | undefined, iteratee?: ValueIteratee): Dictionary>; } interface String { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): Object>; } interface Collection { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): Object>; } interface Object { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): Object>>; } interface StringChain { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): ObjectChain>; } interface StringNullableChain { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): ObjectChain>; } interface CollectionChain { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): ObjectChain>; } interface ObjectChain { /** * @see _.groupBy */ groupBy(iteratee?: ValueIteratee): ObjectChain>>; } interface LoDashStatic { /** * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, * it’s used as the offset from the end of collection. * * @param collection The collection to search. * @param target The value to search for. * @param fromIndex The index to search from. * @return True if the target element is found, else false. */ includes(collection: Dictionary | NumericDictionary | null | undefined, target: T, fromIndex?: number): boolean; } interface Object { /** * @see _.includes */ includes(target: T[keyof T], fromIndex?: number): boolean; } interface Collection { /** * @see _.includes */ includes(target: T, fromIndex?: number): boolean; } interface String { /** * @see _.includes */ includes(target: string, fromIndex?: number): boolean; } interface ObjectChain { /** * @see _.includes */ includes(target: T[keyof T], fromIndex?: number): PrimitiveChain; } interface CollectionChain { /** * @see _.includes */ includes(target: T, fromIndex?: number): PrimitiveChain; } interface StringChain { /** * @see _.includes */ includes(target: string, fromIndex?: number): PrimitiveChain; } interface LoDashStatic { /** * Invokes the method named by methodName on each element in the collection returning * an array of the results of each invoked method. Additional arguments will be provided * to each invoked method. If methodName is a function it will be invoked for, and this * bound to, each element in the collection. * @param collection The collection to iterate over. * @param methodName The name of the method to invoke. * @param args Arguments to invoke the method with. */ invokeMap(collection: object | null | undefined, methodName: string, ...args: any[]): any[]; /** * @see _.invokeMap */ invokeMap(collection: object | null | undefined, method: (...args: any[]) => TResult, ...args: any[]): TResult[]; } interface LoDashImplicitWrapper { /** * @see _.invokeMap */ invokeMap(methodName: string, ...args: any[]): Collection; /** * @see _.invokeMap */ invokeMap(method: (...args: any[]) => TResult, ...args: any[]): Collection; } interface LoDashExplicitWrapper { /** * @see _.invokeMap */ invokeMap(methodName: string, ...args: any[]): CollectionChain; /** * @see _.invokeMap */ invokeMap(method: (...args: any[]) => TResult, ...args: any[]): CollectionChain; } interface LoDashStatic { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the last element responsible for generating the key. The * iteratee function is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. * @return Returns the composed aggregate object. */ keyBy(collection: List | null | undefined, iteratee?: ValueIterateeCustom): Dictionary; /** * @see _.keyBy */ keyBy(collection: T | null | undefined, iteratee?: ValueIterateeCustom): Dictionary; } interface String { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): Object>; } interface Collection { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): Object>; } interface Object { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): Object>; } interface StringChain { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): ObjectChain>; } interface StringNullableChain { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): ObjectChain>; } interface CollectionChain { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): ObjectChain>; } interface ObjectChain { /** * @see _.keyBy */ keyBy(iteratee?: ValueIterateeCustom): ObjectChain>; } interface LoDashStatic { /** * Creates an array of values by running each element in collection through iteratee. The iteratee is * invoked with three arguments: (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, * _.reject, and _.some. * * The guarded methods are: * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, * sample, some, sum, uniq, and words * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. * @return Returns the new mapped array. */ map(collection: T, iteratee: TupleIterator): { [K in keyof T]: TResult }; /** * @see _.map */ map(collection: T[] | null | undefined, iteratee: ArrayIterator): TResult[]; /** * @see _.map */ map(collection: List | null | undefined, iteratee: ListIterator): TResult[]; /** * @see _.map */ map(collection: Dictionary | NumericDictionary | null | undefined): T[]; /** * @see _.map */ map(collection: T | null | undefined, iteratee: ObjectIterator): TResult[]; /** * @see _.map */ map(collection: Dictionary | NumericDictionary | null | undefined, iteratee: K): Array; /** * @see _.map */ map(collection: Dictionary | NumericDictionary | null | undefined, iteratee?: string): any[]; /** * @see _.map */ map(collection: Dictionary | NumericDictionary | null | undefined, iteratee?: object): boolean[]; } interface String { /** * @see _.map */ map(iteratee: StringIterator): Collection; /** * @see _.map */ map(): Collection; } interface Collection { /** * @see _.map */ map(key: K): Collection; /** * @see _.map */ map(iteratee: ListIterator): Collection; /** * @see _.map */ map(iteratee: PropertyName): Collection; /** * @see _.map */ map(iteratee: [PropertyName, any] | object): Collection; /** * @see _.map */ map(): Collection; } interface Object { /** * @see _.map */ map(key: K): Collection; /** * @see _.map */ map(iteratee: ObjectIterator): Collection; /** * @see _.map */ map(iteratee: PropertyName): Collection; /** * @see _.map */ map(iteratee: [PropertyName, any] | object): Collection; /** * @see _.map */ map(): Collection; } interface StringChain { /** * @see _.map */ map(iteratee: StringIterator): CollectionChain; /** * @see _.map */ map(): CollectionChain; } interface StringNullableChain { /** * @see _.map */ map(iteratee: StringIterator): CollectionChain; /** * @see _.map */ map(): CollectionChain; } interface CollectionChain { /** * @see _.map */ map(key: K): CollectionChain; /** * @see _.map */ map(iteratee: ListIterator): CollectionChain; /** * @see _.map */ map(iteratee: PropertyName): CollectionChain; /** * @see _.map */ map(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.map */ map(): CollectionChain; } interface ObjectChain { /** * @see _.map */ map(key: K): CollectionChain; /** * @see _.map */ map(iteratee: ObjectIterator): CollectionChain; /** * @see _.map */ map(iteratee: PropertyName): CollectionChain; /** * @see _.map */ map(iteratee: [PropertyName, any] | object): CollectionChain; /** * @see _.map */ map(): CollectionChain; } interface LoDashStatic { /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @category Collection * @param collection The collection to iterate over. * @param [iteratees=[_.identity]] The iteratees to sort by. * @param [orders] The sort orders of `iteratees`. * @param [guard] Enables use as an iteratee for functions like `_.reduce`. * @returns Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 42 }, * { 'user': 'barney', 'age': 36 } * ]; * * // sort by `user` in ascending order and by `age` in descending order * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] */ orderBy(collection: List | null | undefined, iteratees?: Many>, orders?: Many): T[]; /** * @see _.orderBy */ orderBy(collection: List | null | undefined, iteratees?: Many>, orders?: Many): T[]; /** * @see _.orderBy */ orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; /** * @see _.orderBy */ orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; } interface Collection { /** * @see _.orderBy */ orderBy(iteratees?: Many | PropertyName | PartialShallow>, orders?: Many): Collection; } interface Object { /** * @see _.orderBy */ orderBy(iteratees?: Many>, orders?: Many): Collection; } interface CollectionChain { /** * @see _.orderBy */ orderBy(iteratees?: Many | PropertyName | PartialShallow>, orders?: Many): CollectionChain; } interface ObjectChain { /** * @see _.orderBy */ orderBy(iteratees?: Many>, orders?: Many): CollectionChain; } interface LoDashStatic { /** * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, * while the second of which contains elements predicate returns falsey for. * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param callback The function called per iteration. * @return Returns the array of grouped elements. */ partition(collection: List | null | undefined, callback: ValueIteratorTypeGuard): [U[], Array>]; /** * @see _.partition */ partition(collection: List | null | undefined, callback: ValueIteratee): [T[], T[]]; /** * @see _.partition */ partition(collection: T | null | undefined, callback: ValueIteratee): [Array, Array]; } interface String { /** * @see _.partition */ partition(callback: StringIterator): LoDashImplicitWrapper<[string[], string[]]>; } interface Collection { /** * @see _.partition */ partition(callback: ValueIteratorTypeGuard): LoDashImplicitWrapper<[U[], Array>]>; /** * @see _.partition */ partition(callback: ValueIteratee): LoDashImplicitWrapper<[T[], T[]]>; } interface Object { /** * @see _.partition */ partition(callback: ValueIteratee): LoDashImplicitWrapper<[Array, Array]>; } interface StringChain { /** * @see _.partition */ partition(callback: StringIterator): LoDashExplicitWrapper<[string[], string[]]>; } interface StringNullableChain { /** * @see _.partition */ partition(callback: StringIterator): LoDashExplicitWrapper<[string[], string[]]>; } interface CollectionChain { /** * @see _.partition */ partition(callback: ValueIteratorTypeGuard): LoDashExplicitWrapper<[U[], Array>]>; /** * @see _.partition */ partition(callback: ValueIteratee): LoDashExplicitWrapper<[T[], T[]]>; } interface ObjectChain { /** * @see _.partition */ partition(callback: ValueIteratee): LoDashExplicitWrapper<[Array, Array]>; } interface LoDashStatic { /** * Reduces a collection to a value which is the accumulated result of running each * element in the collection through the callback, where each successive callback execution * consumes the return value of the previous execution. If accumulator is not provided the * first element of the collection will be used as the initial accumulator value. The callback * is invoked with four arguments: (accumulator, value, index|key, collection). * @param collection The collection to iterate over. * @param callback The function called per iteration. * @param accumulator Initial value of the accumulator. * @return Returns the accumulated value. */ reduce(collection: T[] | null | undefined, callback: MemoListIterator, accumulator: TResult): TResult; /** * @see _.reduce */ reduce(collection: List | null | undefined, callback: MemoListIterator>, accumulator: TResult): TResult; /** * @see _.reduce */ reduce(collection: T | null | undefined, callback: MemoObjectIterator, accumulator: TResult): TResult; /** * @see _.reduce */ reduce(collection: T[] | null | undefined, callback: MemoListIterator): T | undefined; /** * @see _.reduce */ reduce(collection: List | null | undefined, callback: MemoListIterator>): T | undefined; /** * @see _.reduce */ reduce(collection: T | null | undefined, callback: MemoObjectIterator): T[keyof T] | undefined; } interface Collection { /** * @see _.reduce */ reduce(callback: MemoListIterator>, accumulator: TResult): TResult; /** * @see _.reduce */ reduce(callback: MemoListIterator>): T | undefined; } interface Object { /** * @see _.reduce */ reduce(callback: MemoObjectIterator, accumulator: TResult): TResult; /** * @see _.reduce */ reduce(callback: MemoObjectIterator): T[keyof T] | undefined; } interface CollectionChain { /** * @see _.reduce */ reduce(callback: MemoListIterator>, accumulator: TResult): ExpChain; /** * @see _.reduce */ reduce(callback: MemoListIterator>): ExpChain; } interface ObjectChain { /** * @see _.reduce */ reduce(callback: MemoObjectIterator, accumulator: TResult): ExpChain; /** * @see _.reduce */ reduce(callback: MemoObjectIterator): ExpChain; } interface LoDashStatic { /** * This method is like _.reduce except that it iterates over elements of a collection from * right to left. * @param collection The collection to iterate over. * @param callback The function called per iteration. * @param accumulator Initial value of the accumulator. * @return The accumulated value. */ reduceRight(collection: T[] | null | undefined, callback: MemoListIterator, accumulator: TResult): TResult; /** * @see _.reduceRight */ reduceRight(collection: List | null | undefined, callback: MemoListIterator>, accumulator: TResult): TResult; /** * @see _.reduceRight */ reduceRight(collection: T | null | undefined, callback: MemoObjectIterator, accumulator: TResult): TResult; /** * @see _.reduceRight */ reduceRight(collection: T[] | null | undefined, callback: MemoListIterator): T | undefined; /** * @see _.reduceRight */ reduceRight(collection: List | null | undefined, callback: MemoListIterator>): T | undefined; /** * @see _.reduceRight */ reduceRight(collection: T | null | undefined, callback: MemoObjectIterator): T[keyof T] | undefined; } interface Collection { /** * @see _.reduceRight */ reduceRight(callback: MemoListIterator>, accumulator: TResult): TResult; /** * @see _.reduceRight */ reduceRight(callback: MemoListIterator>): T | undefined; } interface Object { /** * @see _.reduceRight */ reduceRight(callback: MemoObjectIterator, accumulator: TResult): TResult; /** * @see _.reduceRight */ reduceRight(callback: MemoObjectIterator): T[keyof T] | undefined; } interface CollectionChain { /** * @see _.reduceRight */ reduceRight(callback: MemoListIterator>, accumulator: TResult): ExpChain; /** * @see _.reduceRight */ reduceRight(callback: MemoListIterator>): ExpChain; } interface ObjectChain { /** * @see _.reduceRight */ reduceRight(callback: MemoObjectIterator, accumulator: TResult): ExpChain; /** * @see _.reduceRight */ reduceRight(callback: MemoObjectIterator): ExpChain; } interface LoDashStatic { /** * The opposite of _.filter; this method returns the elements of collection that predicate does not return * truthy for. * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. * @return Returns the new filtered array. */ reject(collection: string | null | undefined, predicate?: StringIterator): string[]; /** * @see _.reject */ reject(collection: List | null | undefined, predicate?: ListIterateeCustom): T[]; /** * @see _.reject */ reject(collection: T | null | undefined, predicate?: ObjectIterateeCustom): Array; } interface String { /** * @see _.reject */ reject(predicate?: StringIterator): Collection; } interface Collection { /** * @see _.reject */ reject(predicate?: ListIterateeCustom): Collection; } interface Object { /** * @see _.reject */ reject(predicate?: ObjectIterateeCustom): Collection; } interface StringChain { /** * @see _.reject */ reject(predicate?: StringIterator): CollectionChain; } interface StringNullableChain { /** * @see _.reject */ reject(predicate?: StringIterator): CollectionChain; } interface CollectionChain { /** * @see _.reject */ reject(predicate?: ListIterateeCustom): CollectionChain; } interface ObjectChain { /** * @see _.reject */ reject(predicate?: ObjectIterateeCustom): CollectionChain; } interface LoDashStatic { /** * Gets a random element from collection. * * @param collection The collection to sample. * @return Returns the random element. */ sample(collection: readonly [T, ...T[]]): T; /** * @see _.sample */ sample(collection: Dictionary | NumericDictionary | null | undefined): T | undefined; /** * @see _.sample */ sample(collection: T | null | undefined): T[keyof T] | undefined; } interface String { /** * @see _.sample */ sample(): string | undefined; } interface Collection { /** * @see _.sample */ sample(): T | undefined; } interface Object { /** * @see _.sample */ sample(): T[keyof T] | undefined; } interface StringChain { /** * @see _.sample */ sample(): StringNullableChain; } interface StringNullableChain { /** * @see _.sample */ sample(): StringNullableChain; } interface CollectionChain { /** * @see _.sample */ sample(): ExpChain; } interface ObjectChain { /** * @see _.sample */ sample(): ExpChain; } interface LoDashStatic { /** * Gets n random elements at unique keys from collection up to the size of collection. * * @param collection The collection to sample. * @param n The number of elements to sample. * @return Returns the random elements. */ sampleSize(collection: Dictionary | NumericDictionary | null | undefined, n?: number): T[]; /** * @see _.sampleSize */ sampleSize(collection: T | null | undefined, n?: number): Array; } interface String { /** * @see _.sampleSize */ sampleSize(n?: number): Collection; } interface Collection { /** * @see _.sampleSize */ sampleSize(n?: number): Collection; } interface Object { /** * @see _.sampleSize */ sampleSize(n?: number): Collection; } interface StringChain { /** * @see _.sampleSize */ sampleSize(n?: number): CollectionChain; } interface StringNullableChain { /** * @see _.sampleSize */ sampleSize(n?: number): CollectionChain; } interface CollectionChain { /** * @see _.sampleSize */ sampleSize(n?: number): CollectionChain; } interface ObjectChain { /** * @see _.sampleSize */ sampleSize(n?: number): CollectionChain; } interface LoDashStatic { /** * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. * * @param collection The collection to shuffle. * @return Returns the new shuffled array. */ shuffle(collection: List | null | undefined): T[]; /** * @see _.shuffle */ shuffle(collection: T | null | undefined): Array; } interface String { /** * @see _.shuffle */ shuffle(): Collection; } interface Collection { /** * @see _.shuffle */ shuffle(): Collection; } interface Object { /** * @see _.shuffle */ shuffle(): Collection; } interface StringChain { /** * @see _.shuffle */ shuffle(): CollectionChain; } interface StringNullableChain { /** * @see _.shuffle */ shuffle(): CollectionChain; } interface CollectionChain { /** * @see _.shuffle */ shuffle(): CollectionChain; } interface ObjectChain { /** * @see _.shuffle */ shuffle(): CollectionChain; } interface LoDashStatic { /** * Gets the size of collection by returning its length for array-like values or the number of own enumerable * properties for objects. * * @param collection The collection to inspect. * @return Returns the size of collection. */ size(collection: object | string | null | undefined): number; } interface LoDashImplicitWrapper { /** * @see _.size */ size(): number; } interface LoDashExplicitWrapper { /** * @see _.size */ size(): PrimitiveChain; } interface LoDashStatic { /** * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. * @return Returns true if any element passes the predicate check, else false. */ some(collection: List | null | undefined, predicate?: ListIterateeCustom): boolean; /** * @see _.some */ some(collection: T | null | undefined, predicate?: ObjectIterateeCustom): boolean; } interface Collection { /** * @see _.some */ some(predicate?: ListIterateeCustom): boolean; } interface Object { /** * @see _.some */ some(predicate?: ObjectIterateeCustom): boolean; } interface CollectionChain { /** * @see _.some */ some(predicate?: ListIterateeCustom): PrimitiveChain; } interface ObjectChain { /** * @see _.some */ some(predicate?: ObjectIterateeCustom): PrimitiveChain; } interface LoDashStatic { /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection through each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @category Collection * @param collection The collection to iterate over. * @param [iteratees=[_.identity]] * The iteratees to sort by, specified individually or in arrays. * @returns Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 42 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, function(o) { return o.user; }); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] * * _.sortBy(users, 'user', function(o) { * return Math.floor(o.age / 10); * }); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] */ sortBy(collection: List | null | undefined, ...iteratees: Array>>): T[]; /** * @see _.sortBy */ sortBy(collection: T | null | undefined, ...iteratees: Array>>): Array; } interface Collection { /** * @see _.sortBy */ sortBy(...iteratees: Array>>): Collection; } interface Object { /** * @see _.sortBy */ sortBy(...iteratees: Array>>): Collection; } interface CollectionChain { /** * @see _.sortBy */ sortBy(...iteratees: Array>>): CollectionChain; } interface ObjectChain { /** * @see _.sortBy */ sortBy(...iteratees: Array>>): CollectionChain; } }