Skip to content

Commit 1e61509

Browse files
committed
update typescript Enumerable interface
1 parent 735fd1c commit 1e61509

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

build/multiplex.d.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ declare module mx {
145145

146146

147147
/**
148-
* Performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
148+
* Determines whether the specified object instances are considered equal. calls the overridden "equals" method when available.
149149
* @param objA The first object to compare.
150150
* @param objB The second object to compare.
151+
* @param comparer An equality comparer to compare values.
151152
*/
152-
function compare<T>(objA: T, objB: T): number;
153+
function equals(objA: any, objB: any, comparer: EqualityComparer<any>): boolean;
153154

154155

155156
/**
156-
* Determines whether the specified object instances are considered equal. calls the overridden "equals" method when available.
157+
* Performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
157158
* @param objA The first object to compare.
158159
* @param objB The second object to compare.
159-
* @param comparer An equality comparer to compare values.
160160
*/
161-
function equals(objA: any, objB: any, comparer: EqualityComparer<any>): boolean;
161+
function compare<T>(objA: T, objB: T): number;
162162

163163

164164
/**
@@ -295,20 +295,26 @@ declare module mx {
295295
* Defines an enumerator, which supports an iteration over the specified Generator function.
296296
* @param func A Generator function.
297297
*/
298-
new <T>(func: () => (yielder: (value: T) => any) => void): IEnumerable<T>;
298+
new <T>(func: () => (yielder: (value: T) => T) => any): IEnumerable<T>;
299299

300300
/**
301301
* Defines an enumerator, which supports an iteration over the items of the specified Array-like object.
302302
* An Array-like object is an object which has the "length" property, eg. arguments, jQuery
303303
* @param obj An Array-like object.
304304
*/
305-
new <T>(obj: { length: Number }): IEnumerable<T>;
305+
new <T>(obj: { length: Number;[index: number]: T }): IEnumerable<T>;
306+
307+
/**
308+
* Defines an enumerator, which supports an iteration over the arguments local variable available within all functions.
309+
* @param obj arguments local variable available within all functions.
310+
*/
311+
new (obj: IArguments): IEnumerable<any>;
306312

307313
/**
308314
* Defines an enumerator, which supports an iteration over the properties of the specified object.
309315
* @param obj A regular Object.
310316
*/
311-
new <T>(obj: Object): IEnumerable<KeyValuePair<string, T>>;
317+
new (obj: Object): IEnumerable<KeyValuePair<string, any>>;
312318

313319

314320

@@ -2578,7 +2584,7 @@ declare function mx<T>(func: () => (yielder: (value: T) => T) => any): IEnumerab
25782584
* An Array-like object is an object which has the "length" property, eg. arguments, jQuery
25792585
* @param obj An Array-like object.
25802586
*/
2581-
declare function mx<T>(obj: { length: Number; [index: number]: T }): IEnumerable<T>
2587+
declare function mx<T>(obj: { length: Number;[index: number]: T }): IEnumerable<T>
25822588

25832589

25842590
/**

src/typescript/multiplex.d.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ declare module mx {
145145

146146

147147
/**
148-
* Performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
148+
* Determines whether the specified object instances are considered equal. calls the overridden "equals" method when available.
149149
* @param objA The first object to compare.
150150
* @param objB The second object to compare.
151+
* @param comparer An equality comparer to compare values.
151152
*/
152-
function compare<T>(objA: T, objB: T): number;
153+
function equals(objA: any, objB: any, comparer: EqualityComparer<any>): boolean;
153154

154155

155156
/**
156-
* Determines whether the specified object instances are considered equal. calls the overridden "equals" method when available.
157+
* Performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
157158
* @param objA The first object to compare.
158159
* @param objB The second object to compare.
159-
* @param comparer An equality comparer to compare values.
160160
*/
161-
function equals(objA: any, objB: any, comparer: EqualityComparer<any>): boolean;
161+
function compare<T>(objA: T, objB: T): number;
162162

163163

164164
/**
@@ -295,20 +295,26 @@ declare module mx {
295295
* Defines an enumerator, which supports an iteration over the specified Generator function.
296296
* @param func A Generator function.
297297
*/
298-
new <T>(func: () => (yielder: (value: T) => any) => void): IEnumerable<T>;
298+
new <T>(func: () => (yielder: (value: T) => T) => any): IEnumerable<T>;
299299

300300
/**
301301
* Defines an enumerator, which supports an iteration over the items of the specified Array-like object.
302302
* An Array-like object is an object which has the "length" property, eg. arguments, jQuery
303303
* @param obj An Array-like object.
304304
*/
305-
new <T>(obj: { length: Number }): IEnumerable<T>;
305+
new <T>(obj: { length: Number;[index: number]: T }): IEnumerable<T>;
306+
307+
/**
308+
* Defines an enumerator, which supports an iteration over the arguments local variable available within all functions.
309+
* @param obj arguments local variable available within all functions.
310+
*/
311+
new (obj: IArguments): IEnumerable<any>;
306312

307313
/**
308314
* Defines an enumerator, which supports an iteration over the properties of the specified object.
309315
* @param obj A regular Object.
310316
*/
311-
new <T>(obj: Object): IEnumerable<KeyValuePair<string, T>>;
317+
new (obj: Object): IEnumerable<KeyValuePair<string, any>>;
312318

313319

314320

@@ -2578,7 +2584,7 @@ declare function mx<T>(func: () => (yielder: (value: T) => T) => any): IEnumerab
25782584
* An Array-like object is an object which has the "length" property, eg. arguments, jQuery
25792585
* @param obj An Array-like object.
25802586
*/
2581-
declare function mx<T>(obj: { length: Number; [index: number]: T }): IEnumerable<T>
2587+
declare function mx<T>(obj: { length: Number;[index: number]: T }): IEnumerable<T>
25822588

25832589

25842590
/**

0 commit comments

Comments
 (0)