Skip to content

Commit

Permalink
feat(@tsplus/stdlib): Extend Iterable in Array/Set/Map to make it a C…
Browse files Browse the repository at this point in the history
…ollection
  • Loading branch information
mikearnaldi committed Jun 3, 2022
1 parent bd03beb commit 03ffc91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-spoons-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tsplus/stdlib": patch
---

Extend Iterable in Array / Set / Map
5 changes: 5 additions & 0 deletions packages/stdlib/_src/collections/Collection/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ declare global {
* @tsplus type Collection
*/
export interface Iterable<T> {}

export interface Map<K, V> extends Iterable<[K, V]> {}
export interface Set<T> extends Iterable<T> {}
export interface Array<T> extends Iterable<T> {}
export interface ReadonlyArray<T> extends Iterable<T> {}
}

export type Collection<A> = ESIterable<A>
Expand Down

0 comments on commit 03ffc91

Please sign in to comment.