import { TwinfinityViewer } from './loader/twinfinity-viewer';
// If DebugLayer.ts is imported by a application it will be possible to enable the debug layer.
// Debug layer modules are quite large (several MB) so we only load them on demand. However
// generating debug layer bundles will still take quite a lot of compile time. Therefore we
// make debug layer completely optional. If users dont want it then they simply dont
// include DebugLayer.ts and their bundle size's will be greatly reduces.
let loadDebugLayerModulesPromise = undefined;
function loadDebugLayerModules() {
    if (loadDebugLayerModulesPromise !== undefined) {
        return loadDebugLayerModulesPromise;
    }
    loadDebugLayerModulesPromise = Promise.all([
        import('@babylonjs/core/Debug/debugLayer'),
        import('@babylonjs/inspector')
    ]).then((v) => true);
    return loadDebugLayerModulesPromise;
}
TwinfinityViewer.prototype.isDebugLayerEnabled = function (isEnabled) {
    return loadDebugLayerModules().then((v) => {
        if (!isEnabled) {
            this.scene.debugLayer.hide();
            return false;
        }
        else {
            return this.scene.debugLayer.show().then((_v) => true);
        }
    });
};
//# sourceMappingURL=Debug.js.map