Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Loader

Hierarchy

Index

Constructors

constructor

  • new Loader(baseUrl?: string, concurrency?: number): Loader
  • Parameters

    • Optional baseUrl: string
    • Optional concurrency: number

    Returns Loader

Properties

Protected _afterMiddleware

_afterMiddleware: Function[]

Protected _beforeMiddleware

_beforeMiddleware: Function[]

Protected _boundLoadResource

_boundLoadResource: function

Type declaration

    • Parameters

      Returns void

Protected _queue

_queue: any

Protected _resourcesParsing

_resourcesParsing: Resource[]

baseUrl

baseUrl: string

defaultQueryString

defaultQueryString: string

loading

loading: boolean

onComplete

onComplete: MiniSignal

onError

onError: MiniSignal

onLoad

onLoad: MiniSignal

onProgress

onProgress: MiniSignal

onStart

onStart: MiniSignal

progress

progress: number

resources

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • Returns EventEmitter

  • prefixed: string | boolean

Static Resource

Resource: any

Static async

async: any

Static base64

base64: any

Static prefixed

prefixed: string | boolean

Methods

Protected _loadResource

  • _loadResource(resource: Resource, dequeue: Function): void
  • Parameters

    Returns void

Protected _onComplete

  • _onComplete(): void
  • Returns void

Protected _onLoad

  • Parameters

    Returns void

Protected _prepareUrl

  • _prepareUrl(url: string): string
  • Parameters

    • url: string

    Returns string

add

  • add(...params: any[]): this
  • add(name: string, url: string, options?: LoaderOptions, cb?: Function): this
  • add(obj: string | any | any[], options?: LoaderOptions, cb?: Function): this
  • Parameters

    • Rest ...params: any[]

    Returns this

  • Parameters

    • name: string
    • url: string
    • Optional options: LoaderOptions
    • Optional cb: Function

    Returns this

  • Parameters

    • obj: string | any | any[]
    • Optional options: LoaderOptions
    • Optional cb: Function

    Returns this

addListener

  • addListener(event: string | symbol, fn: Function, context?: any): this
  • Alias method for on

    Parameters

    • event: string | symbol
    • fn: Function
    • Optional context: any

    Returns this

destroy

  • destroy(): void
  • Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    • Rest ...args: any[]

      Arguments that are passed to registered listeners

    Returns boolean

    true if the event had listeners, else false.

eventNames

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

    Returns Array<string | symbol>

listeners

  • listeners(event: string | symbol): Function[]
  • listeners(event: string | symbol, exists: boolean): boolean
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    Returns Function[]

  • Check if there listeners for a given event. If exists argument is not true lists listeners.

    Parameters

    • event: string | symbol

      The event name.

    • exists: boolean

      Only check if there are listeners.

    Returns boolean

load

  • load(cb?: Function): this
  • Parameters

    • Optional cb: Function

    Returns this

off

  • off(event: "complete" | "error" | "load" | "progress" | "start" | string, fn?: Function, context?: any): this
  • Parameters

    • event: "complete" | "error" | "load" | "progress" | "start" | string
    • Optional fn: Function
    • Optional context: any

    Returns this

on

  • on(event: "complete", fn: function, context?: any): this
  • on(event: "error", fn: function, context?: any): this
  • on(event: "load" | "progress", fn: function, context?: any): this
  • on(event: "start", fn: function, context?: any): this
  • Parameters

    • event: "complete"
    • fn: function
        • (loader: Loader, object: any): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "error"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: "load" | "progress"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: "start"
    • fn: function
        • Parameters

          Returns void

    • Optional context: any

    Returns this

once

  • once(event: "complete", fn: function, context?: any): this
  • once(event: "error", fn: function, context?: any): this
  • once(event: "load" | "progress", fn: function, context?: any): this
  • once(event: "start", fn: function, context?: any): this
  • Parameters

    • event: "complete"
    • fn: function
        • (loader: Loader, object: any): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "error"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: "load" | "progress"
    • fn: function
    • Optional context: any

    Returns this

  • Parameters

    • event: "start"
    • fn: function
        • Parameters

          Returns void

    • Optional context: any

    Returns this

pre

  • pre(fn: Function): this
  • Parameters

    • fn: Function

    Returns this

removeAllListeners

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

    Parameters

    • Optional event: string | symbol

      The event name.

    Returns this

    this.

removeListener

  • removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this
  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol

      The event name.

    • Optional fn: Function

      Only remove the listeners that match this function.

    • Optional context: any

      Only remove the listeners that have this context.

    • Optional once: boolean

      Only remove one-time listeners.

    Returns this

    this.

reset

  • reset(): this
  • Returns this

setMaxListeners

  • setMaxListeners(): this
  • This function doesn't apply anymore.

    deprecated

    Returns this

use

  • use(fn: Function): this
  • Parameters

    • fn: Function

    Returns this

Static addPixiMiddleware

  • addPixiMiddleware(fn: Function): void
  • Parameters

    • fn: Function

    Returns void

Generated using TypeDoc