Merge pull request #3930 from jedmao/lodash

Lodash union types, optional args
This commit is contained in:
Masahiro Wakame
2015-05-06 23:57:50 +09:00
+33 -50
View File
@@ -287,12 +287,12 @@ declare module _ {
* @param array Array to compact.
* @return (Array) Returns a new array of filtered values.
**/
compact<T>(array: Array<T>): T[];
compact<T>(array?: Array<T>): T[];
/**
* @see _.compact
**/
compact<T>(array: List<T>): T[];
compact<T>(array?: List<T>): T[];
}
interface LoDashArrayWrapper<T> {
@@ -312,13 +312,13 @@ declare module _ {
* @return Returns a new array of filtered values.
**/
difference<T>(
array: Array<T>,
array?: Array<T>,
...others: Array<T>[]): T[];
/**
* @see _.difference
**/
difference<T>(
array: List<T>,
array?: List<T>,
...others: List<T>[]): T[];
}
@@ -456,12 +456,12 @@ declare module _ {
* @param array Retrieves the first element of this array.
* @return Returns the first element of `array`.
**/
first<T>(array: Array<T>): T;
first<T>(array?: Array<T>): T;
/**
* @see _.first
**/
first<T>(array: List<T>): T;
first<T>(array?: List<T>): T;
/**
* @see _.first
@@ -5701,7 +5701,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is an arguments object, else false.
**/
isArguments(value: any): boolean;
isArguments(value?: any): boolean;
}
//_.isArray
@@ -5711,7 +5711,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is an array, else false.
**/
isArray(value: any): boolean;
isArray(value?: any): boolean;
}
//_.isBoolean
@@ -5721,7 +5721,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a boolean value, else false.
**/
isBoolean(value: any): boolean;
isBoolean(value?: any): boolean;
}
//_.isDate
@@ -5731,7 +5731,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a date, else false.
**/
isDate(value: any): boolean;
isDate(value?: any): boolean;
}
//_.isElement
@@ -5741,7 +5741,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a DOM element, else false.
**/
isElement(value: any): boolean;
isElement(value?: any): boolean;
}
//_.isEmpty
@@ -5752,22 +5752,7 @@ declare module _ {
* @param value The value to inspect.
* @return True if the value is empty, else false.
**/
isEmpty(value: any[]): boolean;
/**
* @see _.isEmpty
**/
isEmpty(value: Dictionary<any>): boolean;
/**
* @see _.isEmpty
**/
isEmpty(value: string): boolean;
/**
* @see _.isEmpty
**/
isEmpty(value: any): boolean;
isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
}
//_.isError
@@ -5796,8 +5781,8 @@ declare module _ {
* @return True if the values are equivalent, else false.
**/
isEqual(
a: any,
b: any,
a?: any,
b?: any,
callback?: (a: any, b: any) => boolean,
thisArg?: any): boolean;
}
@@ -5812,7 +5797,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is finite, else false.
**/
isFinite(value: any): boolean;
isFinite(value?: any): boolean;
}
//_.isFunction
@@ -5822,7 +5807,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a function, else false.
**/
isFunction(value: any): boolean;
isFunction(value?: any): boolean;
}
//_.isNaN
@@ -5835,7 +5820,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is NaN, else false.
**/
isNaN(value: any): boolean;
isNaN(value?: any): boolean;
}
//_.isNull
@@ -5845,7 +5830,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is null, else false.
**/
isNull(value: any): boolean;
isNull(value?: any): boolean;
}
//_.isNumber
@@ -5857,7 +5842,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a number, else false.
**/
isNumber(value: any): boolean;
isNumber(value?: any): boolean;
}
//_.isObject
@@ -5868,7 +5853,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is an object, else false.
**/
isObject(value: any): boolean;
isObject(value?: any): boolean;
}
//_.isPlainObject
@@ -5878,7 +5863,7 @@ declare module _ {
* @param value The value to check.
* @return True if value is a plain object, else false.
**/
isPlainObject(value: any): boolean;
isPlainObject(value?: any): boolean;
}
//_.isRegExp
@@ -5888,7 +5873,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a regular expression, else false.
**/
isRegExp(value: any): boolean;
isRegExp(value?: any): boolean;
}
//_.isString
@@ -5898,7 +5883,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is a string, else false.
**/
isString(value: any): boolean;
isString(value?: any): boolean;
}
//_.isUndefined
@@ -5908,7 +5893,7 @@ declare module _ {
* @param value The value to check.
* @return True if the value is undefined, else false.
**/
isUndefined(value: any): boolean;
isUndefined(value?: any): boolean;
}
//_.keys
@@ -5918,7 +5903,7 @@ declare module _ {
* @param object The object to inspect.
* @return An array of property names.
**/
keys(object: any): string[];
keys(object?: any): string[];
}
interface LoDashObjectWrapper<T> {
@@ -6068,7 +6053,7 @@ declare module _ {
* @param object The object to inspect.
* @return Aew array of key-value pairs.
**/
pairs(object: any): any[][];
pairs(object?: any): any[][];
}
interface LoDashObjectWrapper<T> {
@@ -6180,7 +6165,7 @@ declare module _ {
* @param object The object to inspect.
* @return Returns an array of property values.
**/
values(object: any): any[];
values(object?: any): any[];
}
/**********
@@ -6206,10 +6191,8 @@ declare module _ {
trimLeft(str?: string, chars?: string): string;
trimRight(str?: string, chars?: string): string;
trunc(str?: string, len?: number): string;
trunc(str?: string, options?: { length?: number; omission?: string; separator?: string }): string;
trunc(str?: string, options?: { length?: number; omission?: string; separator?: RegExp }): string;
words(str?: string, pattern?: string): string[];
words(str?: string, pattern?: RegExp): string[];
trunc(str?: string, options?: { length?: number; omission?: string; separator?: string|RegExp }): string;
words(str?: string, pattern?: string|RegExp): string[];
}
//_.parseInt
@@ -6224,7 +6207,7 @@ declare module _ {
* @param radix The radix used to interpret the value to parse.
* @return The new integer value.
**/
parseInt(value: string, radix?: number): number;
parseInt(value?: string, radix?: number): number;
}
/*************
@@ -6237,7 +6220,7 @@ declare module _ {
* @param string The string to escape.
* @return The escaped string.
**/
escape(str: string): string;
escape(str?: string): string;
}
//_.identity
@@ -6247,7 +6230,7 @@ declare module _ {
* @param value Any value.
* @return value.
**/
identity<T>(value: T): T;
identity<T>(value?: T): T;
}
//_.mixin
@@ -6256,7 +6239,7 @@ declare module _ {
* Adds function properties of a source object to the lodash function and chainable wrapper.
* @param object The object of function properties to add to lodash.
**/
mixin(object: Dictionary<(value: any) => any>): void;
mixin(object?: Dictionary<(value: any) => any>): void;
}
//_.noConflict