Last active
September 22, 2023 08:07
-
-
Save ztrehagem/7f54b7b76439a9d2aac569518561f011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ReadonlyMapConstructor { | |
new <K, V>(entries?: IterableIterator<[K, V]> | null): ReadonlyMap<K, V>; | |
} | |
class ReadonlyMapClass<K, V> extends Map<K, V> {} | |
export const ReadonlyMap: ReadonlyMapConstructor = ReadonlyMapClass; | |
// | |
const readonlyMap = new ReadonlyMap<string, number>(); | |
readonlyMap.get("foo"); | |
readonlyMap.set("foo", 1); // type error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment