Closed karelbilek closed 7 years ago
Sequence is a WebIDL type that is mapped to Array in ECMAScript.
If I'm reading the WebIDL specification correctly then you can pass any iterable thing where a sequence is expected.
I am now writing a definition file for WebUSB for Flow typing system, so I want to know if I can write sequence<x>
as Array<x>
or if I have to write something like Iterable<x>
.
So far it seems like Array<x>
is fine.
It looks like someone has written a tool to automatically generate Flow definitions from WebIDL and they map sequence to Array:
Thanks for that! I was rewriting that by hand :)
I am trying to understand the draft and I don't understand the exact meaning of the word "sequence". For example
What does it mean? Does it have to be an Array?
This might be a wider Javascript thing that I don't get. I just cannot google anything on the web about this.