diff --git a/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/network/sockets/TimeoutExceptions.jsAndWasm.kt b/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/network/sockets/TimeoutExceptions.jsAndWasm.kt deleted file mode 100644 index 1fcf2ce0ce3..00000000000 --- a/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/network/sockets/TimeoutExceptions.jsAndWasm.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.client.network.sockets - -import kotlinx.io.IOException - -/** - * This exception is thrown in case connect timeout exceeded. - */ -public actual class ConnectTimeoutException actual constructor( - message: String, - cause: Throwable? -) : IOException(message, cause) - -public actual open class InterruptedIOException : IOException() - -/** - * This exception is thrown in case socket timeout (read or write) exceeded. - */ -public actual class SocketTimeoutException internal constructor( - override val message: String?, - override val cause: Throwable?, - unit: Unit -) : InterruptedIOException() - -public actual fun SocketTimeoutException(message: String, cause: Throwable?): SocketTimeoutException { - return SocketTimeoutException(message, cause, Unit) -} diff --git a/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/utils/ExceptionUtilsJs.kt b/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/utils/ExceptionUtilsJs.kt deleted file mode 100644 index 2f01ecee8ba..00000000000 --- a/ktor-client/ktor-client-core/jsAndWasmShared/src/io/ktor/client/utils/ExceptionUtilsJs.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. -*/ - -package io.ktor.client.utils - -import io.ktor.utils.io.* - -/** - * If the exception contains cause that differs from [CancellationException] returns it otherwise returns itself. - */ -public actual fun Throwable.unwrapCancellationException(): Throwable { - var exception: Throwable? = this - while (exception is CancellationException) { - // If there is a cycle, we return the initial exception. - if (exception == exception.cause) { - return this - } - exception = exception.cause - } - - return exception ?: this -} diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/ApplicationEnvironment.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/ApplicationEnvironment.jsAndWasmShared.kt deleted file mode 100644 index 15ec46cad12..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/ApplicationEnvironment.jsAndWasmShared.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.application - -import io.ktor.events.* -import io.ktor.server.config.* -import io.ktor.util.logging.* -import kotlin.coroutines.* - -public actual interface ApplicationEnvironment { - - /** - * Configuration for the [Application] - */ - public actual val config: ApplicationConfig - - /** - * Instance of [Logger] to be used for logging. - */ - public actual val log: Logger - - /** - * Provides events on Application lifecycle - */ - @Deprecated( - message = "Moved to Application", - replaceWith = ReplaceWith("EmbeddedServer.monitor", "io.ktor.server.engine.EmbeddedServer"), - level = DeprecationLevel.WARNING, - ) - public actual val monitor: Events -} - -internal actual class ApplicationRootConfigBridge actual constructor( - rootConfig: ServerConfig, - internal actual val parentCoroutineContext: CoroutineContext, -) diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/internal/TypeUtils.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/internal/TypeUtils.jsAndWasmShared.kt deleted file mode 100644 index 1324f006e75..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/application/internal/TypeUtils.jsAndWasmShared.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.application.internal - -import kotlin.reflect.* - -internal actual fun starProjectedTypeBridge(klass: KClass): KType = ErasedType(klass) - -internal data class ErasedType(private val klass: KClass<*>) : KType { - override val arguments: List - get() = emptyList() - - override val classifier: KClassifier - get() = klass - - override val isMarkedNullable: Boolean - get() = false -} diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/config/ConfigLoaders.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/config/ConfigLoaders.jsAndWasmShared.kt deleted file mode 100644 index f250d3e803f..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/config/ConfigLoaders.jsAndWasmShared.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.config - -import io.ktor.server.engine.* -import io.ktor.utils.io.* - -internal actual val CONFIG_PATH: List - get() = listOfNotNull( - getEnvironmentProperty("CONFIG_FILE") - ) - -/** - * List of all registered [ConfigLoader] implementations. - */ -public actual val configLoaders: List - get() = _configLoaders - -private val _configLoaders: MutableList = mutableListOf() - -public fun addConfigLoader(loader: ConfigLoader) { - _configLoaders.add(loader) -} diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/ApplicationEngineEnvironment.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/ApplicationEngineEnvironment.jsAndWasmShared.kt deleted file mode 100644 index e9f704e6b81..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/ApplicationEngineEnvironment.jsAndWasmShared.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.engine - -import io.ktor.events.* -import io.ktor.server.application.* -import io.ktor.server.config.* -import io.ktor.util.logging.* -import io.ktor.utils.io.* - -/** - * Engine environment configuration builder - */ -@KtorDsl -public actual class ApplicationEnvironmentBuilder { - - /** - * Application logger - */ - public actual var log: Logger = KtorSimpleLogger("io.ktor.server.Application") - - /** - * Application config - */ - public actual var config: ApplicationConfig = MapApplicationConfig() - - /** - * Build an application engine environment - */ - public actual fun build(): ApplicationEnvironment { - return ApplicationEnvironmentImplNix(log, config) - } -} - -public class ApplicationEnvironmentImplNix( - override val log: Logger, - override val config: ApplicationConfig, - @Deprecated( - "Moved to Application", - replaceWith = ReplaceWith("EmbeddedServer.monitor", "io.ktor.server.engine.EmbeddedServer"), - level = DeprecationLevel.WARNING - ) - override val monitor: Events = Events() -) : ApplicationEnvironment diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/EngineConnectorConfing.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/EngineConnectorConfing.jsAndWasmShared.kt deleted file mode 100644 index d02a3895c0f..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/EngineConnectorConfing.jsAndWasmShared.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.engine - -/** - * Returns new instance of [EngineConnectorConfig] based on [this] with modified port - */ -public actual fun EngineConnectorConfig.withPort( - otherPort: Int -): EngineConnectorConfig = object : EngineConnectorConfig by this { - override val port: Int = otherPort -} diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/internal/ExceptionUtils.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/internal/ExceptionUtils.jsAndWasmShared.kt deleted file mode 100644 index 2f4c4db2dd5..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/engine/internal/ExceptionUtils.jsAndWasmShared.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.engine.internal - -import kotlinx.io.IOException - -public actual open class ClosedChannelException(message: String) : IOException(message) - -internal actual open class OutOfMemoryError : Error() - -internal actual open class TimeoutException : Exception() diff --git a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/http/content/DefaultTransform.jsAndWasmShared.kt b/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/http/content/DefaultTransform.jsAndWasmShared.kt deleted file mode 100644 index 4274eeb391b..00000000000 --- a/ktor-server/ktor-server-core/jsAndWasmShared/src/io/ktor/server/http/content/DefaultTransform.jsAndWasmShared.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.server.http.content - -import io.ktor.http.content.* -import io.ktor.server.application.* - -internal actual fun platformTransformDefaultContent( - call: ApplicationCall, - value: Any -): OutgoingContent? = null