TypeScript 5.5 compatibility for `ObservableSet`
Intended outcome:
MobX's ObservableSet should implement all Set methods.
https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#support-for-new-ecmascript-set-methods
Actual outcome:
It doesn't, leading to
node_modules/mobx/dist/types/observableset.d.ts:25:22 - error TS2420: Class 'ObservableSet<T>' incorrectly implements interface 'Set<T>'.
Type 'ObservableSet<T>' is missing the following properties from type 'Set<T>': union, intersection, difference, symmetricDifference, and 3 more.
25 export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {
How to reproduce the issue:
https://www.typescriptlang.org/play/?target=99&ts=5.5.2#code/JYWwDg9gTgLgBAbzgeQEYGcCmUBuBDVAG0wGVN4BfOAMyghDgHIQJUAPRgbgChuBjCADt08FuzIwAXHAkAeAK6CA1oIgB3QQD44AXjiDMalBmz4ipcgAoAlDyA
Changing TS versions to 5.4.5 resolves the type error.
Playground doesn't have skipLibCheck: false, otherwise the implements within the MobX type would fail rather than the satisfies.
Versions
Should be fixed by https://github.com/mobxjs/mobx/pull/3853
Duplicate of #3850