Options
All
  • Public
  • Public/Protected
  • All
Menu

An Upload is the result of calling parcel.uploadDocument.

During upload, emits progress events, each with a ProgressEvent as its argument.

When the document has been uploaded, the finish event is emitted with the Document reference as its argument.

Hierarchy

  • EventEmitter
    • Upload

Index

Constructors

constructor

Properties

Private Readonly abortController

abortController: AbortController

Static prefixed

prefixed: string | boolean

Accessors

aborted

  • get aborted(): boolean
  • Returns boolean

finished

  • Returns Promise<Document>

    a Promise that resolves when the upload stream has finished.

Methods

abort

  • abort(): void
  • Aborts the upload. Emits an abort event and sets the aborted flag.

    Returns void

addListener

  • addListener<T>(event: T, fn: (...args: any[]) => void, context?: any): Upload
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns Upload

emit

  • emit<T>(event: T, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners<T>(event: T): ((...args: any[]) => void)[]
  • Return the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

off

  • off<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): Upload
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns Upload

on

  • on<T>(event: T, fn: (...args: any[]) => void, context?: any): Upload
  • Add a listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns Upload

once

  • once<T>(event: T, fn: (...args: any[]) => void, context?: any): Upload
  • Add a one-time listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns Upload

removeAllListeners

  • removeAllListeners(event?: string | symbol): Upload
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns Upload

removeListener

  • removeListener<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): Upload
  • Remove the listeners of a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns Upload

Generated using TypeDoc