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

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

There is a newer version: 1.90.0-10
Show newest version
// Automatically generated - do not modify!

package cesium

/**
 * A collection of [DataSource] instances.
 * @see Online Documentation
 */
@JsName("\$cesium__DataSourceCollection")
external class DataSourceCollection {
    /**
     * Gets the number of data sources in this collection.
     * @see Online Documentation
     */
    val length: Int

    /**
     * An event that is raised when a data source is added to the collection.
     * Event handlers are passed the data source that was added.
     * @see Online Documentation
     */
    val dataSourceAdded: Event

    /**
     * An event that is raised when a data source is removed from the collection.
     * Event handlers are passed the data source that was removed.
     * @see Online Documentation
     */
    val dataSourceRemoved: Event

    /**
     * An event that is raised when a data source changes position in the collection.  Event handlers are passed the data source
     * that was moved, its new index after the move, and its old index prior to the move.
     * @see Online Documentation
     */
    val dataSourceMoved: Event

    /**
     * Adds a data source to the collection.
     * @param [dataSource] A data source or a promise to a data source to add to the collection.
     *   When passing a promise, the data source will not actually be added
     *   to the collection until the promise resolves successfully.
     * @return A Promise that resolves once the data source has been added to the collection.
     * @see Online Documentation
     */
    fun add(dataSource: DataSource): kotlin.js.Promise

    fun add(dataSource: kotlin.js.Promise): kotlin.js.Promise

    /**
     * Removes a data source from this collection, if present.
     * @param [dataSource] The data source to remove.
     * @param [destroy] Whether to destroy the data source in addition to removing it.
     *   Default value - `false`
     * @return true if the data source was in the collection and was removed,
     *   false if the data source was not in the collection.
     * @see Online Documentation
     */
    fun remove(
        dataSource: DataSource,
        destroy: Boolean? = definedExternally,
    ): Boolean

    /**
     * Removes all data sources from this collection.
     * @param [destroy] whether to destroy the data sources in addition to removing them.
     *   Default value - `false`
     * @see Online Documentation
     */
    fun removeAll(destroy: Boolean? = definedExternally)

    /**
     * Checks to see if the collection contains a given data source.
     * @param [dataSource] The data source to check for.
     * @return true if the collection contains the data source, false otherwise.
     * @see Online Documentation
     */
    fun contains(dataSource: DataSource): Boolean

    /**
     * Determines the index of a given data source in the collection.
     * @param [dataSource] The data source to find the index of.
     * @return The index of the data source in the collection, or -1 if the data source does not exist in the collection.
     * @see Online Documentation
     */
    fun indexOf(dataSource: DataSource): Int

    /**
     * Gets a data source by index from the collection.
     * @param [index] the index to retrieve.
     * @return The data source at the specified index.
     * @see Online Documentation
     */
    fun get(index: Int): DataSource

    /**
     * Gets a data source by name from the collection.
     * @param [name] The name to retrieve.
     * @return A list of all data sources matching the provided name.
     * @see Online Documentation
     */
    fun getByName(name: String): Array

    /**
     * Raises a data source up one position in the collection.
     * @param [dataSource] The data source to move.
     * @see Online Documentation
     */
    fun raise(dataSource: DataSource)

    /**
     * Lowers a data source down one position in the collection.
     * @param [dataSource] The data source to move.
     * @see Online Documentation
     */
    fun lower(dataSource: DataSource)

    /**
     * Raises a data source to the top of the collection.
     * @param [dataSource] The data source to move.
     * @see Online Documentation
     */
    fun raiseToTop(dataSource: DataSource)

    /**
     * Lowers a data source to the bottom of the collection.
     * @param [dataSource] The data source to move.
     * @see Online Documentation
     */
    fun lowerToBottom(dataSource: DataSource)

    /**
     * Returns true if this object was destroyed; otherwise, false.
     * If this object was destroyed, it should not be used; calling any function other than
     * `isDestroyed` will result in a [DeveloperError] exception.
     * @return true if this object was destroyed; otherwise, false.
     * @see Online Documentation
     */
    fun isDestroyed(): Boolean

    /**
     * Destroys the resources held by all data sources in this collection.  Explicitly destroying this
     * object allows for deterministic release of WebGL resources, instead of relying on the garbage
     * collector. Once this object is destroyed, it should not be used; calling any function other than
     * `isDestroyed` will result in a [DeveloperError] exception.  Therefore,
     * assign the return value (`undefined`) to the object as done in the example.
     * ```
     * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
     * ```
     * @see Online Documentation
     */
    fun destroy()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy