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

main.cesium.ProviderViewModel.kt Maven / Gradle / Ivy

// Automatically generated - do not modify!

@file:JsModule("cesium")

@file:Suppress(
    "NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)

package cesium

/**
 * A view model that represents each item in the [BaseLayerPicker].
 * @see Online Documentation
 *
 * @constructor
 * @param [options] The object containing all parameters.
 * @see Online Documentation
 */
external class ProviderViewModel(options: ConstructorOptions) {
    /**
     * @property [name] The name of the layer.
     * @property [tooltip] The tooltip to show when the item is moused over.
     * @property [iconUrl] An icon representing the layer.
     * @property [category] A category for the layer.
     * @property [creationFunction] A function or Command
     *   that creates one or more providers which will be added to the globe when this item is selected.
     */
    interface ConstructorOptions {
        var name: String
        var tooltip: String
        var iconUrl: String
        var category: String?
        var creationFunction: dynamic
    }

    /**
     * Gets the display name.  This property is observable.
     * @see Online Documentation
     */
    var name: String

    /**
     * Gets the tooltip.  This property is observable.
     * @see Online Documentation
     */
    var tooltip: String

    /**
     * Gets the icon.  This property is observable.
     * @see Online Documentation
     */
    var iconUrl: String

    /**
     * Gets the Command that creates one or more providers which will be added to
     * the globe when this item is selected.
     * @see Online Documentation
     */
    val creationCommand: Command

    /**
     * Gets the category
     * @see Online Documentation
     */
    val category: String
}

/**
 * A function which creates one or more providers.
 * @see Online Documentation
 */
typealias CreationFunction = () -> dynamic

inline fun ProviderViewModel(
    block: ProviderViewModel.ConstructorOptions.() -> Unit,
): ProviderViewModel {
    val options: ProviderViewModel.ConstructorOptions = js("({})")
    block(options)
    return ProviderViewModel(options)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy