diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d27e18dd2..629a15fb9 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -210,6 +210,40 @@ declare module _ { array: List, whereValue: Dictionary): T[]; + /** + * @see _.first + **/ + export function take(array: List): T; + + /** + * @see _.first + **/ + export function take( + array: List, + n: number): T[]; + + /** + * @see _.first + **/ + export function take( + array: List, + callback: ListIterator, + thisArg?: any): T[]; + + /** + * @see _.first + **/ + export function take( + array: List, + pluckValue: string): T[]; + + /** + * @see _.first + **/ + export function take( + array: List, + whereValue: Dictionary): T[]; + /** * Flattens a nested array (the nesting can be to any depth). If isShallow is truey, the * array will only be flattened a single level. If a callback is provided each element of @@ -508,6 +542,60 @@ declare module _ { array: List, wherealue?: Dictionary): any[]; + /** + * The opposite of _.initial this method gets all but the first element or first n elements of + * an array. If a callback function is provided elements at the beginning of the array are excluded + * from the result as long as the callback returns truey. The callback is bound to thisArg and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for callback the created "_.pluck" style callback will return + * the property value of the given element. + * + * If an object is provided for callback the created "_.where" style callback will return true + * for elements that have the properties of the given object, else false. + * @param array The array to query. + * @param {(Function|Object|number|string)} [callback=1] The function called per element or the number + * of elements to exclude. If a property name or object is provided it will be used to create a + * ".pluck" or ".where" style callback, respectively. + * @param {*} [thisArg] The this binding of callback. + * @return Returns a slice of array. + **/ + export function rest( + array: List, + callback: (num: number) => boolean, + thisArg?: any): T[]; + export function rest( + array: List, + n?: number, + thisArg?: any): T[]; + export function rest( + array: List, + pluckValue: string, + thisArg?: any): T[]; + export function rest( + array: List, + whereValue: Dictionary, + thisArg?: any): T[]; + + /** + * @see _.rest + **/ + export function tail( + array: List, + callback: (num: number) => boolean, + thisArg?: any): T[]; + export function tail( + array: List, + n?: number, + thisArg?: any): T[]; + export function tail( + array: List, + pluckValue: string, + thisArg?: any): T[]; + export function tail( + array: List, + whereValue: Dictionary, + thisArg?: any): T[]; /** * Uses a binary search to determine the smallest index at which a value should be inserted @@ -1152,103 +1240,10 @@ declare module _ { - /** - * @see _.first - **/ - export function take(array: List): T; - - /** - * @see _.first - **/ - export function take( - array: List, - n: number): T[]; - - /** - * @see _.first - **/ - export function take( - array: List, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.first - **/ - export function take( - array: List, - pluckValue: string): T[]; - - /** - * @see _.first - **/ - export function take( - array: List, - whereValue: Dictionary): T[]; - - /** - * The opposite of _.initial this method gets all but the first element or first n elements of - * an array. If a callback function is provided elements at the beginning of the array are excluded - * from the result as long as the callback returns truey. The callback is bound to thisArg and - * invoked with three arguments; (value, index, array). - * - * If a property name is provided for callback the created "_.pluck" style callback will return - * the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return true - * for elements that have the properties of the given object, else false. - * @param array The array to query. - * @param {(Function|Object|number|string)} [callback=1] The function called per element or the number - * of elements to exclude. If a property name or object is provided it will be used to create a - * ".pluck" or ".where" style callback, respectively. - * @param {*} [thisArg] The this binding of callback. - * @return Returns a slice of array. - **/ - export function rest( - array: List, - callback: (num: number) => boolean, - thisArg?: any): T[]; - export function rest( - array: List, - n?: number, - thisArg?: any): T[]; - export function rest( - array: List, - pluckValue: string, - thisArg?: any): T[]; - export function rest( - array: List, - whereValue: Dictionary, - thisArg?: any): T[]; - - - - /** - * @see _.rest - **/ - export function tail( - array: List, - callback: (num: number) => boolean, - thisArg?: any): T[]; - export function tail( - array: List, - n?: number, - thisArg?: any): T[]; - export function tail( - array: List, - pluckValue: string, - thisArg?: any): T[]; - export function tail( - array: List, - whereValue: Dictionary, - thisArg?: any): T[]; - - -