package lua; /** This library provides generic functions for table manipulation. **/ // TODO: use an abstract here? @:native("_G.table") extern class Table implements ArrayAccess implements Dynamic { @:analyzer(no_fusion) public inline static function create(?arr:Array, ?hsh:Dynamic) : Table { return untyped __lua_table__(arr,hsh); } @:overload(function(table:Table):Void{}) public static function concat(table:Table, ?sep:String) : String; public static function foreach(table:Table, f:A->B->Void) : Void; public static function foreachi(table:Table, f:A->B->Int->Void) : Void; public static function sort(table:Table, ?order : A->A->Bool) : Void; @:overload(function(table:Table, value:B):Void{}) public static function insert(table:Table, pos:Int, value:B) : Void; @:overload(function(table:Table):Void{}) public static function remove(table:Table, ?pos:Int) : Void; #if (lua_ver >= 5.2) public static function pack(args:haxe.extern.Rest) : Table; public static function unpack(args:lua.Table, ?min : Int, ?max : Int) : Dynamic; #end } typedef AnyTable = Table;