diff --git a/src/cc/Peripheral.hx b/src/cc/Peripheral.hx index 53bd24e..31d6e19 100644 --- a/src/cc/Peripheral.hx +++ b/src/cc/Peripheral.hx @@ -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; public static function call(name:String, method:String, args:Rest):T; public static function wrap(name:String):T; public static function find(type:String, ?filter:(String, T) -> Bool):Table; public static function getNames():Table; + + @:native("getType") private static function _getType(name:String): Dynamic; + + public static inline function getType(name:String): Table{ + return cast TableTools.pack(_getType(name)); + } + }