Skip to content

Commit

Permalink
Revert "Typed arrays. Use valid item type for unsigned arrays"
Browse files Browse the repository at this point in the history
This reverts commit 73229d0.
  • Loading branch information
turansky committed Jan 9, 2025
1 parent ac9768d commit 9172cfb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions kotlin-js/src/jsMain/kotlin/js/typedarrays/Uint16Array.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ open external class Uint16Array<B : ArrayBufferLike>(
override val buffer: B,
override val byteOffset: Int = definedExternally,
override val length: Int = definedExternally,
) : TypedArray<Uint16Array<B>, Uint16Array<ArrayBuffer>, B, UShort> {
) : TypedArray<Uint16Array<B>, Uint16Array<ArrayBuffer>, B, Short> {
constructor()
constructor(length: Int)
constructor(elements: JsIterable<UShort>)
constructor(elements: ReadonlyArray<UShort>)
constructor(elements: JsIterable<Short>)
constructor(elements: ReadonlyArray<Short>)

companion object : TypedArrayCompanion<Uint16Array<ArrayBuffer>, UShort>
companion object : TypedArrayCompanion<Uint16Array<ArrayBuffer>, Short>
}
8 changes: 4 additions & 4 deletions kotlin-js/src/jsMain/kotlin/js/typedarrays/Uint32Array.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ open external class Uint32Array<B : ArrayBufferLike>(
override val buffer: B,
override val byteOffset: Int = definedExternally,
override val length: Int = definedExternally,
) : TypedArray<Uint32Array<B>, Uint32Array<ArrayBuffer>, B, UInt> {
) : TypedArray<Uint32Array<B>, Uint32Array<ArrayBuffer>, B, Int> {
constructor()
constructor(length: Int)
constructor(elements: JsIterable<UInt>)
constructor(elements: ReadonlyArray<UInt>)
constructor(elements: JsIterable<Int>)
constructor(elements: ReadonlyArray<Int>)

companion object : TypedArrayCompanion<Uint32Array<ArrayBuffer>, UInt>
companion object : TypedArrayCompanion<Uint32Array<ArrayBuffer>, Int>
}
8 changes: 4 additions & 4 deletions kotlin-js/src/jsMain/kotlin/js/typedarrays/Uint8Array.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ open external class Uint8Array<B : ArrayBufferLike>(
override val buffer: B,
override val byteOffset: Int = definedExternally,
override val length: Int = definedExternally,
) : TypedArray<Uint8Array<B>, Uint8Array<ArrayBuffer>, B, UByte> {
) : TypedArray<Uint8Array<B>, Uint8Array<ArrayBuffer>, B, Byte> {
constructor()
constructor(length: Int)
constructor(elements: JsIterable<UByte>)
constructor(elements: ReadonlyArray<UByte>)
constructor(elements: JsIterable<Byte>)
constructor(elements: ReadonlyArray<Byte>)

fun setFromBase64(
string: String,
Expand All @@ -42,7 +42,7 @@ open external class Uint8Array<B : ArrayBufferLike>(
inline fun toUByteArray(): UByteArray =
toByteArray().asUByteArray()

companion object : TypedArrayCompanion<Uint8Array<ArrayBuffer>, UByte> {
companion object : TypedArrayCompanion<Uint8Array<ArrayBuffer>, Byte> {
fun fromBase64(
string: String,
options: FromBase64Options = definedExternally,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ open external class Uint8ClampedArray<B : ArrayBufferLike>(
override val buffer: B,
override val byteOffset: Int = definedExternally,
override val length: Int = definedExternally,
) : TypedArray<Uint8ClampedArray<B>, Uint8ClampedArray<ArrayBuffer>, B, UByte> {
) : TypedArray<Uint8ClampedArray<B>, Uint8ClampedArray<ArrayBuffer>, B, Byte> {
constructor()
constructor(length: Int)
constructor(elements: JsIterable<UByte>)
constructor(elements: ReadonlyArray<UByte>)
constructor(elements: JsIterable<Byte>)
constructor(elements: ReadonlyArray<Byte>)

companion object : TypedArrayCompanion<Uint8ClampedArray<ArrayBuffer>, UByte>
companion object : TypedArrayCompanion<Uint8ClampedArray<ArrayBuffer>, Byte>
}

1 comment on commit 9172cfb

@turansky
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Leonya could you, please, release these changes?

Please sign in to comment.