Skip to content

Commit c106303

Browse files
committed
update typescript mx interface
1 parent 80bd7cf commit c106303

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

build/multiplex.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,9 +2569,9 @@ declare function mx(str: string): mx.Enumerable<string>
25692569

25702570
/**
25712571
* Defines an enumerator, which supports an iteration over the specified Generator function.
2572-
* @param func A Generator function.
2572+
* @param factory An Enumerator factory function.
25732573
*/
2574-
declare function mx<T>(func: () => (yielder: (value: T) => T) => any): mx.Enumerable<T>
2574+
declare function mx<T>(factory: () => mx.Enumerator<T>): mx.Enumerable<T>
25752575

25762576

25772577
/**

src/typescript/multiplex.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,9 +2569,9 @@ declare function mx(str: string): mx.Enumerable<string>
25692569

25702570
/**
25712571
* Defines an enumerator, which supports an iteration over the specified Generator function.
2572-
* @param func A Generator function.
2572+
* @param factory An Enumerator factory function.
25732573
*/
2574-
declare function mx<T>(func: () => (yielder: (value: T) => T) => any): mx.Enumerable<T>
2574+
declare function mx<T>(factory: () => mx.Enumerator<T>): mx.Enumerable<T>
25752575

25762576

25772577
/**

test/typescript/mx.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
QUnit.test("Multiplex Object", function (assert) {
44-
var _source = mx({ name: "mx", id: 1 });
44+
var _source = mx({ name: "mx", id: 1 });
4545
assert.ok(MxCount(_source) === 2, "Passed!");
4646
});
4747

@@ -53,7 +53,7 @@
5353

5454

5555
//QUnit.test("Multiplex Iterable", function (assert) {
56-
// var _set = new Set(),
56+
// var _set = new Set<number>(),
5757
// _source = mx(_set);
5858

5959
// _set.add(1);
@@ -64,7 +64,7 @@
6464

6565

6666
QUnit.test("Multiplex Custom Enumerator", function (assert) {
67-
var _source = mx({
67+
var _source = mx(<Enumerable<number>>{
6868
getEnumerator: function (): Enumerator<number> {
6969
var count = 3, index = 0;
7070
return {
@@ -100,7 +100,7 @@
100100
var count = 3,
101101
index = 0;
102102

103-
return new Enumerator(function (yielder) {
103+
return new Enumerator<number>(function (yielder) {
104104
if (index++ < count) {
105105
yielder(index);
106106
}

0 commit comments

Comments
 (0)