typescript2java icon indicating copy to clipboard operation
typescript2java copied to clipboard

TypeScript "toString(): string" is not generated in java classes

Open slavap opened this issue 7 years ago • 1 comments

I'm generating java classes for js-joda, and for some reason toString() methods are not converted to java classes. See https://github.com/js-joda/js-joda/blob/master/dist/js-joda.d.ts For example resulting DayOfWeek class has

public native DayOfWeek plus(@DoNotAutobox Number days);
// but does not have: public native String toString();
public native Number value();

though in TypeScript definition:

plus(days: number): DayOfWeek
toString(): string
value(): number 

slavap avatar Jan 09 '18 18:01 slavap

As far as I remember toString is skipped. That's one of the things to be added to the configuration file like : "do not skip toString for those classes" I will have a look, thanks

Le mar. 9 janv. 2018 à 19:44, Slava P. [email protected] a écrit :

I'm generating java classes for js-joda, and for some reason toString() methods are not converted to java classes. See https://github.com/js-joda/js-joda/blob/master/dist/js-joda.d.ts For example resulting DayOfWeek class has

public native DayOfWeek plus(@DoNotAutobox Number days);// but does not have: public native String toString();public native Number value();

though in TypeScript definition:

plus(days: number): DayOfWeektoString(): stringvalue(): number

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ltearno/typescript2java/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AALqXXehOPoYaryV-au4CMDc-KoHsFR-ks5tI7MbgaJpZM4RYRLr .

ltearno avatar Jan 09 '18 22:01 ltearno