import { EntityId, EntityManager } from 'entix-ecs';
export { EntityId } from 'entix-ecs';

declare class Rotation {
    value: number;
    constructor(value?: number);
}
declare class Scale {
    value: Vector2;
    constructor(options?: ScaleOptions);
}
declare class Transform {
    globalPosition: GlobalPosition;
    rotation: Rotation;
    scale: Scale;
    constructor(options?: TransformOptions);
}
declare class Sprite {
    image: HTMLImageElement;
    width: number;
    height: number;
    alpha: number;
    rotation: number;
    layer: number;
    active: boolean;
    blocksInput: boolean;
    constructor(options: SpriteOptions);
}
declare class EntityActive {
    value: boolean;
    constructor(options?: EntityActiveOptions);
}
declare class Parent {
    value: EntityId | null;
    constructor(options?: ParentOptions);
}
declare class Children {
    value: EntityId[];
}
declare class Scene {
    name: string;
    onLoad: Function;
    onUnload: Function;
    constructor(options: SceneOptions);
}
declare class Shape {
    shape: ShapeType;
    color: string;
    outlineEnabled: boolean;
    outlineWidth: number;
    outlineColor: string;
    alpha: number;
    active: boolean;
    layer: number;
    blocksInput: boolean;
    constructor(options: ShapeOptions);
}
declare class Rectangle {
    width: number;
    height: number;
    centered: boolean;
    rotation: number;
    rounded: boolean;
    roundedRadius: number;
    constructor(options: RectangleOptions);
}
declare class Circle {
    radius: number;
    constructor(options: CircleOptions);
}
declare class Triangle {
    p1: Vector2;
    p2: Vector2;
    p3: Vector2;
    centered: boolean;
    rotation: number;
    constructor(options: TriangleOptions);
}
declare class Text {
    content: string;
    size: number;
    color: string;
    outlineEnabled: boolean;
    outlineWidth: number;
    outlineColor: string;
    alpha: number;
    active: boolean;
    layer: number;
    rotation: number;
    style: string;
    maxWidth: number;
    constructor(options: TextOptions);
}
declare class Button {
    pressArea: Vector2;
    onJustPressed: Function;
    onPress: Function;
    onJustReleased: Function;
    onJustHovered: Function;
    onHovered: Function;
    onHoveredReleased: Function;
    showPressArea: boolean;
    pressAreaShowColor: string;
    layer: number;
    active: boolean;
    changeCursorToPointer: boolean;
    isHovered: boolean;
    constructor(options: ButtonOptions);
}

type EngineOptions = {
    canvas?: HTMLCanvasElement;
    canvasWidth?: number;
    canvasHeight?: number;
    resources?: AssetResources;
};
type AssetResources = {
    images_JSON_path?: string;
    audio_JSON_path?: string;
    jsons?: Record<string, string>;
};
type LoadedResources = {
    imagesData?: Record<string, HTMLImageElement>;
    audioData?: Record<string, HTMLAudioElement>;
    customJsonData?: Record<string, any>;
};
type Vector2 = {
    x: number;
    y: number;
};
type GlobalPosition = {
    position: Vector2;
};
type RotationOptions = {
    value?: number;
};
type ScaleOptions = {
    value?: Vector2;
};
type TransformOptions = {
    globalPosition?: Vector2;
    localPosition?: Vector2;
    rotation?: RotationOptions;
    scale?: ScaleOptions;
};
type SpriteOptions = {
    image: HTMLImageElement;
    width: number;
    height: number;
    alpha?: number;
    rotation?: number;
    layer?: number;
    active?: boolean;
    blocksInput?: boolean;
};
type EntityActiveOptions = {
    value?: boolean;
};
type ParentOptions = {
    value?: EntityId;
};
type SceneOptions = {
    name: string;
    onLoad?: Function;
    onUnload?: Function;
};
type ShapeType = Rectangle | Circle | Triangle;
type ShapeOptions = {
    shape: ShapeType;
    color?: string;
    outlineEnabled?: boolean;
    outlineWidth?: number;
    outlineColor?: string;
    alpha?: number;
    active?: boolean;
    layer?: number;
    blocksInput?: false;
};
type RectangleOptions = {
    width?: number;
    height?: number;
    centered?: boolean;
    rotation?: number;
    rounded?: boolean;
    roundRadius?: number;
};
type CircleOptions = {
    radius?: number;
};
type TriangleOptions = {
    p1?: Vector2;
    p2?: Vector2;
    p3?: Vector2;
    centered?: boolean;
    rotation?: number;
};
type TextOptions = {
    content?: string;
    size?: number;
    color?: string;
    outlineEnabled?: boolean;
    outlineWidth?: number;
    outlineColor?: string;
    alpha?: number;
    active?: boolean;
    layer?: number;
    rotation?: number;
    style?: string;
    maxWidth?: number;
};
type ButtonOptions = {
    pressArea?: Vector2;
    onJustPressed?: Function;
    onPress?: Function;
    onReleased?: Function;
    onJustHovered?: Function;
    onHovered?: Function;
    onHoveredReleased?: Function;
    showPressArea?: boolean;
    pressAreaShowColor?: string;
    layer?: number;
    active?: boolean;
    changeCursorToPointer?: boolean;
};

