Skip to content

Commit

Permalink
Fix typing of Y.Map iterators
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Haines <andrew@haines.org.nz>
  • Loading branch information
haines committed Oct 25, 2023
1 parent 9a7b659 commit 25bef23
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/types/YMap.js
Expand Up @@ -41,7 +41,7 @@ export class YMapEvent extends YEvent {
* A shared Map implementation.
*
* @extends AbstractType<YMapEvent<MapType>>
* @implements {Iterable<MapType>}
* @implements {Iterable<[string, MapType]>}
*/
export class YMap extends AbstractType {
/**
Expand Down Expand Up @@ -152,7 +152,7 @@ export class YMap extends AbstractType {
/**
* Returns the values for each element in the YMap Type.
*
* @return {IterableIterator<any>}
* @return {IterableIterator<MapType>}
*/
values () {
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])
Expand All @@ -161,10 +161,10 @@ export class YMap extends AbstractType {
/**
* Returns an Iterator of [key, value] pairs
*
* @return {IterableIterator<any>}
* @return {IterableIterator<[string, MapType]>}
*/
entries () {
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => [v[0], v[1].content.getContent()[v[1].length - 1]])
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => /** @type {any} */ ([v[0], v[1].content.getContent()[v[1].length - 1]]))
}

/**
Expand All @@ -183,7 +183,7 @@ export class YMap extends AbstractType {
/**
* Returns an Iterator of [key, value] pairs
*
* @return {IterableIterator<any>}
* @return {IterableIterator<[string, MapType]>}
*/
[Symbol.iterator] () {
return this.entries()
Expand Down

0 comments on commit 25bef23

Please sign in to comment.