getType has a multireturn of unkown size

This commit is contained in:
Djeeberjr 2023-06-04 20:24:36 +02:00
parent 3862552b57
commit f98698cb4e

View File

@ -1,5 +1,6 @@
package cc;
import lua.TableTools;
import lua.Table;
import haxe.Constraints;
import haxe.extern.Rest;
@ -7,10 +8,16 @@ import haxe.extern.Rest;
@:native("peripheral")
extern class Peripheral {
public static function isPresent(name:String):Bool;
public static function getType(name:String):String;
public static function getMethods(name:String):Table<String, Function>;
public static function call<T>(name:String, method:String, args:Rest<Dynamic>):T;
public static function wrap<T>(name:String):T;
public static function find<T>(type:String, ?filter:(String, T) -> Bool):Table<Int, T>;
public static function getNames():Table<Int, String>;
@:native("getType") private static function _getType(name:String): Dynamic;
public static inline function getType(name:String): Table<Int,String>{
return cast TableTools.pack(_getType(name));
}
}