/**
 * @file SceneImporter.ts
 * @description Base infrastructure for importing scenes from external game engine formats
 * PRO-1.3: Scene Format Interoperability
 *
 * Supports importing from:
 * - Unity (.unity, .prefab)
 * - Godot (.tscn, .tres)
 * - Tiled (.tmx, .tsx)
 * - LDtk (.ldtk, .ldtkl)
 * - Aseprite (.aseprite, .ase)
 * - OGMO (.ogmo, .json)
 * - GameMaker (.yy)
 * - Spine (.json, .atlas)
 * - DragonBones (.json)
 */
import type { NiceScene, NiceEntity, NiceAsset, NiceProject } from '../export/PlatformExporter';
export type ImportSourceType = 'unity' | 'godot' | 'tiled' | 'ldtk' | 'aseprite' | 'ogmo' | 'gamemaker' | 'rpgmaker' | 'spine' | 'dragonbones' | 'live2d' | 'spriter';
export interface ImportSourceInfo {
    type: ImportSourceType;
    name: string;
    description: string;
    extensions: string[];
    supportsAnimation: boolean;
    supportsLayers: boolean;
    supportsTilemap: boolean;
}
export declare const IMPORT_SOURCES: Record<ImportSourceType, ImportSourceInfo>;
export interface ImportOptions {
    /** Source directory/file path */
    sourcePath: string;
    /** Target project to import into (optional, creates new if not provided) */
    targetProject?: NiceProject;
    /** Import assets (textures, audio, etc.) */
    importAssets?: boolean;
    /** Import scripts (convert to Nice2Dev format) */
    importScripts?: boolean;
    /** Preserve original structure */
    preserveStructure?: boolean;
    /** Convert coordinates (some engines use different origins) */
    convertCoordinates?: boolean;
    /** Scale factor for coordiantes */
    scaleFactor?: number;
    /** Import animations */
    importAnimations?: boolean;
    /** Import tilemap data */
    importTilemaps?: boolean;
    /** Import physics data */
    importPhysics?: boolean;
    /** Resolve asset dependencies */
    resolveDependencies?: boolean;
    /** Custom options specific to source format */
    customOptions?: Record<string, unknown>;
}
export interface ImportResult {
    success: boolean;
    project?: NiceProject;
    scenes: NiceScene[];
    entities: NiceEntity[];
    assets: NiceAsset[];
    errors: ImportError[];
    warnings: ImportWarning[];
    statistics: ImportStatistics;
}
export interface ImportError {
    code: string;
    message: string;
    file?: string;
    line?: number;
    fatal: boolean;
}
export interface ImportWarning {
    code: string;
    message: string;
    file?: string;
    suggestion?: string;
}
export interface ImportStatistics {
    scenesImported: number;
    entitiesImported: number;
    assetsImported: number;
    animationsImported: number;
    tilemapsImported: number;
    scriptsConverted: number;
    importDurationMs: number;
}
/** Generic parsed scene structure */
export interface ParsedScene {
    name: string;
    width?: number;
    height?: number;
    backgroundColor?: string;
    layers: ParsedLayer[];
    entities: ParsedEntity[];
    properties: Record<string, unknown>;
}
export interface ParsedLayer {
    name: string;
    type: 'tile' | 'object' | 'image' | 'group';
    visible: boolean;
    opacity: number;
    offsetX: number;
    offsetY: number;
    parallaxX?: number;
    parallaxY?: number;
    zIndex: number;
    data?: ParsedTileData;
    tileData?: ParsedTileData;
    objects?: ParsedEntity[];
    properties: Record<string, unknown>;
}
export interface ParsedTileData {
    width: number;
    height: number;
    tileWidth: number;
    tileHeight: number;
    tiles: number[];
    tilesetRef?: string;
}
export interface ParsedEntity {
    id: string;
    name: string;
    type: string;
    x: number;
    y: number;
    width: number;
    height: number;
    rotation: number;
    scaleX: number;
    scaleY: number;
    visible: boolean;
    components: ParsedComponent[];
    children: ParsedEntity[];
    properties: Record<string, unknown>;
}
export interface ParsedComponent {
    type: string;
    data: Record<string, unknown>;
}
export interface ParsedTileset {
    name: string;
    imagePath: string;
    tileWidth: number;
    tileHeight: number;
    tileCount: number;
    columns: number;
    margin: number;
    spacing: number;
    tiles?: ParsedTileInfo[];
    properties: Record<string, unknown>;
}
export interface ParsedTileInfo {
    id: number;
    type?: string;
    properties?: Record<string, unknown>;
    animation?: ParsedTileAnimation[];
    collision?: ParsedCollisionShape[];
}
export interface ParsedTileAnimation {
    tileId: number;
    duration: number;
}
export interface ParsedCollisionShape {
    type: 'rectangle' | 'ellipse' | 'polygon' | 'polyline';
    x: number;
    y: number;
    width?: number;
    height?: number;
    points?: {
        x: number;
        y: number;
    }[];
}
export interface ParsedAnimation {
    name: string;
    frames: ParsedAnimationFrame[];
    loop: boolean;
    events?: ParsedAnimationEvent[];
}
export interface ParsedAnimationFrame {
    index: number;
    duration: number;
    x?: number;
    y?: number;
    width?: number;
    height?: number;
    offsetX?: number;
    offsetY?: number;
}
export interface ParsedAnimationEvent {
    frame: number;
    name: string;
    data?: Record<string, unknown>;
}
export interface ParsedAsset {
    id: string;
    name: string;
    type: 'texture' | 'audio' | 'font' | 'shader' | 'script' | 'data' | 'animation' | 'tileset';
    path: string;
    data?: ArrayBuffer | string;
    metadata: Record<string, unknown>;
}
export interface ParsedSpriteSheet {
    name: string;
    imagePath: string;
    frames: ParsedSpriteFrame[];
    animations?: Record<string, ParsedAnimation>;
}
export interface ParsedSpriteFrame {
    name: string;
    x: number;
    y: number;
    width: number;
    height: number;
    pivotX?: number;
    pivotY?: number;
    trimmed?: boolean;
    sourceWidth?: number;
    sourceHeight?: number;
    offsetX?: number;
    offsetY?: number;
}
export declare abstract class SceneImporter {
    protected sourceType: ImportSourceType;
    protected options: ImportOptions;
    protected errors: ImportError[];
    protected warnings: ImportWarning[];
    constructor(sourceType: ImportSourceType);
    /** Get importer source info */
    getSourceInfo(): ImportSourceInfo;
    /** Check if this importer can handle the given file */
    canHandle(filePath: string): boolean;
    /** Import scenes/data from source */
    abstract import(options: ImportOptions): Promise<ImportResult>;
    /** Parse a single file (for preview or partial import) */
    abstract parseFile(content: string | ArrayBuffer, filePath: string): Promise<ParsedScene | ParsedAsset | null>;
    /** Validate source before import */
    abstract validate(sourcePath: string): Promise<ImportError[]>;
    protected addError(code: string, message: string, file?: string, line?: number, fatal?: boolean): void;
    protected addWarning(code: string, message: string, file?: string, suggestion?: string): void;
    protected clearMessages(): void;
    /** Convert parsed scene to Nice2Dev scene */
    protected convertToNiceScene(parsed: ParsedScene): NiceScene;
    /** Alias for convertToNiceScene (used by subclass importers) */
    protected convertParsedToNiceScene(parsed: ParsedScene): NiceScene;
    /** Flatten layer-based entities into single list */
    protected flattenEntities(entities: ParsedEntity[], layers: ParsedLayer[]): ParsedEntity[];
    /** Convert parsed entity to Nice2Dev entity */
    protected convertToNiceEntity(parsed: ParsedEntity): NiceEntity;
    /** Convert a component from source format to Nice2Dev format */
    protected convertComponent(parsed: ParsedComponent): NiceEntity['components'][0];
    /** Convert parsed asset to Nice2Dev asset */
    protected convertToNiceAsset(parsed: ParsedAsset): NiceAsset;
    /** Generate unique ID */
    protected generateId(): string;
    /** Create empty import result */
    protected createEmptyResult(): ImportResult;
    /** Create successful result */
    protected createResult(scenes: NiceScene[], assets: NiceAsset[], startTime: number, project?: NiceProject): ImportResult;
}
/** Parse YAML content (basic implementation) */
export declare function parseYAML(content: string): unknown;
/** Parse XML content to object */
export declare function parseXML(content: string): XMLNode;
export interface XMLNode {
    name: string;
    attributes: Record<string, string>;
    children: XMLNode[];
    text: string;
}
/** Detect import source type from file */
export declare function detectSourceType(filePath: string, content?: string): ImportSourceType | null;
/** Get all available importers */
export declare function getAvailableImporters(): ImportSourceInfo[];
/** Check if an importer exists for the given source type */
export declare function hasImporter(sourceType: ImportSourceType): boolean;
