/**
 * photoOverlays.ts — Overlay / layer engine for PhotoEditor.
 *
 * Handles emojis, text, shapes, freehand drawing strokes, and decorative frames
 * as positioned layers on top of the base (filtered) image.
 *
 * All positions use **fractional coordinates** (0 … 1) relative to the rendered
 * canvas so overlays survive crop / resize changes.
 */
import type { AdjustmentValues } from "./photoFilters";
export type OverlayType = "emoji" | "text" | "shape" | "drawing" | "frame";
export interface BaseOverlay {
    id: string;
    type: OverlayType;
    /** Centre X as fraction of canvas width  (0 … 1) */
    x: number;
    /** Centre Y as fraction of canvas height (0 … 1) */
    y: number;
    scaleX: number;
    scaleY: number;
    /** Degrees */
    rotation: number;
    /** 0 … 1 */
    opacity: number;
}
export interface EmojiOverlay extends BaseOverlay {
    type: "emoji";
    emoji: string;
    /** Base font size in px (before scale) */
    fontSize: number;
}
export interface TextOverlay extends BaseOverlay {
    type: "text";
    text: string;
    fontFamily: string;
    fontSize: number;
    color: string;
    bold: boolean;
    italic: boolean;
    outlineColor: string | null;
    outlineWidth: number;
    shadow: string | null;
    background: string | null;
    backgroundPadding: number;
}
export type ShapeKind = "rect" | "circle" | "triangle" | "star" | "heart" | "arrow" | "diamond" | "hexagon" | "cross" | "lightning";
export interface ShapeOverlay extends BaseOverlay {
    type: "shape";
    shapeKind: ShapeKind;
    /** Base width / height in px */
    width: number;
    height: number;
    fillColor: string | null;
    strokeColor: string;
    strokeWidth: number;
}
export interface DrawingStroke {
    /** Array of [x, y] fractions (0 … 1) */
    points: [number, number][];
    color: string;
    width: number;
    opacity: number;
}
export interface DrawingOverlay extends BaseOverlay {
    type: "drawing";
    strokes: DrawingStroke[];
}
export type FrameStyleId = "simple" | "double" | "rounded" | "polaroid" | "film" | "vintage" | "ornate" | "shadow" | "neon" | "torn";
export interface FrameOverlay extends BaseOverlay {
    type: "frame";
    frameStyle: FrameStyleId;
    color: string;
    /** Border thickness as fraction of min(w,h) */
    thickness: number;
}
export type Overlay = EmojiOverlay | TextOverlay | ShapeOverlay | DrawingOverlay | FrameOverlay;
export interface EmojiCategory {
    id: string;
    label: string;
    icon: string;
    emojis: string[];
}
export declare const EMOJI_CATALOG: EmojiCategory[];
export interface ShapeDef {
    id: ShapeKind;
    label: string;
    icon: string;
}
export declare const SHAPE_CATALOG: ShapeDef[];
export interface FrameStyleDef {
    id: FrameStyleId;
    label: string;
    icon: string;
}
export declare const FRAME_CATALOG: FrameStyleDef[];
export declare function generateOverlayId(): string;
/** Render all overlays to a canvas context. */
export declare function renderAllOverlays(ctx: CanvasRenderingContext2D, overlays: Overlay[], w: number, h: number): void;
export declare function renderLiveStroke(ctx: CanvasRenderingContext2D, points: [number, number][], color: string, width: number, canvasW: number, canvasH: number): void;
/**
 * Returns `true` when the point (px, py) in canvas-fraction space
 * hits the bounding box of the overlay (ignoring rotation).
 */
export declare function hitTestOverlay(ov: Overlay, px: number, py: number, _w: number, _h: number): boolean;
export declare function createEmojiOverlay(emoji: string, canvasW: number, canvasH: number): EmojiOverlay;
export declare function createTextOverlay(text?: string): TextOverlay;
export declare function createShapeOverlay(kind: ShapeKind): ShapeOverlay;
export declare function createDrawingOverlay(): DrawingOverlay;
export declare function createFrameOverlay(style: FrameStyleId, color?: string): FrameOverlay;
export interface PhotoEditorState {
    filter: string;
    filterIntensity: number;
    adjustments: AdjustmentValues;
    rotation: number;
    flipH: boolean;
    flipV: boolean;
    cropRect: {
        x: number;
        y: number;
        w: number;
        h: number;
    } | null;
    overlays: Overlay[];
}
export declare function serializeEditorState(state: PhotoEditorState): string;
export declare function deserializeEditorState(json: string): PhotoEditorState | null;
