Merge pull request #1676 from NativeScript/hdeshev/iterator-definition

Add typings for the ES6 Iterator interface for compatibility with rxjs.
This commit is contained in:
Hristo Deshev
2016-03-01 17:27:06 +02:00

12
es-collections.d.ts vendored
View File

@ -47,3 +47,15 @@ declare var Set: {
new<T>(l: List<T>): Set<T>;
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>;
}