Skip to content

Commit 2380486

Browse files
committed
CODEREVIEW Remove Date declaration from Wasm, use kotlin js Date declaration
1 parent 55b3998 commit 2380486

5 files changed

+32
-58
lines changed
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@file:JsModule("@js-joda/core")
2+
@file:kotlinx.datetime.JsNonModule
3+
@file:Suppress("NO_EXPLICIT_VISIBILITY_IN_API_MODE", "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", "PARAMETER_NAME_CHANGED_ON_OVERRIDE")
4+
package kotlinx.datetime.internal.JSJoda
5+
6+
import kotlinx.datetime.InteropInterface
7+
import kotlin.js.*
8+
9+
external fun nativeJs(date: Date, zone: ZoneId = definedExternally): TemporalAccessor
10+
11+
external fun nativeJs(date: Date): TemporalAccessor
12+
13+
external fun nativeJs(date: InteropInterface, zone: ZoneId = definedExternally): TemporalAccessor
14+
15+
external fun nativeJs(date: InteropInterface): TemporalAccessor
16+
17+
external interface `T$0` : InteropInterface {
18+
var toDate: () -> Date
19+
var toEpochMilli: () -> Double
20+
}
21+
22+
external fun convert(temporal: LocalDate, zone: ZoneId = definedExternally): `T$0`
23+
24+
external fun convert(temporal: LocalDate): `T$0`
25+
26+
external fun convert(temporal: LocalDateTime, zone: ZoneId = definedExternally): `T$0`
27+
28+
external fun convert(temporal: LocalDateTime): `T$0`
29+
30+
external fun convert(temporal: ZonedDateTime, zone: ZoneId = definedExternally): `T$0`
31+
32+
external fun convert(temporal: ZonedDateTime): `T$0`

core/jsAndWasmShared/test/JsConverterTest.kt renamed to core/js/test/JsConverterTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package kotlinx.datetime.test
88
import kotlinx.datetime.*
99
import kotlin.js.*
1010
import kotlin.test.*
11-
import kotlinx.datetime.Date
1211

1312
class JsConverterTest {
1413
@Test

core/jsAndWasmShared/src/Date.kt

-32
This file was deleted.

core/jsAndWasmShared/src/kotlinx.datetime.internal.JSJoda.module_@js-joda_core.kt

-25
Original file line numberDiff line numberDiff line change
@@ -1243,29 +1243,4 @@ external open class ChronoZonedDateTime : Temporal {
12431243

12441244
external interface Locale : InteropInterface
12451245

1246-
external fun nativeJs(date: kotlinx.datetime.Date, zone: ZoneId = definedExternally): TemporalAccessor
1247-
1248-
external fun nativeJs(date: kotlinx.datetime.Date): TemporalAccessor
1249-
1250-
external fun nativeJs(date: InteropInterface, zone: ZoneId = definedExternally): TemporalAccessor
1251-
1252-
external fun nativeJs(date: InteropInterface): TemporalAccessor
1253-
1254-
external interface `T$0` : InteropInterface {
1255-
var toDate: () -> kotlinx.datetime.Date
1256-
var toEpochMilli: () -> Double
1257-
}
1258-
1259-
external fun convert(temporal: LocalDate, zone: ZoneId = definedExternally): `T$0`
1260-
1261-
external fun convert(temporal: LocalDate): `T$0`
1262-
1263-
external fun convert(temporal: LocalDateTime, zone: ZoneId = definedExternally): `T$0`
1264-
1265-
external fun convert(temporal: LocalDateTime): `T$0`
1266-
1267-
external fun convert(temporal: ZonedDateTime, zone: ZoneId = definedExternally): `T$0`
1268-
1269-
external fun convert(temporal: ZonedDateTime): `T$0`
1270-
12711246
external fun use(plugin: () -> InteropInterface): InteropInterface

0 commit comments

Comments
 (0)