Browse Source

[js] partial extern for ES6 Map (no iterators yet)

Dan Korostelev 7 years ago
parent
commit
2fa40a254a
1 changed files with 13 additions and 0 deletions
  1. 13 0
      std/js/Map.hx

+ 13 - 0
std/js/Map.hx

@@ -0,0 +1,13 @@
+package js;
+
+@:native("Map")
+extern class Map<K,V> {
+	var size(default,null):Int;
+	function new();
+	function has(key:K):Bool;
+	function get(key:K):Null<V>;
+	function set(key:K, value:V):Map<K,V>;
+	function delete(key:K):Bool;
+	function clear():Void;
+	function forEach(callback:(value:V, key:K, map:Map<K,V>)->Void, ?thisArg:Any):Void;
+}