fix type errors in y-map.tests
This commit is contained in:
parent
cd79765f3c
commit
4f49c581aa
@ -65,7 +65,7 @@ export class YMapEvent extends YEvent {
|
|||||||
* A shared Map implementation.
|
* A shared Map implementation.
|
||||||
*
|
*
|
||||||
* @extends AbstractType<YMapEvent<MapType>>
|
* @extends AbstractType<YMapEvent<MapType>>
|
||||||
* @implements {Iterable<[string, MapType]>}
|
* @implements {Iterable<[StringKey<MapType>, MapType[StringKey<MapType>]]>}
|
||||||
*/
|
*/
|
||||||
export class YMap extends AbstractType {
|
export class YMap extends AbstractType {
|
||||||
/**
|
/**
|
||||||
@ -176,7 +176,7 @@ export class YMap extends AbstractType {
|
|||||||
/**
|
/**
|
||||||
* Returns the values for each element in the YMap Type.
|
* Returns the values for each element in the YMap Type.
|
||||||
*
|
*
|
||||||
* @return {IterableIterator<MapType>}
|
* @return {IterableIterator<MapType[keyof MapType]>}
|
||||||
*/
|
*/
|
||||||
values () {
|
values () {
|
||||||
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])
|
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])
|
||||||
@ -185,7 +185,7 @@ export class YMap extends AbstractType {
|
|||||||
/**
|
/**
|
||||||
* Returns an Iterator of [key, value] pairs
|
* Returns an Iterator of [key, value] pairs
|
||||||
*
|
*
|
||||||
* @return {IterableIterator<[string, MapType]>}
|
* @return {IterableIterator<[StringKey<MapType>, MapType[StringKey<MapType>]]>}
|
||||||
*/
|
*/
|
||||||
entries () {
|
entries () {
|
||||||
return iterator.iteratorMap(createMapIterator(this._map), /** @param {any} v */ v => /** @type {any} */ ([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]]))
|
||||||
@ -207,7 +207,7 @@ export class YMap extends AbstractType {
|
|||||||
/**
|
/**
|
||||||
* Returns an Iterator of [key, value] pairs
|
* Returns an Iterator of [key, value] pairs
|
||||||
*
|
*
|
||||||
* @return {IterableIterator<[string, MapType]>}
|
* @return {IterableIterator<[StringKey<MapType>, MapType[StringKey<MapType>]]>}
|
||||||
*/
|
*/
|
||||||
[Symbol.iterator] () {
|
[Symbol.iterator] () {
|
||||||
return this.entries()
|
return this.entries()
|
||||||
|
@ -14,7 +14,7 @@ import * as prng from 'lib0/prng'
|
|||||||
export const testIterators = _tc => {
|
export const testIterators = _tc => {
|
||||||
const ydoc = new Y.Doc()
|
const ydoc = new Y.Doc()
|
||||||
/**
|
/**
|
||||||
* @type {Y.Map<number>}
|
* @type {Y.Map<Record<string, number>>}
|
||||||
*/
|
*/
|
||||||
const ymap = ydoc.getMap()
|
const ymap = ydoc.getMap()
|
||||||
// we are only checking if the type assumptions are correct
|
// we are only checking if the type assumptions are correct
|
||||||
|
Loading…
x
Reference in New Issue
Block a user