diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 1d0f2fa96..a6b7b2cc1 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1725,153 +1725,233 @@ module TestUniq { { let result: string[]; - result = _.uniq('abc'); - result = _.uniq('abc', true); - result = _.uniq('abc', true, stringIterator); - result = _.uniq('abc', true, stringIterator, any); - result = _.uniq('abc', true, stringIterator); - result = _.uniq('abc', true, stringIterator, any); - result = _.uniq('abc', stringIterator); - result = _.uniq('abc', stringIterator, any); - result = _.uniq('abc', stringIterator); - result = _.uniq('abc', stringIterator, any); } { let result: SampleObject[]; result = _.uniq(array); - result = _.uniq(array, true); - result = _.uniq(array, true, listIterator); - result = _.uniq(array, true, listIterator, any); - result = _.uniq(array, true, listIterator); - result = _.uniq(array, true, listIterator, any); - result = _.uniq(array, listIterator); - result = _.uniq(array, listIterator, any); - result = _.uniq(array, listIterator); - result = _.uniq(array, listIterator, any); - result = _.uniq(array, true, 'a'); - result = _.uniq(array, true, 'a', any); - result = _.uniq(array, 'a'); - result = _.uniq(array, 'a', any); - result = _.uniq(array, true, {a: 42}); - result = _.uniq<{a: number}, SampleObject>(array, true, {a: 42}); - result = _.uniq(array, {a: 42}); - result = _.uniq<{a: number}, SampleObject>(array, {a: 42}); - result = _.uniq(list); - result = _.uniq(list, true); - result = _.uniq(list, true, listIterator); - result = _.uniq(list, true, listIterator, any); - result = _.uniq(list, true, listIterator); - result = _.uniq(list, true, listIterator, any); - result = _.uniq(list, listIterator); - result = _.uniq(list, listIterator, any); - result = _.uniq(list, listIterator); - result = _.uniq(list, listIterator, any); - result = _.uniq(list, true, 'a'); - result = _.uniq(list, true, 'a', any); - result = _.uniq(list, 'a'); - result = _.uniq(list, 'a', any); - result = _.uniq(list, true, {a: 42}); - result = _.uniq<{a: number}, SampleObject>(list, true, {a: 42}); - result = _.uniq(list, {a: 42}); - result = _.uniq<{a: number}, SampleObject>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; - result = _('abc').uniq(); - result = _('abc').uniq(true); - result = _('abc').uniq(true, stringIterator); - result = _('abc').uniq(true, stringIterator, any); - result = _('abc').uniq(stringIterator); - result = _('abc').uniq(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).uniq(); - result = _(array).uniq(true); - result = _(array).uniq(true, listIterator); - result = _(array).uniq(true, listIterator, any); - result = _(array).uniq(listIterator); - result = _(array).uniq(listIterator, any); - result = _(array).uniq(true, 'a'); - result = _(array).uniq(true, 'a', any); - result = _(array).uniq('a'); - result = _(array).uniq('a', any); - result = _(array).uniq<{a: number}>(true, {a: 42}); - result = _(array).uniq<{a: number}>({a: 42}); - result = _(list).uniq(); - result = _(list).uniq(true); - result = _(list).uniq(true, listIterator); - result = _(list).uniq(true, listIterator, any); - result = _(list).uniq(true, listIterator); - result = _(list).uniq(true, listIterator, any); - result = _(list).uniq(listIterator); - result = _(list).uniq(listIterator, any); - result = _(list).uniq(listIterator); - result = _(list).uniq(listIterator, any); - result = _(list).uniq(true, 'a'); - result = _(list).uniq(true, 'a', any); - result = _(list).uniq('a'); - result = _(list).uniq('a', any); - result = _(list).uniq(true, {a: 42}); - result = _(list).uniq<{a: number}, SampleObject>(true, {a: 42}); - result = _(list).uniq({a: 42}); - result = _(list).uniq<{a: number}, SampleObject>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().uniq(); - result = _('abc').chain().uniq(true); - result = _('abc').chain().uniq(true, stringIterator); - result = _('abc').chain().uniq(true, stringIterator, any); - result = _('abc').chain().uniq(stringIterator); - result = _('abc').chain().uniq(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().uniq(); - result = _(array).chain().uniq(true); - result = _(array).chain().uniq(true, listIterator); - result = _(array).chain().uniq(true, listIterator, any); - result = _(array).chain().uniq(listIterator); - result = _(array).chain().uniq(listIterator, any); - result = _(array).chain().uniq(true, 'a'); - result = _(array).chain().uniq(true, 'a', any); - result = _(array).chain().uniq('a'); - result = _(array).chain().uniq('a', any); - result = _(array).chain().uniq<{a: number}>(true, {a: 42}); - result = _(array).chain().uniq<{a: number}>({a: 42}); - result = _(list).chain().uniq(); - result = _(list).chain().uniq(true); - result = _(list).chain().uniq(true, listIterator); - result = _(list).chain().uniq(true, listIterator, any); - result = _(list).chain().uniq(true, listIterator); - result = _(list).chain().uniq(true, listIterator, any); - result = _(list).chain().uniq(listIterator); - result = _(list).chain().uniq(listIterator, any); - result = _(list).chain().uniq(listIterator); - result = _(list).chain().uniq(listIterator, any); - result = _(list).chain().uniq(true, 'a'); - result = _(list).chain().uniq(true, 'a', any); - result = _(list).chain().uniq('a'); - result = _(list).chain().uniq('a', any); - result = _(list).chain().uniq(true, {a: 42}); - result = _(list).chain().uniq<{a: number}, SampleObject>(true, {a: 42}); - result = _(list).chain().uniq({a: 42}); - result = _(list).chain().uniq<{a: number}, SampleObject>({a: 42}); + + } +} + + +// _.uniqBy +module TestUniqBy { + type SampleObject = {a: number; b: string; c: boolean}; + + let array: SampleObject[]; + let list: _.List; + + let stringIterator: (value: string, index: number, collection: string) => string; + let listIterator: (value: SampleObject, index: number, collection: _.List) => number; + + { + let result: string[]; + + result = _.uniqBy('abc', stringIterator); + result = _.uniqBy('abc', stringIterator); + } + + { + let result: SampleObject[]; + + result = _.uniqBy(array, listIterator); + result = _.uniqBy(array, listIterator); + result = _.uniqBy(array, 'a'); + result = _.uniqBy(array, {a: 42}); + result = _.uniqBy<{a: number}, SampleObject>(array, {a: 42}); + + result = _.uniqBy(list, listIterator); + result = _.uniqBy(list, listIterator); + result = _.uniqBy(list, 'a'); + result = _.uniqBy(list, {a: 42}); + result = _.uniqBy<{a: number}, SampleObject>(list, {a: 42}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').uniqBy(stringIterator); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).uniqBy(listIterator); + result = _(array).uniqBy('a'); + result = _(array).uniqBy<{a: number}>({a: 42}); + + result = _(list).uniqBy(listIterator); + result = _(list).uniqBy(listIterator); + result = _(list).uniqBy('a'); + result = _(list).uniqBy({a: 42}); + result = _(list).uniqBy<{a: number}, SampleObject>({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().uniqBy(stringIterator); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().uniqBy(listIterator); + result = _(array).chain().uniqBy('a'); + result = _(array).chain().uniqBy<{a: number}>({a: 42}); + + result = _(list).chain().uniqBy(listIterator); + result = _(list).chain().uniqBy(listIterator); + result = _(list).chain().uniqBy('a'); + result = _(list).chain().uniqBy({a: 42}); + result = _(list).chain().uniqBy<{a: number}, SampleObject>({a: 42}); + } +} + +// _.sortedUniq +module TestSortedUniq { + type SampleObject = {a: number; b: string; c: boolean}; + + let array: SampleObject[]; + let list: _.List; + + let stringIterator: (value: string, index: number, collection: string) => string; + let listIterator: (value: SampleObject, index: number, collection: _.List) => number; + + { + let result: string[]; + result = _.sortedUniq('abc'); + } + + { + let result: SampleObject[]; + result = _.sortedUniq(array); + result = _.sortedUniq(list); + } + + { + let result: _.LoDashImplicitArrayWrapper; + result = _('abc').sortedUniq(); + } + + { + let result: _.LoDashImplicitArrayWrapper; + result = _(array).sortedUniq(); + result = _(list).sortedUniq(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + result = _('abc').chain().sortedUniq(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + result = _(array).chain().sortedUniq(); + result = _(list).chain().sortedUniq(); + } +} + +// _.sortedUniqBy +module TestSortedUniqBy { + type SampleObject = {a: number; b: string; c: boolean}; + + let array: SampleObject[]; + let list: _.List; + + let stringIterator: (value: string, index: number, collection: string) => string; + let listIterator: (value: SampleObject, index: number, collection: _.List) => number; + + { + let result: string[]; + + result = _.sortedUniqBy('abc', stringIterator); + result = _.sortedUniqBy('abc', stringIterator); + } + + { + let result: SampleObject[]; + + result = _.sortedUniqBy(array, listIterator); + result = _.sortedUniqBy(array, listIterator); + result = _.sortedUniqBy(array, 'a'); + result = _.sortedUniqBy(array, {a: 42}); + result = _.sortedUniqBy<{a: number}, SampleObject>(array, {a: 42}); + + result = _.sortedUniqBy(list, listIterator); + result = _.sortedUniqBy(list, listIterator); + result = _.sortedUniqBy(list, 'a'); + result = _.sortedUniqBy(list, {a: 42}); + result = _.sortedUniqBy<{a: number}, SampleObject>(list, {a: 42}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').sortedUniqBy(stringIterator); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).sortedUniqBy(listIterator); + result = _(array).sortedUniqBy('a'); + result = _(array).sortedUniqBy<{a: number}>({a: 42}); + + result = _(list).sortedUniqBy(listIterator); + result = _(list).sortedUniqBy(listIterator); + result = _(list).sortedUniqBy('a'); + result = _(list).sortedUniqBy({a: 42}); + result = _(list).sortedUniqBy<{a: number}, SampleObject>({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().sortedUniqBy(stringIterator); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().sortedUniqBy(listIterator); + result = _(array).chain().sortedUniqBy('a'); + result = _(array).chain().sortedUniqBy<{a: number}>({a: 42}); + + result = _(list).chain().sortedUniqBy(listIterator); + result = _(list).chain().sortedUniqBy(listIterator); + result = _(list).chain().sortedUniqBy('a'); + result = _(list).chain().sortedUniqBy({a: 42}); + result = _(list).chain().sortedUniqBy<{a: number}, SampleObject>({a: 42}); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 8500d9ecf..1ba718812 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -146,7 +146,7 @@ added 2 number methods: - [ ] _.subtract added chain method: -- [ ] _#next +- [ ] _.next added collection method: - [ ] _.sampleSize @@ -3256,113 +3256,30 @@ declare module _ { //_.uniq interface LoDashStatic { /** - * Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only - * the first occurrence of each element is kept. Providing true for isSorted performs a faster search - * algorithm for sorted arrays. If an iteratee function is provided it’s invoked for each element in the - * array to generate the criterion by which uniqueness is computed. The iteratee is bound to thisArg and - * invoked with three arguments: (value, index, array). + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to inspect. - * @param isSorted Specify the array is sorted. - * @param iteratee The function invoked per iteration. - * @param thisArg iteratee - * @return Returns the new duplicate-value-free array. + * _.uniq([2, 1, 2]); + * // => [2, 1] */ uniq( - array: List, - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any + array: List ): T[]; /** * @see _.uniq */ uniq( - array: List, - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - isSorted?: boolean, - iteratee?: string, - thisArg?: any - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - iteratee?: string, - thisArg?: any - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - isSorted?: boolean, - iteratee?: Object - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - isSorted?: boolean, - iteratee?: TWhere - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - iteratee?: Object - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List, - iteratee?: TWhere + array: List ): T[]; } @@ -3370,299 +3287,536 @@ declare module _ { /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; + uniq(): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; + uniq(): LoDashImplicitArrayWrapper; /** * @see _.uniq */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - isSorted?: boolean, - iteratee?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - isSorted?: boolean, - iteratee?: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: TWhere - ): LoDashImplicitArrayWrapper; + uniq(): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; + uniq(): LoDashImplicitArrayWrapper; /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - isSorted?: boolean, - iteratee?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - isSorted?: boolean, - iteratee?: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - isSorted?: boolean, - iteratee?: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: TWhere - ): LoDashImplicitArrayWrapper; + uniq(): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapper { /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; + uniq(): LoDashExplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; + uniq(): LoDashExplicitArrayWrapper; /** * @see _.uniq */ - uniq( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; + uniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; /** * @see _.uniq */ - uniq( - isSorted?: boolean, - iteratee?: string, - thisArg?: any + uniq(): LoDashExplicitArrayWrapper; + } + + //_.uniqBy + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // using the `_.property` iteratee shorthand + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + uniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: string + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: Object + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: Object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - iteratee?: string, - thisArg?: any + uniqBy( + iteratee: string ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - isSorted?: boolean, - iteratee?: TWhere - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq( - iteratee?: TWhere + uniqBy( + iteratee: TWhere ): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - isSorted?: boolean, - iteratee?: ListIterator, - thisArg?: any + uniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - iteratee?: ListIterator, - thisArg?: any + uniqBy( + iteratee: string ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - iteratee?: ListIterator, - thisArg?: any + uniqBy( + iteratee: Object ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.uniqBy */ - uniq( - isSorted?: boolean, - iteratee?: string, - thisArg?: any + uniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.sortedUniq + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + sortedUniq( + array: List + ): T[]; + + /** + * @see _.sortedUniq + */ + sortedUniq( + array: List + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + sortedUniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + //_.sortedUniqBy + interface LoDashStatic { + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.2] + */ + sortedUniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: string + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: Object + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: Object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.sortedUniqBy */ - uniq( - iteratee?: string, - thisArg?: any + sortedUniqBy( + iteratee: string ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.sortedUniqBy */ - uniq( - isSorted?: boolean, - iteratee?: Object + sortedUniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.sortedUniqBy */ - uniq( - isSorted?: boolean, - iteratee?: TWhere + sortedUniqBy( + iteratee: ListIterator ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.sortedUniqBy */ - uniq( - iteratee?: Object + sortedUniqBy( + iteratee: string ): LoDashExplicitArrayWrapper; /** - * @see _.uniq + * @see _.sortedUniqBy */ - uniq( - iteratee?: TWhere + sortedUniqBy( + iteratee: Object + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere ): LoDashExplicitArrayWrapper; }