LogoPixi’VN
coreClasses

Class: XHRLoader

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4736

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.

Constructors

Constructor

> new XHRLoader(): XHRLoader

Returns

XHRLoader

Properties

allXhrSet

> static allXhrSet: Set<XMLHttpRequest>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4744

All the created XHRs as a flat array.


loader

> static loader: Middleware<Live2DLoaderContext>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4748

Middleware for Live2DLoader.


xhrMap

> static xhrMap: WeakMap<Live2DLoaderTarget, Set<XMLHttpRequest>>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4740

All the created XHRs, keyed by their owners respectively.

Methods

cancelXHRs()

> static cancelXHRs(this): void

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4761

Cancels all XHRs related to this target.

Parameters

this

Live2DLoaderTarget

Returns

void


createXHR()

> static createXHR<T>(target, url, type, onload, onerror): XMLHttpRequest

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4757

Creates a managed XHR.

Type Parameters

T

T = unknown

Parameters

target

Live2DLoaderTarget | undefined

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) => void

Load listener.

onerror

(e) => void

Error handler.

Returns

XMLHttpRequest


release()

> static release(): void

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4765

Release all XHRs.

Returns

void

On this page