You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The types introduced in #6 include a getter that is not supported in TypeScript versions 3.6 and earlier. This particular change in the compiler output was widely criticized at the time.
While these TypeScript versions are pretty old (~2 years) by now, they're still used by some projects. Our particular issue is with the Kendo UI Editor for Angular when running in Angular 8.x projects, but it may not be limited to it.
My suggestion is to replace it with a readonly field to remain compatible with older versions of TypeScript.
The only downside to that is that inheriting OrderedMap will require using a field for overriding size. I'm not sure if inheriting the class is a common scenario for the library. Edit: I've just noticed that the constructor is marked as private and extending the class is not supported.
diff --git a/types/index.d.ts b/types/index.d.ts
index 551e742..fdc372c 100644
--- a/types/index.d.ts+++ b/types/index.d.ts@@ -21,7 +21,7 @@ declare class OrderedMap<T = any> {
subtract(map: MapLike<T>): OrderedMap<T>
- get size(): number+ readonly size: number
static from<T>(map: MapLike<T>): OrderedMap<T>
}
The text was updated successfully, but these errors were encountered:
The types introduced in #6 include a getter that is not supported in TypeScript versions 3.6 and earlier. This particular change in the compiler output was widely criticized at the time.
While these TypeScript versions are pretty old (~2 years) by now, they're still used by some projects. Our particular issue is with the Kendo UI Editor for Angular when running in Angular 8.x projects, but it may not be limited to it.
My suggestion is to replace it with a
readonly
field to remain compatible with older versions of TypeScript.The only downside to that is that inheriting
OrderedMap
will require using a field for overridingsize
. I'm not sure if inheriting the class is a common scenario for the library. Edit: I've just noticed that the constructor is marked as private and extending the class is not supported.The text was updated successfully, but these errors were encountered: