Skip to content

Commit 5622c08

Browse files
committed
Fix interface definition of Generator object. It should extend IterableIterator<T>.
1 parent 2f6c65e commit 5622c08

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

lib/lib.es2015.generator.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ and limitations under the License.
1818
/// <reference no-default-lib="true"/>
1919

2020

21-
interface Generator extends Iterator<any> { }
21+
interface Generator<T> extends IterableIterator<T> { }
2222

23-
interface GeneratorFunction {
23+
interface GeneratorFunction<T> {
2424
/**
2525
* Creates a new Generator object.
2626
* @param args A list of arguments the function accepts.
2727
*/
28-
new (...args: any[]): Generator;
28+
new (...args: any[]): Generator<T>;
2929
/**
3030
* Creates a new Generator object.
3131
* @param args A list of arguments the function accepts.
3232
*/
33-
(...args: any[]): Generator;
33+
(...args: any[]): Generator<T>;
3434
/**
3535
* The length of the arguments.
3636
*/
@@ -42,20 +42,20 @@ interface GeneratorFunction {
4242
/**
4343
* A reference to the prototype.
4444
*/
45-
readonly prototype: Generator;
45+
readonly prototype: Generator<T>;
4646
}
4747

48-
interface GeneratorFunctionConstructor {
48+
interface GeneratorFunctionConstructor<T> {
4949
/**
5050
* Creates a new Generator function.
5151
* @param args A list of arguments the function accepts.
5252
*/
53-
new (...args: string[]): GeneratorFunction;
53+
new (...args: string[]): GeneratorFunction<T>;
5454
/**
5555
* Creates a new Generator function.
5656
* @param args A list of arguments the function accepts.
5757
*/
58-
(...args: string[]): GeneratorFunction;
58+
(...args: string[]): GeneratorFunction<T>;
5959
/**
6060
* The length of the arguments.
6161
*/
@@ -67,5 +67,5 @@ interface GeneratorFunctionConstructor {
6767
/**
6868
* A reference to the prototype.
6969
*/
70-
readonly prototype: GeneratorFunction;
70+
readonly prototype: GeneratorFunction<T>;
7171
}

src/lib/es2015.generator.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
interface Generator extends Iterator<any> { }
1+
interface Generator<T> extends IterableIterator<T> { }
22

3-
interface GeneratorFunction {
3+
interface GeneratorFunction<T> {
44
/**
55
* Creates a new Generator object.
66
* @param args A list of arguments the function accepts.
77
*/
8-
new (...args: any[]): Generator;
8+
new (...args: any[]): Generator<T>;
99
/**
1010
* Creates a new Generator object.
1111
* @param args A list of arguments the function accepts.
1212
*/
13-
(...args: any[]): Generator;
13+
(...args: any[]): Generator<T>;
1414
/**
1515
* The length of the arguments.
1616
*/
@@ -22,20 +22,20 @@ interface GeneratorFunction {
2222
/**
2323
* A reference to the prototype.
2424
*/
25-
readonly prototype: Generator;
25+
readonly prototype: Generator<T>;
2626
}
2727

28-
interface GeneratorFunctionConstructor {
28+
interface GeneratorFunctionConstructor<T> {
2929
/**
3030
* Creates a new Generator function.
3131
* @param args A list of arguments the function accepts.
3232
*/
33-
new (...args: string[]): GeneratorFunction;
33+
new (...args: string[]): GeneratorFunction<T>;
3434
/**
3535
* Creates a new Generator function.
3636
* @param args A list of arguments the function accepts.
3737
*/
38-
(...args: string[]): GeneratorFunction;
38+
(...args: string[]): GeneratorFunction<T>;
3939
/**
4040
* The length of the arguments.
4141
*/
@@ -47,5 +47,5 @@ interface GeneratorFunctionConstructor {
4747
/**
4848
* A reference to the prototype.
4949
*/
50-
readonly prototype: GeneratorFunction;
50+
readonly prototype: GeneratorFunction<T>;
5151
}

0 commit comments

Comments
 (0)