dart-archive / js_facade_gen

Generates package:js Javascript interop facades for arbitrary TypeScript libraries
Apache License 2.0
161 stars 29 forks source link

Promise<unknown> and other things #81

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi I have a .d.ts file containing Promise<unknown> and it fails but when I change the code to Promise<any> it's ok

I'm trying to understand why so I found that unknown was introduced in typescript 3. So my question is, is js_facade_gen compatible only with ts 2 or I else I need to change a config somewhere?

ghost commented 4 years ago
re-exports must have a module URL (export x from "./y")

is a common occurence

ghost commented 4 years ago
export {};
ghost commented 4 years ago
object
ghost commented 4 years ago
export default
ghost commented 4 years ago

Promise fails

ghost commented 4 years ago

are enum like this parsed correctly:

export enum Direction {
    Inbound = "inbound",
    Outbound = "outbound"
}

export declare enum VertoMethod {
    Invite = "verto.invite",
    Attach = "verto.attach",
    Answer = "verto.answer",
    Info = "verto.info",
    Display = "verto.display",
    Media = "verto.media",
    Event = "verto.event",
    Bye = "verto.bye",
    Punt = "verto.punt",
    Broadcast = "verto.broadcast",
    Subscribe = "verto.subscribe",
    Unsubscribe = "verto.unsubscribe",
    ClientReady = "verto.clientReady",
    Modify = "verto.modify"
}

export declare enum State {
    New = 0,
    Requesting = 1,
    Trying = 2,
    Recovering = 3,
    Ringing = 4,
    Answering = 5,
    Early = 6,
    Active = 7,
    Held = 8,
    Hangup = 9,
    Destroy = 10,
    Purge = 11
}
ghost commented 4 years ago
@JS()
library a.b.c.d;

gives notice Name libraries using 'lowercase_with_underscores'