import { UnitySceneImporter } from './UnitySceneImporter.js';
import { GodotSceneImporter } from './GodotSceneImporter.js';
import { TiledMapImporter } from './TiledMapImporter.js';
import { LDtkImporter } from './LDtkImporter.js';
import { AsepriteImporter } from './AsepriteImporter.js';
import { OgmoImporter } from './OgmoImporter.js';
export { createOgmoImporter } from './OgmoImporter.js';
import { RPGMakerImporter } from './RPGMakerImporter.js';
export { createRPGMakerImporter } from './RPGMakerImporter.js';
import { GameMakerImporter } from './GameMakerImporter.js';
export { createGameMakerImporter } from './GameMakerImporter.js';
import { SpineImporter } from './SpineImporter.js';
export { createSpineImporter } from './SpineImporter.js';
import { DragonBonesImporter } from './DragonBonesImporter.js';
export { createDragonBonesImporter } from './DragonBonesImporter.js';
import { Live2DImporter } from './Live2DImporter.js';
export { createLive2DImporter } from './Live2DImporter.js';
import { SpriterImporter } from './SpriterImporter.js';
export { createSpriterImporter } from './SpriterImporter.js';
import { NdgImporter } from './NdgFormat.js';
export { NdgBidirectionalSync, NdgExporter, createBidirectionalSync, createNdgExporter, createNdgImporter, ndgToScene, sceneToNdg } from './NdgFormat.js';

/**
 * @file index.ts
 * @description Scene Format Import Module Exports
 * PRO-1.3: Scene Format Interoperability
 */
// ============================================================
// Base Importer
// ============================================================
/**
 * Create an importer for the specified source type
 */
function createImporter(sourceType) {
    switch (sourceType) {
        case 'unity':
            return new UnitySceneImporter();
        case 'godot':
            return new GodotSceneImporter();
        case 'tiled':
            return new TiledMapImporter();
        case 'ldtk':
            return new LDtkImporter();
        case 'aseprite':
            return new AsepriteImporter();
        case 'ogmo':
            return new OgmoImporter();
        case 'rpgmaker':
            return new RPGMakerImporter();
        case 'gamemaker':
            return new GameMakerImporter();
        case 'spine':
            return new SpineImporter();
        case 'dragonbones':
            return new DragonBonesImporter();
        case 'live2d':
            return new Live2DImporter();
        case 'spriter':
            return new SpriterImporter();
        default:
            throw new Error(`Unsupported import source type: ${sourceType}`);
    }
}
/**
 * Create importer for NDG native format
 */
function createNativeImporter() {
    return new NdgImporter();
}
/**
 * Get importer for file based on extension
 */
function getImporterForFile(filePath) {
    const ext = filePath.substring(filePath.lastIndexOf('.')).toLowerCase();
    const name = filePath.toLowerCase();
    // NDG native format
    if (['.ndg', '.ndgp', '.ndga'].includes(ext)) {
        return new NdgImporter();
    }
    // Unity
    if (['.unity', '.prefab'].includes(ext)) {
        return new UnitySceneImporter();
    }
    // Godot
    if (['.tscn', '.tres'].includes(ext)) {
        return new GodotSceneImporter();
    }
    // Tiled
    if (['.tmx', '.tmj', '.tsx', '.tsj'].includes(ext)) {
        return new TiledMapImporter();
    }
    // LDtk
    if (['.ldtk', '.ldtkl'].includes(ext)) {
        return new LDtkImporter();
    }
    // Aseprite
    if (['.aseprite', '.ase'].includes(ext)) {
        return new AsepriteImporter();
    }
    // OGMO
    if (ext === '.ogmo' || name.includes('ogmo')) {
        return new OgmoImporter();
    }
    // RPG Maker
    if (name.includes('map') && ext === '.json') {
        return new RPGMakerImporter();
    }
    // GameMaker
    if (['.yy', '.yyp'].includes(ext)) {
        return new GameMakerImporter();
    }
    // Spine
    if (ext === '.skel' || ext === '.atlas' || name.endsWith('.spine.json')) {
        return new SpineImporter();
    }
    // DragonBones
    if (name.endsWith('_ske.json') || name.endsWith('_tex.json')) {
        return new DragonBonesImporter();
    }
    // Live2D
    if (name.endsWith('.model3.json') ||
        ext === '.moc3' ||
        name.endsWith('.physics3.json') ||
        name.endsWith('.pose3.json') ||
        name.endsWith('.exp3.json') ||
        name.endsWith('.motion3.json')) {
        return new Live2DImporter();
    }
    // Spriter
    if (['.scml', '.scon'].includes(ext)) {
        return new SpriterImporter();
    }
    return null;
}
/**
 * Check if a file can be imported
 */
