Skip to content

Instantly share code, notes, and snippets.

@tomi
Created March 22, 2019 08:42
Show Gist options
  • Save tomi/66d127f3a3797ead2dbbd7d4fe3ce696 to your computer and use it in GitHub Desktop.
Save tomi/66d127f3a3797ead2dbbd7d4fe3ce696 to your computer and use it in GitHub Desktop.
interface Iterable<T> {
[Symbol.iterator](): Iterator<T>;
}
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
return?(value?: any): IteratorResult<T>;
throw?(e?: any): IteratorResult<T>;
}
interface IteratorResult<T> {
done: boolean;
value: T;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment