Experimental loader to load resources from uploaded files.

This loader relies on webkitRelativePath to recognize the file path.

Though named as a "Loader", this class has nothing to do with Live2DLoader, it only contains a middleware for the Live2DFactory.

Hierarchy

  • FileLoader

Constructors

Properties

factory: Middleware<Live2DFactoryContext> = ...

Middleware for Live2DFactory.

filesMap: { [settingsFileURL: string]: { [resourceFileURL: string]: string } } = {}

Stores all the object URLs of uploaded files.

Type declaration

  • [settingsFileURL: string]: { [resourceFileURL: string]: string }
    • [resourceFileURL: string]: string

Methods

  • Reads a file as text in UTF-8.

    Parameters

    • file: File

    Returns Promise<string>

  • Resolves the path of a resource file to the object URL.

    Returns

    Resolved object URL.

    Parameters

    • settingsURL: string

      Object URL of the settings file.

    • filePath: string

      Resource file path.

    Returns string

Generated using TypeDoc