main.cesium.Packable.kt Maven / Gradle / Ivy
// Automatically generated - do not modify!
@file:JsModule("cesium")
package cesium
/**
* Static interface for types which can store their values as packed
* elements in an array. These methods and properties are expected to be
* defined on a constructor function.
* @see Online Documentation
*/
external interface Packable {
/**
* The number of elements used to pack the object into an array.
* @see Online Documentation
*/
val packedLength: Int
/**
* Stores the provided instance into the provided array.
* @param [value] The value to pack.
* @param [array] The array to pack into.
* @param [startingIndex] The index into the array at which to start packing the elements.
* Default value - `0`
* @see Online Documentation
*/
fun pack(
value: T,
array: Array,
startingIndex: Int? = definedExternally,
): Array
/**
* Retrieves an instance from a packed array.
* @param [array] The packed array.
* @param [startingIndex] The starting index of the element to be unpacked.
* Default value - `0`
* @param [result] The object into which to store the result.
* @return The modified result parameter or a new Object instance if one was not provided.
* @see Online Documentation
*/
fun unpack(
array: Array,
startingIndex: Int? = definedExternally,
result: T? = definedExternally,
): T
}