Add typings for the ES6 Iterator interface for compatibility with rxjs.

This commit is contained in:
Hristo Deshev
2016-03-01 11:50:27 +02:00
parent 3ce5df039b
commit a4ab5894c2

12
es-collections.d.ts vendored
View File

@@ -47,3 +47,15 @@ declare var Set: {
new<T>(l: List<T>): Set<T>; new<T>(l: List<T>): Set<T>;
prototype: Set<any>; prototype: Set<any>;
} }
//Compatibility interfaces for rxjs
interface IteratorResult<T> {
done: boolean;
value?: T;
}
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
return?(value?: any): IteratorResult<T>;
throw?(e?: any): IteratorResult<T>;
}