/**
 * import.ts — Main import pipeline: ContentPack / ExportResult / WorldProject → WorldProject
 *
 * ## Import Pipeline Architecture
 *
 * The import pipeline follows a three-stage process:
 *
 * 1. **Format Detection** (`detectImportFormat`)
 *    Inspects the shape of parsed JSON to determine which import format it matches.
 *    Supported formats: `world-project`, `content-pack`, `export-result`, `project-bundle`.
 *
 * 2. **Conversion** (per-domain converter functions)
 *    Each domain (zones, entities, items, dialogues, etc.) has a dedicated import
 *    converter in its own module (e.g. `import-zones.ts`, `import-entities.ts`).
 *    Converters transform engine-format data back into WorldProject domain objects
 *    and produce {@link FidelityEntry} records documenting any data loss.
 *
 * 3. **Assembly** (`importProject` / `importFromContentPack` / `importFromExportResult`)
 *    Combines converted domains into a complete {@link WorldProject}, infers missing
 *    metadata (mode, connections, spawn points), runs validation, and builds the
 *    {@link FidelityReport}.
 *
 * ## How to Add a New Import Format
 *
 * 1. Add the new format name to the {@link ImportFormat} union type.
 * 2. Add a detection clause in {@link detectImportFormat} that identifies the new
 *    format by its structural shape (check for unique top-level keys).
 * 3. Write a converter function (e.g. `importFromMyFormat`) that accepts the raw
 *    data and returns an {@link ImportResult}. Use per-domain importers where possible.
 * 4. Add a branch in {@link importProject} that dispatches to your converter.
 * 5. Re-export any new public functions/types from `index.ts`.
 *
 * ## Extension Points
 *
 * - {@link detectImportFormat} — Add detection logic for new shapes.
 * - Per-domain converters (`importZones`, `importEntities`, etc.) — Reuse or extend
 *   for formats that share the engine's domain schemas.
 * - {@link importProject} — The main entry point; add dispatch branches here.
 * - {@link ImportFormat} — The union type listing all recognized formats.
 * - {@link FidelityEntry} / {@link FidelityDomain} (in `fidelity.ts`) — Extend with
 *   new domains if your format introduces data categories not yet tracked.
 *
 * @module import
 */
import type { WorldProject, AuthoringMode, ValidationError } from '@world-forge/schema';
import type { ContentPack, ExportResult } from './export.js';
import type { PackMetadata } from '@ai-rpg-engine/pack-registry';
import type { FidelityReport } from './fidelity.js';
export type ImportFormat = 'world-project' | 'content-pack' | 'export-result' | 'project-bundle';
export interface ImportResult {
    success: true;
    project: WorldProject;
    format: ImportFormat;
    warnings: string[];
    lossless: boolean;
    fidelityReport: FidelityReport;
}
export interface ImportError {
    success: false;
    message: string;
    errors: ValidationError[];
}
/** @internal Exported for drift-guard tests only (AIR-A-005/006). */
export declare const REVERSE_GENRE: Record<string, string>;
/** @internal Exported for drift-guard tests only (AIR-A-005/006). */
export declare const REVERSE_DIFFICULTY: Record<string, string>;
/** Infer authoring mode from project content when mode is not set. */
export declare function inferMode(project: WorldProject): AuthoringMode;
/** Detect the format of parsed JSON data. */
export declare function detectImportFormat(data: unknown): ImportFormat | null;
/** Import from any supported format. */
export declare function importProject(data: unknown): ImportResult | ImportError;
/** Import from an ExportResult (has contentPack + manifest + packMeta). */
export declare function importFromExportResult(result: ExportResult, projectName?: string): ImportResult;
/** Import from a ContentPack (lossy — zones lose grid positions, entities lose zones). */
export declare function importFromContentPack(pack: ContentPack, projectName?: string, meta?: PackMetadata): ImportResult;
//# sourceMappingURL=import.d.ts.map