haxiomic / dts2hx

Converts TypeScript definition files (d.ts) to haxe externs (.hx) via the TypeScript compiler API
MIT License
135 stars 9 forks source link

type of Function error. #84

Open sonygod opened 3 years ago

sonygod commented 3 years ago

from cocoscreator .ts

{
requireComponent?: Function
}

convert to haxe


var requireComponent : haxe.Constraints.Function

when I convert from js

{

 requireComponent: dragonBones.ArmatureDisplay;
}

to haxe

{
 requireComponent =global.dragonbones.ArmatureDisplay;//Class<global.dragonbones.ArmatureDisplay> should be Null<haxe.Function>
}

Cc.hx


static function Class(?options:{ @:optional var name : String; @:optional @:native("extends") var extends_ : haxe.Constraints.Function; @:optional var ctor : haxe.Constraints.Function; @:optional var __ctor__ : haxe.Constraints.Function; @:optional var properties : Dynamic; @:optional var statics : Dynamic; @:optional var mixins : Array<haxe.Constraints.Function>; @:optional var editor : { @:optional var executeInEditMode : Bool; @:optional var requireComponent : haxe.Constraints.Function; @:optional var menu : String; @:optional var executionOrder : Float; @:optional var disallowMultiple : Bool; @:optional var playOnFocus : Bool; @:optional var inspector : String; @:optional var icon : String; @:optional var help : String; }; @:optional var update : haxe.Constraints.Function; @:optional var lateUpdate : haxe.Constraints.Function; @:optional var onLoad : haxe.Constraints.Function; @:optional var start : haxe.Constraints.Function; @:optional var onEnable : haxe.Constraints.Function; @:optional var onDisable : haxe.Constraints.Function; @:optional var onDestroy : haxe.Constraints.Function; @:optional var onFocusInEditor : haxe.Constraints.Function; @:optional var onLostFocusInEditor : haxe.Constraints.Function; @:optional var resetInEditor : haxe.Constraints.Function; @:optional var onRestore : haxe.Constraints.Function; @:optional var _getLocalBounds : haxe.Constraints.Function; }):haxe.Constraints.Function;
    /**