import _ = require("../index"); declare module "../index" { // countBy 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 LoDashImplicitWrapper { /** * @see _.countBy */ countBy( this: LoDashImplicitWrapper | null | undefined>, iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** * @see _.countBy */ countBy( this: LoDashImplicitWrapper, iteratee?: ValueIteratee ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.countBy */ countBy( this: LoDashExplicitWrapper | null | undefined>, iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** * @see _.countBy */ countBy( this: LoDashExplicitWrapper, iteratee?: ValueIteratee ): LoDashExplicitWrapper>; } // each interface LoDashStatic { each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier } interface LoDashWrapper { /** * @see _.forEach */ each( this: LoDashWrapper, iteratee?: ArrayIterator ): this; /** * @see _.forEach */ each( this: LoDashWrapper, iteratee?: StringIterator ): this; /** * @see _.forEach */ each( this: LoDashWrapper | null | undefined>, iteratee?: ListIterator ): this; /** * @see _.forEach */ each( this: LoDashWrapper, iteratee?: ObjectIterator ): this; } // eachRight interface LoDashStatic { eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier } interface LoDashWrapper { /** * @see _.forEachRight */ eachRight( this: LoDashWrapper, iteratee?: ArrayIterator ): this; /** * @see _.forEachRight */ eachRight( this: LoDashWrapper, iteratee?: StringIterator ): this; /** * @see _.forEachRight */ eachRight( this: LoDashWrapper | null | undefined>, iteratee?: ListIterator ): this; /** * @see _.forEachRight */ eachRight( this: LoDashWrapper, iteratee?: ObjectIterator ): this; } // every 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 LoDashImplicitWrapper { /** * @see _.every */ every( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): boolean; /** * @see _.every */ every( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom ): boolean; } interface LoDashExplicitWrapper { /** * @see _.every */ every( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashExplicitWrapper; /** * @see _.every */ every( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashExplicitWrapper; } // filter 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 LoDashImplicitWrapper { /** * @see _.filter */ filter( this: LoDashImplicitWrapper, predicate?: StringIterator ): LoDashImplicitWrapper; /** * @see _.filter */ filter( this: LoDashImplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard ): LoDashImplicitWrapper; /** * @see _.filter */ filter( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashImplicitWrapper; /** * @see _.filter */ filter( this: LoDashImplicitWrapper, predicate: ObjectIteratorTypeGuard ): LoDashImplicitWrapper; /** * @see _.filter */ filter( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.filter */ filter( this: LoDashExplicitWrapper, predicate?: StringIterator ): LoDashExplicitWrapper; /** * @see _.filter */ filter( this: LoDashExplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard ): LoDashExplicitWrapper; /** * @see _.filter */ filter( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashExplicitWrapper; /** * @see _.filter */ filter( this: LoDashExplicitWrapper, predicate: ObjectIteratorTypeGuard ): LoDashExplicitWrapper; /** * @see _.filter */ filter( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashExplicitWrapper>; } // find 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 LoDashImplicitWrapper { /** * @see _.find */ find( this: LoDashImplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard, fromIndex?: number ): S|undefined; /** * @see _.find */ find( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom, fromIndex?: number ): T|undefined; /** * @see _.find */ find( this: LoDashImplicitWrapper, predicate: ObjectIteratorTypeGuard, fromIndex?: number ): S|undefined; /** * @see _.find */ find( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom, fromIndex?: number ): T[keyof T]|undefined; } interface LoDashExplicitWrapper { /** * @see _.find */ find( this: LoDashExplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.find */ find( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.find */ find( this: LoDashExplicitWrapper, predicate: ObjectIteratorTypeGuard, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.find */ find( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom, fromIndex?: number ): LoDashExplicitWrapper; } // findLast 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 LoDashImplicitWrapper { /** * @see _.findLast */ findLast( this: LoDashImplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard, fromIndex?: number ): S | undefined; /** * @see _.findLast */ findLast( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom, fromIndex?: number ): T | undefined; /** * @see _.findLast */ findLast( this: LoDashImplicitWrapper, predicate: ObjectIteratorTypeGuard, fromIndex?: number ): S|undefined; /** * @see _.findLast */ findLast( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom, fromIndex?: number ): T[keyof T]|undefined; } interface LoDashExplicitWrapper { /** * @see _.findLast */ findLast( this: LoDashExplicitWrapper | null | undefined>, predicate: ListIteratorTypeGuard, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLast */ findLast( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLast */ findLast( this: LoDashExplicitWrapper, predicate: ObjectIteratorTypeGuard, fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLast */ findLast( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom, fromIndex?: number ): LoDashExplicitWrapper; } // flatMap 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: List> | 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 LoDashImplicitWrapper { /** * @see _.flatMap */ flatMap(this: LoDashImplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashImplicitWrapper; /** * @see _.flatMap */ flatMap(): LoDashImplicitWrapper; /** * @see _.flatMap */ flatMap( this: LoDashImplicitWrapper | null | undefined>, iteratee: ListIterator> ): LoDashImplicitWrapper; /** * @see _.flatMap */ flatMap( this: LoDashImplicitWrapper, iteratee: ObjectIterator> ): LoDashImplicitWrapper; /** * @see _.flatMap */ flatMap( iteratee: string ): LoDashImplicitWrapper; /** * @see _.flatMap */ flatMap( iteratee: object ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { /** * @see _.flatMap */ flatMap(this: LoDashExplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashExplicitWrapper; /** * @see _.flatMap */ flatMap(): LoDashExplicitWrapper; /** * @see _.flatMap */ flatMap( this: LoDashExplicitWrapper | null | undefined>, iteratee: ListIterator> ): LoDashExplicitWrapper; /** * @see _.flatMap */ flatMap( this: LoDashExplicitWrapper, iteratee: ObjectIterator> ): LoDashExplicitWrapper; /** * @see _.flatMap */ flatMap( iteratee: string ): LoDashExplicitWrapper; /** * @see _.flatMap */ flatMap( iteratee: object ): LoDashExplicitWrapper; } // flatMapDeep 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: List | T> | 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 LoDashImplicitWrapper { /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> ): LoDashImplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashImplicitWrapper | null | undefined>, iteratee: ListIterator | TResult> ): LoDashImplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashImplicitWrapper, iteratee: ObjectIterator | TResult> ): LoDashImplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashImplicitWrapper, iteratee: string ): LoDashImplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashImplicitWrapper, iteratee: object ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> ): LoDashExplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashExplicitWrapper | null | undefined>, iteratee: ListIterator | TResult> ): LoDashExplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashExplicitWrapper, iteratee: ObjectIterator | TResult> ): LoDashExplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashExplicitWrapper, iteratee: string ): LoDashExplicitWrapper; /** * @see _.flatMapDeep */ flatMapDeep( this: LoDashExplicitWrapper, iteratee: object ): LoDashExplicitWrapper; } // flatMapDepth 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: List | T> | 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 LoDashImplicitWrapper { /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> ): LoDashImplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashImplicitWrapper | null | undefined>, iteratee: ListIterator | TResult>, depth?: number ): LoDashImplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashImplicitWrapper, iteratee: ObjectIterator | TResult>, depth?: number ): LoDashImplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashImplicitWrapper, iteratee: string, depth?: number ): LoDashImplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashImplicitWrapper, iteratee: object, depth?: number ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> ): LoDashExplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashExplicitWrapper | null | undefined>, iteratee: ListIterator | TResult>, depth?: number ): LoDashExplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashExplicitWrapper, iteratee: ObjectIterator | TResult>, depth?: number ): LoDashExplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashExplicitWrapper, iteratee: string, depth?: number ): LoDashExplicitWrapper; /** * @see _.flatMapDepth */ flatMapDepth( this: LoDashExplicitWrapper, iteratee: object, depth?: number ): LoDashExplicitWrapper; } // forEach 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 LoDashWrapper { /** * @see _.forEach */ forEach( this: LoDashWrapper, iteratee?: ArrayIterator ): this; /** * @see _.forEach */ forEach( this: LoDashWrapper, iteratee?: StringIterator ): this; /** * @see _.forEach */ forEach( this: LoDashWrapper | null | undefined>, iteratee?: ListIterator ): this; /** * @see _.forEach */ forEach( this: LoDashWrapper, iteratee?: ObjectIterator ): this; } // forEachRight 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 LoDashWrapper { /** * @see _.forEachRight */ forEachRight( this: LoDashWrapper, iteratee?: ArrayIterator ): this; /** * @see _.forEachRight */ forEachRight( this: LoDashWrapper, iteratee?: StringIterator ): this; /** * @see _.forEachRight */ forEachRight( this: LoDashWrapper | null | undefined>, iteratee?: ListIterator ): this; /** * @see _.forEachRight */ forEachRight( this: LoDashWrapper, iteratee?: ObjectIterator ): this; } // groupBy 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 LoDashImplicitWrapper { /** * @see _.groupBy */ groupBy( this: LoDashImplicitWrapper | null | undefined>, iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** * @see _.groupBy */ groupBy( this: LoDashImplicitWrapper, iteratee?: ValueIteratee ): LoDashImplicitWrapper>>; } interface LoDashExplicitWrapper { /** * @see _.groupBy */ groupBy( this: LoDashExplicitWrapper | null | undefined>, iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** * @see _.groupBy */ groupBy( this: LoDashExplicitWrapper, iteratee?: ValueIteratee ): LoDashExplicitWrapper>>; } // includes 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: List | Dictionary | NumericDictionary | null | undefined, target: T, fromIndex?: number ): boolean; } interface LoDashImplicitWrapper { /** * @see _.includes */ includes( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, target: T, fromIndex?: number ): boolean; } interface LoDashExplicitWrapper { /** * @see _.includes */ includes( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, target: T, fromIndex?: number ): LoDashExplicitWrapper; } // invokeMap 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[]): LoDashImplicitWrapper; /** * @see _.invokeMap **/ invokeMap( method: (...args: any[]) => TResult, ...args: any[]): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { /** * @see _.invokeMap **/ invokeMap( methodName: string, ...args: any[]): LoDashExplicitWrapper; /** * @see _.invokeMap **/ invokeMap( method: (...args: any[]) => TResult, ...args: any[]): LoDashExplicitWrapper; } // keyBy 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 LoDashImplicitWrapper { /** * @see _.keyBy */ keyBy( this: LoDashImplicitWrapper | null | undefined>, iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; /** * @see _.keyBy */ keyBy( this: LoDashImplicitWrapper, iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.keyBy */ keyBy( this: LoDashExplicitWrapper | null | undefined>, iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; /** * @see _.keyBy */ keyBy( this: LoDashExplicitWrapper, iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; } // map 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[] | null | undefined, iteratee: ArrayIterator ): TResult[]; /** * @see _.map */ map( collection: List | null | undefined, iteratee: ListIterator ): TResult[]; /** * @see _.map */ map(collection: List | Dictionary | NumericDictionary | null | undefined): T[]; /** * @see _.map */ map( collection: T | null | undefined, iteratee: ObjectIterator ): TResult[]; /** @see _.map */ map( collection: List | Dictionary | NumericDictionary | null | undefined, iteratee: K ): Array; /** * @see _.map */ map( collection: List | Dictionary | NumericDictionary | null | undefined, iteratee?: string ): any[]; /** * @see _.map */ map( collection: List | Dictionary | NumericDictionary | null | undefined, iteratee?: object ): boolean[]; } interface LoDashImplicitWrapper { /** * @see _.map */ map( this: LoDashImplicitWrapper, iteratee: ArrayIterator ): LoDashImplicitWrapper; /** * @see _.map */ map( this: LoDashImplicitWrapper | null | undefined>, iteratee: ListIterator ): LoDashImplicitWrapper; /** * @see _.map */ map(this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashImplicitWrapper; /** * @see _.map */ map( this: LoDashImplicitWrapper, iteratee: ObjectIterator ): LoDashImplicitWrapper; /** @see _.map */ map( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee: K ): LoDashImplicitWrapper>; /** * @see _.map */ map( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee?: string ): LoDashImplicitWrapper; /** * @see _.map */ map( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee?: object ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { /** * @see _.map */ map( this: LoDashExplicitWrapper, iteratee: ArrayIterator ): LoDashExplicitWrapper; /** * @see _.map */ map( this: LoDashExplicitWrapper | null | undefined>, iteratee: ListIterator ): LoDashExplicitWrapper; /** * @see _.map */ map(this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashExplicitWrapper; /** * @see _.map */ map( this: LoDashExplicitWrapper, iteratee: ObjectIterator ): LoDashExplicitWrapper; /** @see _.map */ map( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee: K ): LoDashExplicitWrapper>; /** * @see _.map */ map( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee?: string ): LoDashExplicitWrapper; /** * @see _.map */ map( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, iteratee?: object ): LoDashExplicitWrapper; } // orderBy 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- {Object} [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 LoDashImplicitWrapper { /** * @see _.orderBy */ orderBy( this: LoDashImplicitWrapper | null | undefined>, iteratees?: Many>, orders?: Many ): LoDashImplicitWrapper; /** * @see _.orderBy */ orderBy( this: LoDashImplicitWrapper | null | undefined>, iteratees?: Many>, orders?: Many ): LoDashImplicitWrapper; /** * @see _.orderBy */ orderBy( this: LoDashImplicitWrapper, iteratees?: Many>, orders?: Many ): LoDashImplicitWrapper>; /** * @see _.orderBy */ orderBy( this: LoDashImplicitWrapper, iteratees?: Many>, orders?: Many ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.orderBy */ orderBy( this: LoDashExplicitWrapper | null | undefined>, iteratees?: Many>, orders?: Many ): LoDashExplicitWrapper; /** * @see _.orderBy */ orderBy( this: LoDashExplicitWrapper | null | undefined>, iteratees?: Many>, orders?: Many ): LoDashExplicitWrapper; /** * @see _.orderBy */ orderBy( this: LoDashExplicitWrapper, iteratees?: Many>, orders?: Many ): LoDashExplicitWrapper>; /** * @see _.orderBy */ orderBy( this: LoDashExplicitWrapper, iteratees?: Many>, orders?: Many ): LoDashExplicitWrapper>; } // partition 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>]; partition( collection: List | null | undefined, callback: ValueIteratee ): [T[], T[]]; /** * @see _.partition */ partition( collection: T | null | undefined, callback: ValueIteratee ): [Array, Array]; } interface LoDashImplicitWrapper { /** * @see _.partition */ partition( this: LoDashImplicitWrapper | null | undefined>, callback: ValueIteratorTypeGuard ): LoDashImplicitWrapper<[U[], Array>]>; partition( this: LoDashImplicitWrapper | null | undefined>, callback: ValueIteratee ): LoDashImplicitWrapper<[T[], T[]]>; /** * @see _.partition */ partition( this: LoDashImplicitWrapper, callback: ValueIteratee ): LoDashImplicitWrapper<[Array, Array]>; } interface LoDashExplicitWrapper { /** * @see _.partition */ partition( this: LoDashExplicitWrapper | null | undefined>, callback: ValueIteratorTypeGuard ): LoDashExplicitWrapper<[U[], Array>]>; partition( this: LoDashExplicitWrapper | null | undefined>, callback: ValueIteratee ): LoDashExplicitWrapper<[T[], T[]]>; /** * @see _.partition */ partition( this: LoDashExplicitWrapper, callback: ValueIteratee ): LoDashExplicitWrapper<[Array, Array]>; } // reduce 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 LoDashImplicitWrapper { /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper, callback: MemoListIterator, accumulator: TResult ): TResult; /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper | null | undefined>, callback: MemoListIterator>, accumulator: TResult ): TResult; /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper, callback: MemoObjectIterator, accumulator: TResult ): TResult; /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper, callback: MemoListIterator ): T | undefined; /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper | null | undefined>, callback: MemoListIterator> ): T | undefined; /** * @see _.reduce **/ reduce( this: LoDashImplicitWrapper, callback: MemoObjectIterator ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper, callback: MemoListIterator, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper | null | undefined>, callback: MemoListIterator>, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper, callback: MemoObjectIterator, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper, callback: MemoListIterator ): LoDashExplicitWrapper; /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper | null | undefined>, callback: MemoListIterator> ): LoDashExplicitWrapper; /** * @see _.reduce **/ reduce( this: LoDashExplicitWrapper, callback: MemoObjectIterator ): LoDashExplicitWrapper; } // reduceRight 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 LoDashImplicitWrapper { /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper, callback: MemoListIterator, accumulator: TResult ): TResult; /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper | null | undefined>, callback: MemoListIterator>, accumulator: TResult ): TResult; /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper, callback: MemoObjectIterator, accumulator: TResult ): TResult; /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper, callback: MemoListIterator ): T | undefined; /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper | null | undefined>, callback: MemoListIterator> ): T | undefined; /** * @see _.reduceRight **/ reduceRight( this: LoDashImplicitWrapper, callback: MemoObjectIterator ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper, callback: MemoListIterator, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper | null | undefined>, callback: MemoListIterator>, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper, callback: MemoObjectIterator, accumulator: TResult ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper, callback: MemoListIterator ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper | null | undefined>, callback: MemoListIterator> ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ reduceRight( this: LoDashExplicitWrapper, callback: MemoObjectIterator ): LoDashExplicitWrapper; } // reject 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 LoDashImplicitWrapper { /** * @see _.reject */ reject( this: LoDashImplicitWrapper, predicate?: StringIterator ): LoDashImplicitWrapper; /** * @see _.reject */ reject( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashImplicitWrapper; /** * @see _.reject */ reject( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.reject */ reject( this: LoDashExplicitWrapper, predicate?: StringIterator ): LoDashExplicitWrapper; /** * @see _.reject */ reject( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashExplicitWrapper; /** * @see _.reject */ reject( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashExplicitWrapper>; } // sample interface LoDashStatic { /** * Gets a random element from collection. * * @param collection The collection to sample. * @return Returns the random element. */ sample( collection: List | Dictionary | NumericDictionary | null | undefined ): T | undefined; /** * @see _.sample */ sample( collection: T | null | undefined ): T[keyof T] | undefined; } interface LoDashImplicitWrapper { /** * @see _.sample */ sample( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined> ): T | undefined; /** * @see _.sample */ sample( this: LoDashImplicitWrapper ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { /** * @see _.sample */ sample( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined> ): LoDashExplicitWrapper; /** * @see _.sample */ sample( this: LoDashExplicitWrapper ): LoDashExplicitWrapper; } // sampleSize 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: List | Dictionary | NumericDictionary | null | undefined, n?: number ): T[]; /** * @see _.sampleSize */ sampleSize( collection: T | null | undefined, n?: number ): Array; } interface LoDashImplicitWrapper { /** * @see _.sampleSize */ sampleSize( this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, n?: number ): LoDashImplicitWrapper; /** * @see _.sampleSize */ sampleSize( this: LoDashImplicitWrapper, n?: number ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.sampleSize */ sampleSize( this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, n?: number ): LoDashExplicitWrapper; /** * @see _.sampleSize */ sampleSize( this: LoDashExplicitWrapper, n?: number ): LoDashExplicitWrapper>; } // shuffle 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 LoDashImplicitWrapper { /** * @see _.shuffle */ shuffle(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; /** * @see _.shuffle */ shuffle(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.shuffle */ shuffle(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; /** * @see _.shuffle */ shuffle(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; } // size 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(): LoDashExplicitWrapper; } // some 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 LoDashImplicitWrapper { /** * @see _.some */ some( this: LoDashImplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): boolean; /** * @see _.some */ some( this: LoDashImplicitWrapper, predicate?: ObjectIterateeCustom ): boolean; } interface LoDashExplicitWrapper { /** * @see _.some */ some( this: LoDashExplicitWrapper | null | undefined>, predicate?: ListIterateeCustom ): LoDashExplicitWrapper; /** * @see _.some */ some( this: LoDashExplicitWrapper, predicate?: ObjectIterateeCustom ): LoDashExplicitWrapper; } // sortBy 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 LoDashImplicitWrapper { /** * @see _.sortBy */ sortBy( this: LoDashImplicitWrapper | null | undefined>, ...iteratees: Array>> ): LoDashImplicitWrapper; /** * @see _.sortBy */ sortBy( this: LoDashImplicitWrapper, ...iteratees: Array>> ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { /** * @see _.sortBy */ sortBy( this: LoDashExplicitWrapper | null | undefined>, ...iteratees: Array>> ): LoDashExplicitWrapper; /** * @see _.sortBy */ sortBy( this: LoDashExplicitWrapper, ...iteratees: Array>> ): LoDashExplicitWrapper>; } }