Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/index.ts>dom.FileReader

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.FileReader
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.5.6/lib/types/index.ts";
const { FileReader } = dom;

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.

Properties

readonly
error: DOMException | null
onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null
readonly
readyState: number
readonly
result: string | ArrayBuffer | null
readonly
DONE: number
readonly
EMPTY: number
readonly
LOADING: number

Methods

abort(): void
readAsArrayBuffer(blob: Blob): void
readAsBinaryString(blob: Blob): void
readAsDataURL(blob: Blob): void
readAsText(blob: Blob, encoding?: string): void
addEventListener<K extends keyof FileReaderEventMap>(
type: K,
listener: (this: FileReader, ev: FileReaderEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof FileReaderEventMap>(
type: K,
listener: (this: FileReader, ev: FileReaderEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void