Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Reading.Task

import { Reading } from "https://raw.githubusercontent.com/i-xi-dev/bytes.es/4.4.0/deps.ts"; 

const { Task } = Reading;
abstract

The reading task.

abstract class Task<T> extends EventTarget {
protected constructor(options?: Options);
protected _loaded: SafeInteger;
protected readonly _signal: AbortSignal | undefined;
protected _status: Reading.Status;
get total(): SafeInteger;
get indeterminate(): boolean;
get status(): Status;
get loaded(): SafeInteger;
 
protected _notifyProgress(name: _ProgressEventName): void;
abstract run(): Promise<T>;
}

§Type Parameters

§Extends

§
EventTarget
[src]

§Constructors

§
new Task(options?: Options) protected
[src]
@param options
  • The reading options.

§Properties

§

The read length.

§
_signal: AbortSignal | undefined
[src]

The AbortSignal to abort reading.

§

The reading status.

§
total: SafeInteger readonly
[src]

The total length of reading.

§
indeterminate: boolean readonly
[src]

Whether the reading has no computable length.

§
status: Status readonly
[src]

The reading status.

§
loaded: SafeInteger readonly
[src]

The read length.

§Methods

§
_notifyProgress(name: _ProgressEventName): void protected
[src]

Dispatch the ProgressEvent to notify progress.

@param name
  • The name of ProgressEvent.
§
run(): Promise<T> abstract
[src]

Run this reading task.

@return

The Promise that fulfills with a read value.