Skip to content

Commit

Permalink
Use jso from kotlin-wrappers library (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Aug 7, 2024
1 parent 6490a4d commit 50157a4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-t
tuulbox-collections = { module = "com.juul.tuulbox:collections", version.ref = "tuulbox" }
tuulbox-coroutines = { module = "com.juul.tuulbox:coroutines", version.ref = "tuulbox" }
uuid = { module = "com.benasher44:uuid", version = "0.8.4" }
wrappers-bom = { module = "org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom", version = "1.0.0-pre.781" }
wrappers-web = { module = "org.jetbrains.kotlin-wrappers:kotlin-web" }

[plugins]
android-library = { id = "com.android.library", version = "8.5.1" }
Expand Down
5 changes: 5 additions & 0 deletions kable-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ kotlin {

implementation(libs.tuulbox.coroutines)
}

jsMain.dependencies {
api(libs.wrappers.web)
api(project.dependencies.platform(libs.wrappers.bom))
}
}
}

Expand Down
1 change: 1 addition & 0 deletions kable-core/src/jsMain/kotlin/Bluetooth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.juul.kable.external.BluetoothAvailabilityChanged
import com.juul.kable.external.BluetoothLEScanFilterInit
import com.juul.kable.external.BluetoothServiceUUID
import com.juul.kable.external.RequestDeviceOptions
import js.objects.jso
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.await
import kotlinx.coroutines.channels.awaitClose
Expand Down
1 change: 1 addition & 0 deletions kable-core/src/jsMain/kotlin/BluetoothLEScanOptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.benasher44.uuid.Uuid
import com.juul.kable.external.BluetoothLEScanFilterInit
import com.juul.kable.external.BluetoothLEScanOptions
import com.juul.kable.external.BluetoothManufacturerDataFilterInit
import js.objects.jso

/** Convert list of public API type to Web Bluetooth (JavaScript) type. */
internal fun List<FilterPredicate>.toBluetoothLEScanOptions(): BluetoothLEScanOptions = jso {
Expand Down
1 change: 1 addition & 0 deletions kable-core/src/jsMain/kotlin/FilterSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.juul.kable
import com.benasher44.uuid.Uuid
import com.juul.kable.external.BluetoothLEScanFilterInit
import com.juul.kable.external.BluetoothManufacturerDataFilterInit
import js.objects.jso

/**
* Filtering on Service Data is not supported because it is not implemented:
Expand Down
8 changes: 0 additions & 8 deletions kable-core/src/jsMain/kotlin/jso.kt

This file was deleted.

0 comments on commit 50157a4

Please sign in to comment.