-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'clear' and 'size' methods to the Map type in 'svelte/reactivity'. #10819
Comments
I think what's happening here is a bug in That should be fine, but it fails because class ReactiveMap<K, V> extends Map<K, v> {...}
export { ReactiveMap as Map } ...but it instead produces this: export class Map<K, V> extends Map<any, any> {...} |
Will adding a namespace to the build-ins work? e.g. export class Map<K, V> extends globalThis.Map<K, V> {...} Or will it get omitted too? |
I tried that — TypeScript reduces |
Describe the bug
Thank you for adding the types from #10817 . Can you please add the 'clear' and 'size' members to the reactive map type? I assume they are already implemented as my app still works fine. VS Code is showing errors.
Similar to the referenced issue, I tried to use declaration merging to add the names. It doesn't seem to affect anything, even after clearing .svelte-kit.
Reproduction
import {Map} from 'svelte/reactivity';
const myMap = new Map<string, string>();
myMap.set("foo", "bar");
myMap.clear(); // Name not found
myMap.size // Name not found
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: