/**
 * @file GameMakerImporter.ts
 * @description GameMaker Studio 2 Room Importer
 * PRO-1.3: Scene Format Interoperability
 *
 * Supports GameMaker Studio 2 .yy format (JSON-based).
 *
 * File Types:
 * - *.yy - Room, object, sprite, script files
 * - *.yyp - Project file
 */
import { SceneImporter, ImportOptions, ImportResult, ParsedScene, ImportError } from './SceneImporter';
/** GameMaker Resource Reference */
export interface GMResourceRef {
    name: string;
    path: string;
}
/** GameMaker Resource ID */
export interface GMId {
    name: string;
    path: string;
}
/** GameMaker Color Format */
export type GMColor = number;
/** GameMaker Room */
export interface GMRoom {
    resourceType: 'GMRoom';
    resourceVersion: string;
    name: string;
    roomSettings: GMRoomSettings;
    viewSettings: GMViewSettings;
    physicsSettings: GMPhysicsSettings;
    parent: GMResourceRef;
    layers: GMLayerInstance[];
    instanceCreationOrder: GMResourceRef[];
    creationCodeFile: string;
    inheritCode: boolean;
    inheritCreationOrder: boolean;
    inheritLayers: boolean;
    isDnd: boolean;
    volume: number;
    inheritRoomSettings?: boolean;
    inheritViewSettings?: boolean;
    inheritPhysicsSettings?: boolean;
    tags?: string[];
}
/** GameMaker Room Settings */
export interface GMRoomSettings {
    Width: number;
    Height: number;
    inheritRoomSettings: boolean;
    persistent: boolean;
}
/** GameMaker View Settings */
export interface GMViewSettings {
    inheritViewSettings: boolean;
    enableViews: boolean;
    clearViewBackground: boolean;
    clearDisplayBuffer: boolean;
}
/** GameMaker Physics Settings */
export interface GMPhysicsSettings {
    inheritPhysicsSettings: boolean;
    PhysicsWorld: boolean;
    PhysicsWorldGravityX: number;
    PhysicsWorldGravityY: number;
    PhysicsWorldPixToMetres: number;
}
/** Base GameMaker Layer */
export interface GMLayerBase {
    resourceType: string;
    resourceVersion: string;
    name: string;
    depth: number;
    visible: boolean;
    hspeed: number;
    vspeed: number;
    x: number;
    y: number;
    effectEnabled: boolean;
    effectType: string | null;
    gridX: number;
    gridY: number;
    layers: GMLayerInstance[];
    hierarchyFrozen: boolean;
    inheritLayerDepth: boolean;
    inheritLayerSettings: boolean;
    inheritSubLayers: boolean;
    inheritVisibility: boolean;
    userdefinedDepth: boolean;
    properties?: GMLayerProperty[];
}
export type GMLayerInstance = GMInstanceLayer | GMTileLayer | GMBackgroundLayer | GMAssetLayer | GMPathLayer | GMEffectLayer | GMFolderLayer;
/** GameMaker Instance Layer */
export interface GMInstanceLayer extends GMLayerBase {
    resourceType: 'GMRLayer';
    instances: GMRoomInstance[];
}
/** GameMaker Tile Layer */
export interface GMTileLayer extends GMLayerBase {
    resourceType: 'GMRTileLayer';
    tilesetId: GMResourceRef | null;
    tiles: GMTileData;
    x: number;
    y: number;
}
/** GameMaker Tile Data */
export interface GMTileData {
    TileDataFormat: number;
    SerialiseWidth: number;
    SerialiseHeight: number;
    TileCompressedData: number[];
    TileSerialiseData: number[];
}
/** GameMaker Background Layer */
export interface GMBackgroundLayer extends GMLayerBase {
    resourceType: 'GMRBackgroundLayer';
    spriteId: GMResourceRef | null;
    colour: GMColor;
    stretch: boolean;
    htiled: boolean;
    vtiled: boolean;
    userdefinedAnimFPS: boolean;
    animationFPS: number;
    animationSpeedType: number;
}
/** GameMaker Asset Layer */
export interface GMAssetLayer extends GMLayerBase {
    resourceType: 'GMRAssetLayer';
    assets: GMRoomAsset[];
}
/** GameMaker Path Layer */
export interface GMPathLayer extends GMLayerBase {
    resourceType: 'GMRPathLayer';
    pathId: GMResourceRef | null;
    colour: GMColor;
}
/** GameMaker Effect Layer */
export interface GMEffectLayer extends GMLayerBase {
    resourceType: 'GMREffectLayer';
}
/** GameMaker Folder Layer */
export interface GMFolderLayer extends GMLayerBase {
    resourceType: 'GMRLayer';
    instances?: never;
}
/** GameMaker Room Instance */
export interface GMRoomInstance {
    resourceType: 'GMRInstance';
    resourceVersion: string;
    name: string;
    objectId: GMResourceRef;
    x: number;
    y: number;
    scaleX: number;
    scaleY: number;
    rotation: number;
    colour: GMColor;
    imageIndex: number;
    imageSpeed: number;
    inheritCode: boolean;
    inheritedItemId: GMResourceRef | null;
    inheritItemSettings: boolean;
    isDnd: boolean;
    frozen: boolean;
    ignore: boolean;
    creationCode: string;
    properties: GMInstanceProperty[];
    tags?: string[];
}
/** GameMaker Room Asset */
export interface GMRoomAsset {
    resourceType: 'GMRSpriteGraphic' | 'GMRSequenceGraphic' | 'GMRParticleGraphic';
    resourceVersion: string;
    name: string;
    spriteId?: GMResourceRef;
    sequenceId?: GMResourceRef;
    headPosition: number;
    x: number;
    y: number;
    scaleX: number;
    scaleY: number;
    rotation: number;
    colour: GMColor;
    animationSpeed: number;
    animationSpeedType: number;
    ignore: boolean;
    frozen: boolean;
    inheritedItemId: GMResourceRef | null;
    inheritItemSettings: boolean;
    tags?: string[];
}
/** GameMaker Instance Property */
export interface GMInstanceProperty {
    propertyId: GMResourceRef;
    objectId: GMResourceRef;
    value: string;
}
/** GameMaker Layer Property */
export interface GMLayerProperty {
    propertyId: GMResourceRef;
    value: string;
}
/** GameMaker Object */
export interface GMObject {
    resourceType: 'GMObject';
    resourceVersion: string;
    name: string;
    spriteId: GMResourceRef | null;
    solid: boolean;
    visible: boolean;
    managed: boolean;
    spriteMaskId: GMResourceRef | null;
    persistent: boolean;
    parentObjectId: GMResourceRef | null;
    physicsObject: boolean;
    physicsSensor: boolean;
    physicsShape: number;
    physicsGroup: number;
    physicsDensity: number;
    physicsRestitution: number;
    physicsLinearDamping: number;
    physicsAngularDamping: number;
    physicsFriction: number;
    physicsStartAwake: boolean;
    physicsKinematic: boolean;
    physicsShapePoints: GMPhysicsPoint[];
    eventList: GMEvent[];
    properties: GMObjectProperty[];
    overriddenProperties: GMObjectProperty[];
    parent: GMResourceRef;
}
/** GameMaker Physics Point */
export interface GMPhysicsPoint {
    x: number;
    y: number;
}
/** GameMaker Event */
export interface GMEvent {
    resourceType: 'GMEvent';
    resourceVersion: string;
    isDnD: boolean;
    eventNum: number;
    eventType: number;
    collisionObjectId?: GMResourceRef;
    parent: GMResourceRef;
}
/** GameMaker Object Property */
export interface GMObjectProperty {
    resourceType: 'GMObjectProperty';
    resourceVersion: string;
    name: string;
    varType: number;
    value: string;
    rangeEnabled: boolean;
    rangeMin: number;
    rangeMax: number;
    listItems: string[];
    multiselect: boolean;
    filters: string[];
}
/** GameMaker Sprite */
export interface GMSprite {
    resourceType: 'GMSprite';
    resourceVersion: string;
    name: string;
    width: number;
    height: number;
    bbox_left: number;
    bbox_right: number;
    bbox_top: number;
    bbox_bottom: number;
    origin: number;
    xorigin: number;
    yorigin: number;
    frames: GMSpriteFrame[];
    sequence: GMSpriteSequence;
    layers: GMSpriteLayer[];
    nineSlice: GMNineSlice | null;
    parent: GMResourceRef;
    bboxMode: number;
    collisionKind: number;
    collisionTolerance: number;
    edgeFiltering: boolean;
    For3D: boolean;
    gridX: number;
    gridY: number;
    HTile: boolean;
    VTile: boolean;
    premultiplyAlpha: boolean;
    textureGroupId: GMResourceRef;
}
/** GameMaker Sprite Frame */
export interface GMSpriteFrame {
    resourceType: 'GMSpriteFrame';
    resourceVersion: string;
    name: string;
    compositeImage: GMResourceRef;
    images: GMResourceRef[];
}
/** GameMaker Sprite Sequence */
export interface GMSpriteSequence {
    resourceType: 'GMSequence';
    resourceVersion: string;
    name: string;
    playback: number;
    playbackSpeed: number;
    playbackSpeedType: number;
    length: number;
    tracks: unknown[];
    visibleRange: unknown | null;
    lockOrigin: boolean;
    showBackdrop: boolean;
    showBackdropImage: boolean;
    backdropImagePath: string;
    backdropImageOpacity: number;
    backdropWidth: number;
    backdropHeight: number;
    backdropXOffset: number;
    backdropYOffset: number;
    xorigin: number;
    yorigin: number;
    volume: number;
    events: unknown;
    moments: unknown;
}
/** GameMaker Sprite Layer */
export interface GMSpriteLayer {
    resourceType: 'GMImageLayer';
    resourceVersion: string;
    name: string;
    visible: boolean;
    isLocked: boolean;
    blendMode: number;
    opacity: number;
}
/** GameMaker Nine Slice */
export interface GMNineSlice {
    left: number;
    top: number;
    right: number;
    bottom: number;
    guideColour: GMColor[];
    highlightColour: GMColor;
    highlightStyle: number;
    enabled: boolean;
    tileMode: number[];
}
export declare class GameMakerImporter extends SceneImporter {
    private objects;
    private sprites;
    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 isRoomFile;
    private isSpriteFile;
    private isObjectFile;
    private convertRoomToScene;
    private convertRoomToParsed;
    private convertLayer;
    private convertLayerToParsed;
    private convertInstance;
    private convertInstanceToParsed;
    private convertTileLayer;
    private decompressTileData;
    private convertBackgroundLayer;
    private convertAsset;
    private convertSpriteToAsset;
    private extractAssetsFromLayers;
    private colorToHex;
    private readFile;
}
export declare function createGameMakerImporter(): GameMakerImporter;
