haxiomic / dts2hx

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

Fontkit default #83

Open haxiomic opened 3 years ago

haxiomic commented 3 years ago

Generates:

import fontkit.*;

@:jsRequire("fontkit") @valueModuleOnly extern class Fontkit {
    @:native("default")
    static final default_ : fontkit.Fontkit;
}

But .default does not resolve to the class, instead it should be

import fontkit.*;

@:jsRequire("fontkit") @valueModuleOnly extern class Fontkit {
    /**
        Opens a font file asynchronously, and calls the callback with a font object.
        For collection fonts (such as TrueType collection files),
        you can pass a postscriptName to get that font out of the collection instead of a collection object.
    **/
    static function open(filename:String, postscriptName:String, callback:(err:Null<js.lib.Error>, font:Font) -> Void):Void;
    /**
        Opens a font file synchronously, and returns a font object.
        For collection fonts (such as TrueType collection files),
        you can pass a postscriptName to get that font out of the collection instead of a collection object.
    **/
    static function openSync(filename:String, ?postscriptName:String):Font;
    /**
        Returns a font object for the given buffer.
        For collection fonts (such as TrueType collection files),
        you can pass a postscriptName to get that font out of the collection instead of a collection object.
    **/
    static function create(buffer:global.Buffer, ?postscriptName:String):Font;
}
haxiomic commented 3 years ago

Same issue with lottie-web