NativeScript / android-dts-generator

A tool that generates TypeScript declaration files (.d.ts) from Jars
90 stars 23 forks source link

Updating definitions to arbitrary android sdk version #21

Open b12f opened 7 years ago

b12f commented 7 years ago

I'm trying to update my tns-platform-declarations to use the latest android sdk.

I've generated the definitions for the respective sdks and replaced the include in tns-platform-declarations/android/android.d.ts to use the generated file (currently android23.d.ts).

Problem is I now get - among others, including a lot of duplicate identifiers - a million error TS2503: Cannot find namespace 'native'., which tells me not everything has been extracted. Where do I go from here? The sdk declaration files have wildly differing sizes:

-rw-rw-r-- 1 yule yule 13777754 Apr 25 13:17 android17.d.ts # Original file
-rw-rw-r-- 1 yule yule  4686196 Apr 25 14:20 android20.d.ts
-rw-rw-r-- 1 yule yule  5191200 Apr 25 14:20 android21.d.ts
-rw-rw-r-- 1 yule yule  5214515 Apr 25 14:20 android22.d.ts
-rw-rw-r-- 1 yule yule  5006948 Apr 25 14:20 android23.d.ts
-rw-rw-r-- 1 yule yule 17178798 Apr 25 14:19 android24.d.ts
-rw-rw-r-- 1 yule yule  5730638 Apr 25 13:17 android25.d.ts

Which tells me I'm probably doing something wrong.

Do I have to include anything else?

b12f commented 7 years ago

I've looked into generate.win.bat and created an equivalent for Linux (you'll find some extra needed jars there), copied the android.d.ts from output/android-24 into the respective tns-platform-declarations folder, getting a lot less errors, now its mainly these two:

Namespace 'android' has no exported member 'content'.
Namespace 'android' has no exported member 'view'.

but org.nativescript.widgets.d.ts throws another bunch.

Edit: the extra jars aren't on my system. No error was thrown however.