declare class Input {
    private engine;
    private position;
    private justPressed;
    private pressed;
    private justReleased;
    constructor(engine: Engine);
    start(): void;
    update(): void;
    updatePos(clientX: number, clientY: number): void;
    addListeners(): void;
    resetStates(): void;
    isOver(x: number, y: number, w: number, h: number): boolean;
    getPosition(): Vector2;
    getJustPressed(): boolean;
    getPressed(): boolean;
    getJustReleased(): boolean;
}

declare class Engine {
    private canvas;
    private ctx;
    private canvasWidth;
    private canvasHeight;
    private canvasDefWidth;
    private canvasDefHeight;
    private entityManager;
    private lastFrameTime;
    private deltaTime;
    private updateFunctions;
    private resources;
    private assetLoader;
    private loadedResources;
    private startFunctions;
    private sceneEntities;
    private currentSceneId;
    private input;
    constructor(options: EngineOptions);
    init(options: EngineOptions): void;
    start(): Promise<void>;
    update(timeStamp: number): void;
    getCanvas(): HTMLCanvasElement;
    getCtx(): CanvasRenderingContext2D;
    getEntityManager(): EntityManager;
    getDeltaTime(): number;
    getImage(key: string): HTMLImageElement;
    getAudio(key: string): HTMLAudioElement;
    getJSON<T = any>(key: string): T;
    getSceneByName(name: string): EntityId | null;
    getInput(): Input;
    addUpdateFunction(fn: Function): void;
    removeUpdateFunction(fn: Function): void;
    addStartFunction(fn: Function): void;
    removeStartFunction(fn: Function): void;
    drawSprite(transform: Transform, sprite: Sprite): void;
    isEntityActive(id: EntityId): boolean;
    addScene(id: EntityId): void;
    loadScene(id: EntityId): void;
    addParent(id: EntityId, parentId: EntityId): void;
    isEntityBlockingInput(x: number, y: number, layer: number): boolean;
}

declare class AssetLoader {
    private resources;
    constructor(resources?: AssetResources);
    private fetchData;
    private loadImages;
    private loadAudio;
    loadAll(): Promise<{
        imagesData: Record<string, HTMLImageElement>;
        audioData: Record<string, HTMLAudioElement>;
        customJsonData: Record<string, any>;
    }>;
}

declare class EntityTemplates {
    private engine;
    private em;
    constructor(engine: Engine);
    createEmptyEntity(parent?: EntityId): EntityId;
    createSpriteEntity(image: HTMLImageElement, width: number, height: number, parent?: EntityId): EntityId;
    createSceneEntity(name?: string): EntityId;
    createRectangleEntity(width: number, height: number, parent?: EntityId): EntityId;
    createCircleEntity(radius: number, parent?: EntityId): number;
    createTriangleEntity(p1: Vector2, p2: Vector2, p3: Vector2, parent?: EntityId): EntityId;
    createTextEntity(content: string, parent?: EntityId): EntityId;
    createRectButtonEntity(width: number, height: number, textContent?: string, parent?: EntityId): EntityId;
    createTexturedButtonEntity(image: HTMLImageElement, width: number, height: number, parent?: EntityId): EntityId;
}

declare function renderingSystem(engine: Engine): void;

export { AssetLoader, type AssetResources, Button, type ButtonOptions, Children, Circle, type CircleOptions, Engine, type EngineOptions, EntityActive, type EntityActiveOptions, EntityTemplates, type GlobalPosition, type LoadedResources, Parent, type ParentOptions, Rectangle, type RectangleOptions, Rotation, type RotationOptions, Scale, type ScaleOptions, Scene, type SceneOptions, Shape, type ShapeOptions, type ShapeType, Sprite, type SpriteOptions, Text, type TextOptions, Transform, type TransformOptions, Triangle, type TriangleOptions, type Vector2, renderingSystem };