function canImport(filePath) {
    return getImporterForFile(filePath) !== null;
}
/**
 * Get all supported file extensions
 */
function getSupportedExtensions() {
    return [
        // Native
        '.ndg',
        '.ndgp',
        '.ndga',
        // Unity
        '.unity',
        '.prefab',
        // Godot
        '.tscn',
        '.tres',
        // Tiled
        '.tmx',
        '.tmj',
        '.tsx',
        '.tsj',
        // LDtk
        '.ldtk',
        '.ldtkl',
        // Aseprite
        '.aseprite',
        '.ase',
        // OGMO
        '.ogmo',
        // RPG Maker
        '.json', // Map*.json
        // GameMaker
        '.yy',
        '.yyp',
        // Spine
        '.skel',
        '.atlas',
        // DragonBones
        '_ske.json',
        '_tex.json',
        // Live2D
        '.model3.json',
        '.moc3',
        '.physics3.json',
        '.pose3.json',
        '.exp3.json',
        '.motion3.json',
        // Spriter
        '.scml',
        '.scon',
    ];
}
/**
 * Get supported formats info
 */
function getSupportedFormats() {
    return [
        {
            name: 'Nice2Dev',
            type: 'native',
            extensions: ['.ndg', '.ndgp', '.ndga'],
            description: 'Native scene format with full feature support',
        },
        {
            name: 'Unity',
            type: 'unity',
            extensions: ['.unity', '.prefab'],
            description: 'Unity scene and prefab files',
        },
        {
            name: 'Godot',
            type: 'godot',
            extensions: ['.tscn', '.tres'],
            description: 'Godot 4.x scene and resource files',
        },
        {
            name: 'Tiled',
            type: 'tiled',
            extensions: ['.tmx', '.tmj', '.tsx', '.tsj'],
            description: 'Tiled Map Editor files',
        },
        {
            name: 'LDtk',
            type: 'ldtk',
            extensions: ['.ldtk', '.ldtkl'],
            description: 'LDtk Level Designer Toolkit files',
        },
        {
            name: 'Aseprite',
            type: 'aseprite',
            extensions: ['.aseprite', '.ase'],
            description: 'Aseprite sprite and animation files',
        },
        {
            name: 'OGMO',
            type: 'ogmo',
            extensions: ['.ogmo'],
            description: 'OGMO Editor 3 level files',
        },
        {
            name: 'RPG Maker',
            type: 'rpgmaker',
            extensions: ['Map*.json', 'Tilesets.json'],
            description: 'RPG Maker MV/MZ map files',
        },
        {
            name: 'GameMaker',
            type: 'gamemaker',
            extensions: ['.yy', '.yyp'],
            description: 'GameMaker Studio 2 room files',
        },
        {
            name: 'Spine',
            type: 'spine',
            extensions: ['.json', '.skel', '.atlas'],
            description: 'Spine skeletal animation files',
        },
        {
            name: 'DragonBones',
            type: 'dragonbones',
            extensions: ['*_ske.json', '*_tex.json'],
            description: 'DragonBones skeletal animation files',
        },
        {
            name: 'Live2D',
            type: 'live2d',
            extensions: ['.model3.json', '.moc3', '.physics3.json', '.motion3.json'],
            description: 'Live2D Cubism model files',
        },
        {
            name: 'Spriter',
            type: 'spriter',
            extensions: ['.scml', '.scon'],
            description: 'Spriter Pro animation files',
        },
    ];
}

export { AsepriteImporter, DragonBonesImporter, GameMakerImporter, GodotSceneImporter, LDtkImporter, Live2DImporter, NdgImporter, OgmoImporter, RPGMakerImporter, SpineImporter, SpriterImporter, TiledMapImporter, UnitySceneImporter, canImport, createImporter, createNativeImporter, getImporterForFile, getSupportedExtensions, getSupportedFormats };
//# sourceMappingURL=index.js.map
