/**
 * @file DragonBonesImporter.ts
 * @description DragonBones Skeletal Animation Importer
 * PRO-1.3: Scene Format Interoperability
 *
 * DragonBones is a free, open-source 2D skeletal animation tool.
 *
 * File Types:
 * - *_ske.json - Skeleton data
 * - *_tex.json - Texture atlas data
 * - *_tex.png - Texture image
 */
import { SceneImporter, ImportOptions, ImportResult, ParsedScene, ImportError } from './SceneImporter';
/** DragonBones Skeleton Data */
export interface DBSkeletonData {
    frameRate: number;
    name: string;
    version: string;
    compatibleVersion?: string;
    armature: DBArmature[];
}
/** DragonBones Armature */
export interface DBArmature {
    name: string;
    type?: 'Armature' | 'Stage' | 'MovieClip';
    frameRate?: number;
    aabb: DBAABB;
    bone: DBBone[];
    slot: DBSlot[];
    skin: DBSkin[];
    ik?: DBIKConstraint[];
    path?: DBPathConstraint[];
    animation: DBAnimation[];
    defaultActions?: DBAction[];
    canvas?: DBCanvas;
}
/** DragonBones AABB */
export interface DBAABB {
    x: number;
    y: number;
    width: number;
    height: number;
}
/** DragonBones Bone */
export interface DBBone {
    name: string;
    parent?: string;
    length?: number;
    transform?: DBTransform;
    inheritTranslation?: boolean;
    inheritRotation?: boolean;
    inheritScale?: boolean;
    inheritReflection?: boolean;
}
/** DragonBones Transform */
export interface DBTransform {
    x?: number;
    y?: number;
    skX?: number;
    skY?: number;
    scX?: number;
    scY?: number;
}
/** DragonBones Slot */
export interface DBSlot {
    name: string;
    parent: string;
    displayIndex?: number;
    color?: DBColor;
    blendMode?: 'normal' | 'add' | 'alpha' | 'darken' | 'difference' | 'erase' | 'hardlight' | 'invert' | 'layer' | 'lighten' | 'multiply' | 'overlay' | 'screen' | 'subtract';
}
/** DragonBones Color */
export interface DBColor {
    aM?: number;
    rM?: number;
    gM?: number;
    bM?: number;
    aO?: number;
    rO?: number;
    gO?: number;
    bO?: number;
}
/** DragonBones Skin */
export interface DBSkin {
    name: string;
    slot: DBSkinSlot[];
}
/** DragonBones Skin Slot */
export interface DBSkinSlot {
    name: string;
    display: DBDisplay[];
}
/** DragonBones Display */
export type DBDisplay = DBImageDisplay | DBMeshDisplay | DBArmatureDisplay | DBBoundingBoxDisplay | DBPathDisplay;
export interface DBDisplayBase {
    name: string;
    type?: 'image' | 'mesh' | 'armature' | 'boundingBox' | 'path';
    transform?: DBTransform;
}
export interface DBImageDisplay extends DBDisplayBase {
    type?: 'image';
    path?: string;
    pivot?: {
        x: number;
        y: number;
    };
}
export interface DBMeshDisplay extends DBDisplayBase {
    type: 'mesh';
    path?: string;
    width: number;
    height: number;
    vertices: number[];
    uvs: number[];
    triangles: number[];
    weights?: number[];
    slotPose?: number[];
    bonePose?: number[];
    edges?: number[];
    userEdges?: number[];
}
export interface DBArmatureDisplay extends DBDisplayBase {
    type: 'armature';
    path?: string;
    inheritAnimation?: boolean;
    actions?: DBAction[];
}
export interface DBBoundingBoxDisplay extends DBDisplayBase {
    type: 'boundingBox';
    subType?: 'rectangle' | 'ellipse' | 'polygon';
    width?: number;
    height?: number;
    vertices?: number[];
    color?: number;
}
export interface DBPathDisplay extends DBDisplayBase {
    type: 'path';
    closed?: boolean;
    constantSpeed?: boolean;
    vertices: number[];
    lengths?: number[];
}
/** DragonBones IK Constraint */
export interface DBIKConstraint {
    name: string;
    bone: string;
    target: string;
    chain?: number;
    bendPositive?: boolean;
    weight?: number;
}
/** DragonBones Path Constraint */
export interface DBPathConstraint {
    name: string;
    bones: string[];
    target: string;
    positionMode?: 'fixed' | 'percent';
    spacingMode?: 'fixed' | 'percent' | 'length';
    rotateMode?: 'tangent' | 'chain' | 'chainScale';
    position?: number;
    spacing?: number;
    rotateMix?: number;
    translateMix?: number;
}
/** DragonBones Animation */
export interface DBAnimation {
    name: string;
    duration: number;
    playTimes?: number;
    fadeInTime?: number;
    frame?: DBMainFrame[];
    bone?: DBBoneTimeline[];
    slot?: DBSlotTimeline[];
    ffd?: DBFFDTimeline[];
    ik?: DBIKTimeline[];
    zOrder?: DBZOrderFrame[];
}
/** DragonBones Main Frame (events) */
export interface DBMainFrame {
    duration: number;
    event?: string;
    events?: DBEvent[];
    actions?: DBAction[];
    sound?: string;
}
export interface DBEvent {
    name: string;
    bone?: string;
    ints?: number[];
    floats?: number[];
    strings?: string[];
}
export interface DBAction {
    type: 'play' | 'frame' | 'sound';
    name?: string;
}
/** DragonBones Bone Timeline */
export interface DBBoneTimeline {
    name: string;
    translateFrame?: DBTranslateFrame[];
    rotateFrame?: DBRotateFrame[];
    scaleFrame?: DBScaleFrame[];
    frame?: DBBoneFrame[];
}
export interface DBTranslateFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    x?: number;
    y?: number;
}
export interface DBRotateFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    rotate?: number;
    skew?: number;
}
export interface DBScaleFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    x?: number;
    y?: number;
}
export interface DBBoneFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    transform?: DBTransform;
}
/** DragonBones Slot Timeline */
export interface DBSlotTimeline {
    name: string;
    displayFrame?: DBDisplayFrame[];
    colorFrame?: DBColorFrame[];
    frame?: DBSlotFrame[];
}
export interface DBDisplayFrame {
    duration?: number;
    value?: number;
    actions?: DBAction[];
}
export interface DBColorFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    value?: DBColor;
}
export interface DBSlotFrame {
    duration?: number;
    tweenEasing?: number | null;
    displayIndex?: number;
    color?: DBColor;
    actions?: DBAction[];
}
/** DragonBones FFD Timeline (mesh deformation) */
export interface DBFFDTimeline {
    name: string;
    skin: string;
    slot: string;
    frame: DBFFDFrame[];
}
export interface DBFFDFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    offset?: number;
    vertices?: number[];
}
/** DragonBones IK Timeline */
export interface DBIKTimeline {
    name: string;
    frame: DBIKFrame[];
}
export interface DBIKFrame {
    duration?: number;
    tweenEasing?: number | null;
    curve?: number[];
    bendPositive?: boolean;
    weight?: number;
}
/** DragonBones Z-Order Frame */
export interface DBZOrderFrame {
    duration?: number;
    zOrder?: number[];
}
/** DragonBones Canvas */
export interface DBCanvas {
    x?: number;
    y?: number;
    width: number;
    height: number;
    color?: number;
}
/** DragonBones Texture Atlas Data */
export interface DBTextureAtlas {
    name: string;
    imagePath: string;
    width: number;
    height: number;
    SubTexture: DBSubTexture[];
}
export interface DBSubTexture {
    name: string;
    x: number;
    y: number;
    width: number;
    height: number;
    frameX?: number;
    frameY?: number;
    frameWidth?: number;
    frameHeight?: number;
}
export declare class DragonBonesImporter extends SceneImporter {
    private textureAtlas;
    constructor();
    canHandle(filePath: string): boolean;
    import(options: ImportOptions): Promise<ImportResult>;
    parseFile(content: string | ArrayBuffer, filePath: string): Promise<ParsedScene | null>;
    validate(sourcePath: string): Promise<ImportError[]>;
    private convertArmatureToScene;
    private convertArmatureToParsed;
    private createBoneHierarchy;
    private addSlotToEntity;
    private findBoneEntity;
    private convertAnimation;
    private convertColor;
    private readFile;
}
export declare function createDragonBonesImporter(): DragonBonesImporter;
