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