# javascript


10/20/2023, 8:08 AM
Hello. I've question about wrapping up node dependency: I've 4 expect members in commonMain:
Copy code
expect class CapturedImage
expect class CapturedFace
expect fun CapturedFace.extractEyePosition(): Eyes
expect fun CapturedImage.toBase64String(): String
TF lite for js dependency:
Copy code
val jsMain by getting {
    dependencies {
        implementation(npm("mediapipe/face_detection", "0.4.0"))
        implementation(npm("tensorflow/tfjs-backend-webgl", "4.4.0"))
        implementation(npm("tensorflow/tfjs-converter", "4.4.0"))
        implementation(npm("tensorflow/tfjs-core", "4.4.0"))
Now, i would like to have actual in jsMain but i have no idea how to do it for js: For example for ios i have:
Copy code
actual typealias CapturedFace = MLKFace

actual fun CapturedFace.extractEyePosition(): Eyes {
    val le = this.landmarkOfType(MLKFaceLandmarkTypeLeftEye)?.position!!
    val re = this.landmarkOfType(MLKFaceContourTypeRightEye)?.position!!
    return Eyes(
        Eye(re.x.toFloat(), re.y.toFloat()),
        Eye(le.x.toFloat(), le.y.toFloat())
But for js i don't see import for Face or anything that is related to those npm libraries

Edoardo Luppi

10/20/2023, 12:20 PM
External libraries must be declared with Kotlin code. Much like TypeScript type declarations.
❤️ 1