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

js.web.dom.FileReader Maven / Gradle / Ivy

package js.web.dom;

import js.lang.Unknown;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSProperty;

import javax.annotation.Nullable;

/**
 * Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read.
 */
public interface FileReader extends EventTarget {
    @JSBody(script = "return FileReader.prototype")
    static FileReader prototype() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return new FileReader()")
    static FileReader create() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return FileReader.DONE")
    static int DONE() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return FileReader.EMPTY")
    static int EMPTY() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return FileReader.LOADING")
    static int LOADING() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSProperty
    @Nullable
    DOMException getError();

    @JSProperty
    @Nullable
    EventListener> getOnabort();

    @JSProperty
    void setOnabort(EventListener> onabort);

    default void addAbortEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("abort", listener, options);
    }

    default void addAbortEventListener(EventListener> listener, boolean options) {
        addEventListener("abort", listener, options);
    }

    default void addAbortEventListener(EventListener> listener) {
        addEventListener("abort", listener);
    }

    default void removeAbortEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("abort", listener, options);
    }

    default void removeAbortEventListener(EventListener> listener, boolean options) {
        removeEventListener("abort", listener, options);
    }

    default void removeAbortEventListener(EventListener> listener) {
        removeEventListener("abort", listener);
    }

    @JSProperty
    @Nullable
    EventListener> getOnerror();

    @JSProperty
    void setOnerror(EventListener> onerror);

    default void addErrorEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("error", listener, options);
    }

    default void addErrorEventListener(EventListener> listener, boolean options) {
        addEventListener("error", listener, options);
    }

    default void addErrorEventListener(EventListener> listener) {
        addEventListener("error", listener);
    }

    default void removeErrorEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("error", listener, options);
    }

    default void removeErrorEventListener(EventListener> listener, boolean options) {
        removeEventListener("error", listener, options);
    }

    default void removeErrorEventListener(EventListener> listener) {
        removeEventListener("error", listener);
    }

    @JSProperty
    @Nullable
    EventListener> getOnload();

    @JSProperty
    void setOnload(EventListener> onload);

    default void addLoadEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("load", listener, options);
    }

    default void addLoadEventListener(EventListener> listener, boolean options) {
        addEventListener("load", listener, options);
    }

    default void addLoadEventListener(EventListener> listener) {
        addEventListener("load", listener);
    }

    default void removeLoadEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("load", listener, options);
    }

    default void removeLoadEventListener(EventListener> listener, boolean options) {
        removeEventListener("load", listener, options);
    }

    default void removeLoadEventListener(EventListener> listener) {
        removeEventListener("load", listener);
    }

    @JSProperty
    @Nullable
    EventListener> getOnloadend();

    @JSProperty
    void setOnloadend(EventListener> onloadend);

    default void addLoadEndEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("loadend", listener, options);
    }

    default void addLoadEndEventListener(EventListener> listener, boolean options) {
        addEventListener("loadend", listener, options);
    }

    default void addLoadEndEventListener(EventListener> listener) {
        addEventListener("loadend", listener);
    }

    default void removeLoadEndEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("loadend", listener, options);
    }

    default void removeLoadEndEventListener(EventListener> listener, boolean options) {
        removeEventListener("loadend", listener, options);
    }

    default void removeLoadEndEventListener(EventListener> listener) {
        removeEventListener("loadend", listener);
    }

    @JSProperty
    @Nullable
    EventListener> getOnloadstart();

    @JSProperty
    void setOnloadstart(EventListener> onloadstart);

    default void addLoadStartEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("loadstart", listener, options);
    }

    default void addLoadStartEventListener(EventListener> listener, boolean options) {
        addEventListener("loadstart", listener, options);
    }

    default void addLoadStartEventListener(EventListener> listener) {
        addEventListener("loadstart", listener);
    }

    default void removeLoadStartEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("loadstart", listener, options);
    }

    default void removeLoadStartEventListener(EventListener> listener, boolean options) {
        removeEventListener("loadstart", listener, options);
    }

    default void removeLoadStartEventListener(EventListener> listener) {
        removeEventListener("loadstart", listener);
    }

    @JSProperty
    @Nullable
    EventListener> getOnprogress();

    @JSProperty
    void setOnprogress(EventListener> onprogress);

    default void addProgressEventListener(EventListener> listener, AddEventListenerOptions options) {
        addEventListener("progress", listener, options);
    }

    default void addProgressEventListener(EventListener> listener, boolean options) {
        addEventListener("progress", listener, options);
    }

    default void addProgressEventListener(EventListener> listener) {
        addEventListener("progress", listener);
    }

    default void removeProgressEventListener(EventListener> listener, EventListenerOptions options) {
        removeEventListener("progress", listener, options);
    }

    default void removeProgressEventListener(EventListener> listener, boolean options) {
        removeEventListener("progress", listener, options);
    }

    default void removeProgressEventListener(EventListener> listener) {
        removeEventListener("progress", listener);
    }

    @JSProperty
    int getReadyState();

    @JSProperty
    @Nullable
    Unknown getResult();

    void abort();

    void readAsArrayBuffer(Blob blob);

    void readAsBinaryString(Blob blob);

    void readAsDataURL(Blob blob);

    void readAsText(Blob blob, String encoding);

    void readAsText(Blob blob);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy