All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.symbols.currency._allCurrency.kt Maven / Gradle / Ivy

The newest version!
package org.kodein.emoji.symbols.currency

import org.kodein.emoji.Emoji
import org.kodein.emoji.EmojiFinder
import org.kodein.emoji.addSt1Variations
import org.kodein.emoji.addSt2Variations


internal fun EmojiFinder.addAllCurrency() {
    add(intArrayOf(0x1f4b1), _CurrencyExchange)
    add(intArrayOf(0x1f4b2), _HeavyDollarSign)
}

internal suspend fun SequenceScope.yieldAllCurrency() {
    yield(_CurrencyExchange)
    yield(_HeavyDollarSign)
}

internal val countCurrency = 2

/**
 * All Emoji of the Symbols: currency subgroup.
*/
public fun Emoji.Companion.sequenceCurrency(): Sequence =
    sequence { yieldAllCurrency() }

/**
 * All Emoji of the Symbols: currency subgroup.
 *
 * WARNING: This can be quite heavy to construct.
 * This method should be called in background and its result should be cached.
*/
public fun Emoji.Companion.listCurrency(): List =
    ArrayList(countCurrency).also { list -> sequenceCurrency().forEach { list.add(it) } }

@Deprecated("Renamed listCurrency.", replaceWith = ReplaceWith("listCurrency()"), level = DeprecationLevel.WARNING)
public fun Emoji.Companion.allCurrency(): List =
    listCurrency()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy