Skip to content

Conversation

@farfromrefug
Copy link
Contributor

@farfromrefug farfromrefug commented Oct 25, 2025

This PR add many things which improve typings generation:

  • improved PR Updates to tackle Kotlin compatibility issues (#84) #85, fixing bugs and adding more edge cases
  • handle kotlin parameters without return paramter names with forbidden chars
  • ensure replaceGenericsInText does not remove > chars far already any types
  • better detection of open/close namespace to prevent unclosed namespaces
  • some inner namespaces where not correctly filled/exported
  • kotlin Companion is now a namespace making static functions being reported correctly
  • add eslint rules at the top to prevent vscode errors
  • constant values real value is now exported as jsdoc. Using direct values was failing in some cases and vscode was reporting errors
  • a new flag -per-library which will generate separated files for libraries. Also the name contains the library name/version which makes it easier to maintain typings

Some commits are listed here while already merged

farfromrefug and others added 25 commits March 3, 2022 21:05
# Conflicts:
#	dts-generator/gradle/wrapper/gradle-wrapper.properties
#	dts-generator/src/main/java/com/telerik/dts/DtsApi.java
# Conflicts:
#	dts-generator/src/main/java/com/telerik/dts/DtsApi.java
# Conflicts:
#	dts-generator/src/main/java/com/telerik/dts/DtsApi.java
* handle kotlin parameters without return paramter names with forbidden chars
* ensure replaceGenericsInText does not remove > chars far already any types
* better detection of open/close namespace to prevent unclosed namespaces
* some inner namespaces where not correctly filled/exported
@dangrima90
Copy link

dangrima90 commented Oct 26, 2025

@farfromrefug I tested the PR and from my end it's looking good. It seems that you encountered more edge cases than me!

Some points from my end:

  • The constant values fix you did was something I did notice and from my tests but in my case it looked like when placing the .d.ts file in a nativescript project those VS Code warnings went away. Still I think your solution makes more sense as TS was complaining about the constant values.
  • I did see the change from module to namespace and did a bit of research just to make sure it won't affect anything. From what I checked the typings generated here should export namespace and not module as these typings are not imported (therefore they aren't a module).

@dangrima90
Copy link

dangrima90 commented Nov 12, 2025

Hi @farfromrefug, I was testing again today and something I'd like to highlight is that names are a bit more cryptic now, not sure if it's the intended behaviour or not:

image image

What you see in red is what was generated with the changes I had pushed, green the changes with this branch. If it's intended behaviour I guess not a problem. Just highlighting it just in case.

One more inconsistency, double namespace.. which I'm still checking whether it's a generation issue or not:
image
image

@farfromrefug
Copy link
Contributor Author

@dangrima90 seems like there is a bug there. What lib are you testing with? i need to reproduce

@dangrima90
Copy link

dangrima90 commented Nov 12, 2025

@farfromrefug this is the SDKs I'm testing https://github.com/orgs/Mitek-Systems/packages?repo_name=MiSnap-Android. I think you can download the packages from the link I sent. Else you might need to set up a PAT to download the AAR files: https://github.com/Mitek-Systems/MiSnap-Android?tab=readme-ov-file#how-to-integrate-the-misnap-sdk-using-maven.

For example, the screenshot above showing DocumentSession is via com.miteksystems.misnap.workflow.

@farfromrefug
Copy link
Contributor Author

@dangrima90 i dont have credentials for that file. can you share the aar directly by mail ( dev at akylas dot fr)

@dangrima90
Copy link

@farfromrefug unfortunately I'm being blocked from attaching the aar file as an attachment. Just in case you can download the aar file from here: https://github.com/Mitek-Systems/MiSnap-Android/packages/1577915.

Screen.Recording.2025-11-13.at.08.39.50.mov

Does this help, or you're still not able to access it?

@farfromrefug
Copy link
Contributor Author

@dangrima90 i downloaded it thanks. But i dont see broken part of MiSnapDocumentClassifier. Is that another aar?

@dangrima90
Copy link

dangrima90 commented Nov 13, 2025

Hi again @farfromrefug, sorry I might have passed a wrong version. Somehow the latest version is listed as 5.6.1 which is an older version than I was testing with. Do you mind trying the core SDK please?

This is the same version I'm testing with 5.8.1: https://github.com/Mitek-Systems/MiSnap-Android/packages/1577896?version=5.8.1.

Here's an example of the changes (same as before, red = my branch, green = your updates 🙂):
image

For reference I've attached the typings file for the core SDK I had generated so that you can compare: misnap-core.d.ts.

Sorry for all the back and forth, if you need me to send more samples let me know, it's not a problem.

@farfromrefug
Copy link
Contributor Author

@dangrima90 both should be fixed now

@dangrima90
Copy link

@farfromrefug thanks, will try to find time to test today

@farfromrefug
Copy link
Contributor Author

i added a new flag -per-library which will generate separated files for libraries. Also the name contains the library name/version which makes it easier to maintain typings

@dangrima90
Copy link

dangrima90 commented Nov 24, 2025

Hey @farfromrefug sorry once again for the delay, been busy with other things lately. I will try to review things again and let you know of any anomalies I find. I like the sound of the new flag you added! Will give it a test drive too :)

I'll try to run a few tests tomorrow.

@dangrima90
Copy link

dangrima90 commented Nov 26, 2025

Hello @farfromrefug I got the time to test this morning. Things are looking better now thanks. I do still see some very minor issues with naming:

image

This is me again comparing what I had before vs the output of this branch. Testing using aar: https://github.com/Mitek-Systems/MiSnap-Android/packages/1577894?version=5.9.0.

I don't think the above is a major issue, just maybe keeping the names intact would be helpful.

In certain places I notice that whilst before kotlin dependencies were typed as kotlinx.x.y.z I now see anyx.x.y.z. For example:

image

This can be observed via: https://github.com/Mitek-Systems/MiSnap-Android/packages/1577896?version=5.9.0.

Again I don't know what impact this has, I don't think it affects anything in reality. I leave it to your good judgement whether this requires changes.

Other than that I think all is okay. Sorry for listing more items, just sharing what I'm noticing.

@farfromrefug
Copy link
Contributor Author

@dangrima90 awesome will try to fix remaining issues. but i can already say that the -per-library is pretty awesome.
next step will be to allow the cli to generate all typings used like ios.

@dangrima90
Copy link

Sounds good! Happy to help out with testing if you need any help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants