import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader";
import { PmxReader } from "./Parser/pmxReader";
import { PmLoader } from "./pmLoader";
/**
 * PmxLoader is a loader that loads the model in the PMX format
 *
 * PMX is a binary file format that contains all the data except the texture of the model
 */
export class PmxLoader extends PmLoader {
    /**
     * Create a new PmdLoader
     */
    constructor() {
        super("pmx", {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            ".pmx": { isBinary: true }
        });
    }
    async _parseFileAsync(arrayBuffer) {
        return await PmxReader.ParseAsync(arrayBuffer, this)
            .catch((e) => {
            return Promise.reject(e);
        });
    }
}
if (SceneLoader) {
    SceneLoader.RegisterPlugin(new PmxLoader());
}
