Can we create a mapping of private members of TS/J...
# javascript
r
Can we create a mapping of private members of TS/JS file in kotlin adaper file ?
b
No, as those get obfuscated by the ts compiler. You should only refer to .d.ts files when writing external declarations.
r
b
It's build output. Have a look at rootDir/build/js/node_modules/@material
r
ok, I have not build the library yet. I was hoping to do it directly from TS file available on Github
b
You don't need to
The path above refers to your gradle consumer project
That's where npm dependencies are downloaded
r
Did not get it
I am not able to see
.d.ts
file and you are saying I don't need to build it , but it's build output 😶
Ok so Runkit + npm runs the build and stores the
.d.ts
file ?
b
Yes and no. MDC repo you're browsing on github, it the library source. It is NOT what's getting published to npmjs.org (where you're pulling them in from in gradle). npmjs.org receives prebuilt version of mdc library, which contains .d.ts files (mdc build output). Now when gradle pulls it in, it pulls it from npm, NOT github. Therefore, after running
./gradlew kotlinNpmInstall
(which is a dependency of any kotlin.js task), you'll have the built version of MDC library downloaded and stored in
${projectRootDit}/build/js/node_modules/@material
Have a look there and you'll find the d.ts files
Runkit simply opens a browser sandbox based on the published version of the package (i.e. is oblivious that github source repository even exists)
r
Ok understood that explains well
👍 1