Skip to content

Commit 2f6f74d

Browse files
Merge pull request #10243 from joshaber/iterable-readonlyarray
Make ReadonlyArray iterable.
2 parents ecc51af + 8975cd7 commit 2f6f74d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/lib/es2015.iterable.d.ts

+20
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ interface ArrayConstructor {
6363
from<T>(iterable: Iterable<T>): Array<T>;
6464
}
6565

66+
interface ReadonlyArray<T> {
67+
/** Iterator */
68+
[Symbol.iterator](): IterableIterator<T>;
69+
70+
/**
71+
* Returns an array of key, value pairs for every entry in the array
72+
*/
73+
entries(): IterableIterator<[number, T]>;
74+
75+
/**
76+
* Returns an list of keys in the array
77+
*/
78+
keys(): IterableIterator<number>;
79+
80+
/**
81+
* Returns an list of values in the array
82+
*/
83+
values(): IterableIterator<T>;
84+
}
85+
6686
interface IArguments {
6787
/** Iterator */
6888
[Symbol.iterator](): IterableIterator<any>;

0 commit comments

Comments
 (0)