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

commonMain.io.nacular.doodle.dom.File.kt Maven / Gradle / Ivy

There is a newer version: 0.10.2
Show newest version
@file:Suppress("EXPECTED_EXTERNAL_DECLARATION", "WRONG_MODIFIER_TARGET")

package io.nacular.doodle.dom

internal expect open external class Blob: JsAny {
    val size    : JsNumber
    val type    : String
    val isClosed: Boolean
}

internal expect external class File: Blob {
    val name: String
    val lastModified: Int
}

internal expect abstract external class FileList {
    abstract val length: Int
    fun item(index: Int): File?
}

internal expect fun FileList.asList(): List

internal expect external class ProgressEvent: JsAny {
    val total           : JsNumber
    val loaded          : JsNumber
    val lengthComputable: Boolean
}

internal expect external class FileReader(): JsAny {
    val result    : JsAny
    var onerror   : (             ) -> Unit
    var onloadend : (             ) -> Unit
    var onprogress: (ProgressEvent) -> Unit

    fun readAsText       (delegate: File                  )
    fun readAsText       (delegate: File, encoding: String)
    fun readAsDataURL    (delegate: File                  )
    fun readAsArrayBuffer(delegate: File                  )
}

internal expect external class ArrayBuffer: JsAny

internal expect external class Uint8Array(array: ArrayBuffer) {
    val length: Int
}

internal expect operator fun Uint8Array.get(index: Int): Byte




© 2015 - 2024 Weber Informatics LLC | Privacy Policy