[stdlib] Annotated new API with SinceKotlin(2.0) where required KT-64904
This commit is contained in:
committed by
Space Team
parent
1c4023fda5
commit
5afb2c5e4b
@@ -10115,7 +10115,7 @@ public open class ArrayList<E> : kotlin.collections.AbstractMutableList<E>, kotl
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open override fun asJsArrayView(): kotlin.js.collections.JsArray<E>
|
||||
|
||||
public open override fun clear(): kotlin.Unit
|
||||
@@ -10319,7 +10319,7 @@ public interface List<out E> : kotlin.collections.Collection<E> {
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsReadonlyArrayView(): kotlin.js.collections.JsReadonlyArray<E>
|
||||
|
||||
public abstract override operator fun contains(element: E): kotlin.Boolean
|
||||
@@ -10376,7 +10376,7 @@ public interface Map<K, out V> {
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsReadonlyMapView(): kotlin.js.collections.JsReadonlyMap<K, V>
|
||||
|
||||
public abstract fun containsKey(key: K): kotlin.Boolean
|
||||
@@ -10429,7 +10429,7 @@ public interface MutableList<E> : kotlin.collections.List<E>, kotlin.collections
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsArrayView(): kotlin.js.collections.JsArray<E>
|
||||
|
||||
public abstract override fun clear(): kotlin.Unit
|
||||
@@ -10472,7 +10472,7 @@ public interface MutableMap<K, V> : kotlin.collections.Map<K, V> {
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsMapView(): kotlin.js.collections.JsMap<K, V>
|
||||
|
||||
public abstract fun clear(): kotlin.Unit
|
||||
@@ -10495,7 +10495,7 @@ public interface MutableSet<E> : kotlin.collections.Set<E>, kotlin.collections.M
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsSetView(): kotlin.js.collections.JsSet<E>
|
||||
|
||||
public abstract override fun clear(): kotlin.Unit
|
||||
@@ -10517,7 +10517,7 @@ public interface Set<out E> : kotlin.collections.Collection<E> {
|
||||
|
||||
@kotlin.js.ExperimentalJsExport
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public open fun asJsReadonlySetView(): kotlin.js.collections.JsReadonlySet<E>
|
||||
|
||||
public abstract override operator fun contains(element: E): kotlin.Boolean
|
||||
@@ -10535,4 +10535,4 @@ public abstract class ShortIterator : kotlin.collections.Iterator<kotlin.Short>
|
||||
public final override operator fun next(): kotlin.Short
|
||||
|
||||
public abstract fun nextShort(): kotlin.Short
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
@kotlin.js.JsName(name = "Array")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public open external class JsArray<E> : kotlin.js.collections.JsReadonlyArray<E> {
|
||||
public constructor JsArray<E>()
|
||||
}
|
||||
|
||||
@kotlin.js.JsName(name = "Map")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public open external class JsMap<K, V> : kotlin.js.collections.JsReadonlyMap<K, V> {
|
||||
public constructor JsMap<K, V>()
|
||||
}
|
||||
|
||||
@kotlin.js.JsName(name = "ReadonlyArray")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlyArray<out E> {
|
||||
}
|
||||
|
||||
@kotlin.js.JsName(name = "ReadonlyMap")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlyMap<K, out V> {
|
||||
}
|
||||
|
||||
@kotlin.js.JsName(name = "ReadonlySet")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlySet<out E> {
|
||||
}
|
||||
|
||||
@kotlin.js.JsName(name = "Set")
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
@kotlin.js.ExperimentalJsCollectionsApi
|
||||
public open external class JsSet<E> : kotlin.js.collections.JsReadonlySet<E> {
|
||||
public constructor JsSet<E>()
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public final annotation class EagerInitialization : kotlin.Annotation {
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY)
|
||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION})
|
||||
@kotlin.annotation.MustBeDocumented
|
||||
@kotlin.SinceKotlin(version = "1.9")
|
||||
@kotlin.SinceKotlin(version = "2.0")
|
||||
public final annotation class ExperimentalJsCollectionsApi : kotlin.Annotation {
|
||||
public constructor ExperimentalJsCollectionsApi()
|
||||
}
|
||||
|
||||
@@ -144,5 +144,5 @@ public annotation class ExperimentalJsReflectionCreateInstance
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
@MustBeDocumented
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public annotation class ExperimentalJsCollectionsApi
|
||||
|
||||
@@ -21,8 +21,7 @@ public expect abstract class AbstractMutableList<E> : MutableList<E> {
|
||||
* to provide fail-fast behavior when a concurrent modification is detected during iteration.
|
||||
* [ConcurrentModificationException] will be thrown in this case.
|
||||
*/
|
||||
// TODO: Should be @SinceKotlin("2.0"), see KT-64904
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
protected var modCount: Int
|
||||
|
||||
protected constructor()
|
||||
@@ -30,8 +29,7 @@ public expect abstract class AbstractMutableList<E> : MutableList<E> {
|
||||
/**
|
||||
* Removes the range of elements from this list starting from [fromIndex] and ending with but not including [toIndex].
|
||||
*/
|
||||
// TODO: Should be @SinceKotlin("2.0"), see KT-64904
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
protected open fun removeRange(fromIndex: Int, toIndex: Int): Unit
|
||||
|
||||
// From List
|
||||
|
||||
@@ -203,7 +203,7 @@ public interface List<out E> : Collection<E> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsReadonlyArrayView(): JsReadonlyArray<E> = createJsReadonlyArrayViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public interface MutableList<E> : List<E>, MutableCollection<E> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsArrayView(): JsArray<E> = createJsArrayViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ public interface Set<out E> : Collection<E> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsReadonlySetView(): JsReadonlySet<E> = createJsReadonlySetViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ public interface MutableSet<E> : Set<E>, MutableCollection<E> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsSetView(): JsSet<E> = createJsSetViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ public interface Map<K, out V> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsReadonlyMapView(): JsReadonlyMap<K, V> = createJsReadonlyMapViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -497,6 +497,6 @@ public interface MutableMap<K, V> : Map<K, V> {
|
||||
*/
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
public fun asJsMapView(): JsMap<K, V> = createJsMapViewFrom(this)
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public actual open class ArrayList<E> internal constructor(private var array: Ar
|
||||
|
||||
@ExperimentalJsExport
|
||||
@ExperimentalJsCollectionsApi
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
override fun asJsArrayView(): JsArray<E> = array.unsafeCast<JsArray<E>>()
|
||||
|
||||
internal override fun checkIsMutable() {
|
||||
|
||||
@@ -10,7 +10,7 @@ package kotlin.js.collections
|
||||
* Exposes the TypeScript [ReadonlyArray](https://www.typescriptlang.org/docs/handbook/2/objects.html#the-readonlyarray-type) to Kotlin.
|
||||
*/
|
||||
@JsName("ReadonlyArray")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlyArray<out E>
|
||||
|
||||
@@ -18,7 +18,7 @@ public external interface JsReadonlyArray<out E>
|
||||
* Exposes the JavaScript [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) to Kotlin.
|
||||
*/
|
||||
@JsName("Array")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external open class JsArray<E> : JsReadonlyArray<E>
|
||||
|
||||
@@ -26,7 +26,7 @@ public external open class JsArray<E> : JsReadonlyArray<E>
|
||||
* Exposes the TypeScript [ReadonlySet](https://github.com/microsoft/TypeScript/blob/bd952a7a83ce04b3541b952238b6c0e4316b7d5d/src/lib/es2015.collection.d.ts#L103) to Kotlin.
|
||||
*/
|
||||
@JsName("ReadonlySet")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlySet<out E>
|
||||
|
||||
@@ -34,7 +34,7 @@ public external interface JsReadonlySet<out E>
|
||||
* Exposes the JavaScript [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) to Kotlin.
|
||||
*/
|
||||
@JsName("Set")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external open class JsSet<E> : JsReadonlySet<E>
|
||||
|
||||
@@ -42,7 +42,7 @@ public external open class JsSet<E> : JsReadonlySet<E>
|
||||
* Exposes the TypeScript [ReadonlyMap](https://github.com/microsoft/TypeScript/blob/bd952a7a83ce04b3541b952238b6c0e4316b7d5d/src/lib/es2015.collection.d.ts#L37) to Kotlin.
|
||||
*/
|
||||
@JsName("ReadonlyMap")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external interface JsReadonlyMap<K, out V>
|
||||
|
||||
@@ -50,6 +50,6 @@ public external interface JsReadonlyMap<K, out V>
|
||||
* Exposes the JavaScript [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) to Kotlin.
|
||||
*/
|
||||
@JsName("Map")
|
||||
@SinceKotlin("1.9")
|
||||
@SinceKotlin("2.0")
|
||||
@ExperimentalJsCollectionsApi
|
||||
public external open class JsMap<K, V> : JsReadonlyMap<K, V>
|
||||
Reference in New Issue
Block a user