Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Events

Static LOADING_COMPLETE

LOADING_COMPLETE: symbol = ...

Fired when the data loading finishes.

Static LOADING_PROGRESS

LOADING_PROGRESS: symbol = ...

Fired when data loading progresses. Not fired when data loading finishes.

Static LOADING_START

LOADING_START: symbol = ...

Fired when data loading progresses. Not fired when data loading finishes.

Properties

Private listeners

listeners: Map<string | symbol, Set<EventCallback>>

Map of registered event listeners with this instance.

Readonly Static omniEvent

omniEvent: symbol

Returns a symbol that can be used to register an omni-listener.

Accessors

byteLength

  • get byteLength(): Promise<number>

bytesLoaded

  • get bytesLoaded(): number

isLoadingComplete

  • get isLoadingComplete(): boolean

onLoadingComplete

  • get onLoadingComplete(): Promise<number>

Methods

emit

  • emit(type: string | symbol, ...args: any[]): void
  • Emit an event to all event listeners register for that specific event and omni-listeners (listeners registered wising * as the event type).

    Parameters

    • type: string | symbol

      The event to emit, cannot be *

    • Rest ...args: any[]

      Parameters to pass to the callback functions registered for this event

    Returns void

Abstract loadData

  • loadData(start?: number, end?: number): Promise<ArrayBuffer>
  • Loads the file into an ArrayBuffer. Optionally a start and end can be specified to load a part of the file.

    Parameters

    • Optional start: number

      The offset at which the data will start loading

    • Optional end: number

      The offset at which the data will stop loading

    Returns Promise<ArrayBuffer>

off

  • off(type: string | symbol, callback: EventCallback): void
  • Unregister an event listener callback.

    Parameters

    • type: string | symbol

      The event to unregister from

    • callback: EventCallback

      Callback function to remove

    Returns void

on

  • on(type: string | symbol, callback: EventCallback): void
  • Register an event listener callback for the specified event.

    NOTE: Pass * as the event type to listen to all event emitted by this instance.

    Parameters

    • type: string | symbol

      The event to listen for

    • callback: EventCallback

      Called when the event is emitted by this instance

    Returns void

slice

  • slice(start: number, end: number): DataChunk
  • Slices the file and returns a data chunk pointing at the data within the specified boundaries.

    Parameters

    • start: number

      Pointer to the start of the data in bytes

    • end: number

      Pointer to the end of the data in bytes

    Returns DataChunk

Abstract startDownloading

  • startDownloading(): Promise<void>
  • This function must ba called in order to start downloading the file, if this function fail the file cannot be fetched from the server.

    Returns Promise<void>

Static mixin

  • mixin<T>(Parent: T): { omniEvent: symbol } & T
  • Mixin method that holds the EventEmitter implementation, this function is exposed through EventEmitter.mixin.

    Type parameters

    • T

    Parameters

    • Parent: T

      The parent class into which the EventEmitter implementation will be mixed in.

    Returns { omniEvent: symbol } & T

Generated using TypeDoc