The d.ts
file at dt~whatwg-fetch includes the following declaration.
declare class Headers {
// other code ommited
[Symbol.iterator](): IterableIterator<[string, string]>;
}
We've tried to create a workaround interface without success. None of the following work. What will?
interface Symbol {}
interface Symbol<T> {}
interface Symbol {
iterator: IterableIterator<[string, string]>
}
interface Symbol<T> {
iterator: IterableIterator<[string, string]>
}
Edit
We've seen Typescript Cannot find name 'IterableIterator' and the recommendation is to target es6. Is that required?
http://www.typescriptlang.org/docs/handbook/iterators-and-generators.html
Symbol
is new to ES6
and because of that you'll need to target your compiler to that.
To do that specify that the target in the compiler options is "es6"
.
The definition for Symbol
can be found in the lib.es6.d.ts (while it's missing in the default lib.d.ts)
You can just polyfill that part yourself, you just need to copy the needed parts from the lib.es6.d.ts
file and put it in your own file and reference it.
I copied what needed for the code you posted and it's in this playground.
It might have more than actually needed, so play around with that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With