Fixes for underscore.d.ts

* the type of elements in the array returned by pluck have no correlation to the type of elements in the source array - they actually relate to the values of the provided property name
* bind wasn't working for a function typed as "Function".  In our use case, we call _.throttle() then use the result in _.bind().
* the hash function passed into memoize may take multiple arguments
This commit is contained in:
Derek Cicerone
2013-10-10 19:31:06 -04:00
parent 6e7284fd52
commit 7405a33a7c
+5 -5
View File
@@ -382,7 +382,7 @@ declare module _ {
**/
export function pluck<T extends {}>(
list: Collection<T>,
propertyName: string): T[];
propertyName: string): any[];
/**
* Returns the maximum value in list.
@@ -839,7 +839,7 @@ declare module _ {
start: number,
stop: number,
step?: number): number[];
/**
* @see _.range
* @param stop Stop here.
@@ -861,7 +861,7 @@ declare module _ {
* @return `fn` with `this` bound to `object`.
**/
export function bind(
func: (...as: any[]) => any,
func: Function,
context: any,
...arguments: any[]): () => any;
@@ -900,7 +900,7 @@ declare module _ {
**/
export function memoize(
fn: Function,
hashFn?: (n: any) => string): Function;
hashFn?: (...args: any[]) => string): Function;
/**
* Much like setTimeout, invokes function after wait milliseconds. If you pass the optional arguments,
@@ -1624,7 +1624,7 @@ declare class _<T> {
* @see _.shuffle
**/
shuffle(): T[];
/**
* Wrapped type `any[]`.
* @see _.sample