kaios-types
    Preparing search index...

    Interface DOMDownload

    Represents a single file download.

    JSImplementation: "@mozilla.org/downloads/download;1"

    Pref: "dom.mozDownloads.enabled"

    Permissions: "downloads"

    interface DOMDownload {
        contentType: string;
        currentBytes: number;
        error: any;
        id: string;
        onstatechange: ((this: DOMDownload, ev: Event) => any) | null;
        path: string;
        sourceAppManifestURL: string | null;
        startTime: Date;
        state: DownloadState;
        storageName: string;
        storagePath: string;
        totalBytes: number;
        url: string;
        addEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        dispatchEvent(event: Event): boolean;
        pause(): Promise<DOMDownload>;
        removeEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | EventListenerOptions,
        ): void;
        resume(): Promise<DOMDownload>;
    }

    Hierarchy

    • EventTarget
      • DOMDownload
    Index

    Properties

    contentType: string

    The MIME type of the file.

    currentBytes: number

    The number of bytes downloaded so far.

    error: any

    The error object if the download failed.

    id: string

    The unique identifier of the download.

    onstatechange: ((this: DOMDownload, ev: Event) => any) | null
    path: string

    The local path where the file is being saved.

    sourceAppManifestURL: string | null

    The manifest URL of the application that initiated the download.

    startTime: Date

    The time when the download started.

    The current state of the download.

    storageName: string

    The name of the storage area where the file is saved.

    storagePath: string

    The relative path within the storage area.

    totalBytes: number

    The total size of the file in bytes.

    url: string

    The URL of the file being downloaded.

    Methods

    • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void