The basic XHR loader.

A network error will be thrown with the following properties:

  • url - The request URL.
  • status - The HTTP status.
  • aborted - True if the error is caused by aborting the XHR.

Hierarchy

  • XHRLoader

Constructors

Properties

Methods

Constructors

Properties

allXhrSet: Set<XMLHttpRequest> = ...

All the created XHRs as a flat array.

loader: Middleware<Live2DLoaderContext> = ...

Middleware for Live2DLoader.

xhrMap: WeakMap<Live2DLoaderTarget, Set<XMLHttpRequest>> = ...

All the created XHRs, keyed by their owners respectively.

Methods

  • Creates a managed XHR.

    Type Parameters

    • T = any

    Parameters

    • target: undefined | Live2DLoaderTarget

      If provided, the XHR will be canceled when receiving an "destroy" event from the target.

    • url: string

      The URL.

    • type: XMLHttpRequestResponseType

      The XHR response type.

    • onload: ((data: T) => void)

      Load listener.

        • (data: T): void
        • Parameters

          • data: T

          Returns void

    • onerror: ((e: Error) => void)

      Error handler.

        • (e: Error): void
        • Parameters

          • e: Error

          Returns void

    Returns XMLHttpRequest

Generated using TypeDoc