Package-level declarations

Types

Link copied to clipboard
interface BufferedAsListChannel<T : Any> : SendChannel<T> , ReceiveChannel<List<T>>

A Rendezvous Channel that buffers all elements sent to it in a list until the next receive

Link copied to clipboard
typealias EmptyCompletableDeferred = CompletableDeferred<Unit>
Link copied to clipboard
actual interface Serializable

NOT SUPPORTED ON iOS

expect interface Serializable

Interface that indicates that the implementing object can be serialized using platform specific serialization.

actual interface Serializable

Not supported on JavaScript

Interface that indicates that the implementing object can be serialized using platform specific serialization.

actual interface Serializable

Not supported on Kotlin/Wasm.

Properties

Link copied to clipboard
val IntRange.nsRange: CValue<NSRange>
val IntRange.nsRange: CValue<NSRange>
Link copied to clipboard
val CValue<NSRange>.range: IntRange
val CValue<NSRange>.range: IntRange

Functions

Link copied to clipboard
inline fun <T> T.applyIf(condition: Boolean, block: T.() -> Unit): T

Applies a given code block if a given condition is met

Link copied to clipboard
fun <T : Any> BufferedAsListChannel(coroutineContext: CoroutineContext, dispatcher: CloseableCoroutineDispatcher, closeDispatcherOnCompletion: Boolean): BufferedAsListChannel<T>

Creates a BufferedAsListChannel that batches its elements with a given CoroutineContext

Link copied to clipboard
inline fun <T : Enum<T>> Enum.Companion.byOrdinalOrDefault(ordinal: Int, defaultValue: T): T

Returns the enum by matching ordinals position, or the given default value if no ordinals match.

Link copied to clipboard
Link copied to clipboard
fun <T> Iterable<T>.containsAny(elements: Iterable<T>): Boolean

Returns true if contains at least one element from elements

Link copied to clipboard

Creates a CompletableDeferred in an active state of typed Unit. In other words, it returns no value (either it will complete or throw an Exception). It is optionally a child of a parent job.

Link copied to clipboard
inline fun <R> Sequence<*>.firstInstance(): R?
inline suspend fun <R> Flow<*>.firstInstance(): R?

Returns first element that is instance of specific type parameter R, or null if not found

Link copied to clipboard
fun <T> Deferred<T>.getCompletedOrNull(): T?

Gets the Deferred.getCompleted value if Deferred.isCompleted or null otherwise.

Link copied to clipboard
actual fun NSData.toByteArray(): ByteArray

Converts a NSData to its corresponding ByteArray

expect fun NSData.toByteArray(): ByteArray

Converts a NSData to its corresponding ByteArray

actual fun NSData.toByteArray(): ByteArray

Converts a NSData to its corresponding ByteArray

Link copied to clipboard
actual fun ByteArray.toNSData(): NSData

Converts a ByteArray to its corresponding NSData

expect fun ByteArray.toNSData(): NSData

Converts a ByteArray to its corresponding NSData

actual fun ByteArray.toNSData(): NSData

Converts a ByteArray to its corresponding NSData

Link copied to clipboard
inline fun <T : Any> List<*>.typedList(): List<T>

Converts a list of unknown typing to a list of a given type. This proves useful since generics are lost when converting ObjC/Swift to Kotlin

Link copied to clipboard
inline fun <K : Any, V : Any> Map<*, *>.typedMap(): Map<K, V>

Converts a map of unknown typing to a map of a given key-value type. This proves useful since generics are lost when converting ObjC/Swift to Kotlin