import { UniqueIdentifier } from '@dnd-kit/core';
import { Transformation as IKTransformation } from '@imagekit/javascript';
import { DEFAULT_FOCUS_OBJECTS } from './schema';
export interface Transformation {
    id: string;
    key: string;
    name: string;
    type: "transformation";
    value: IKTransformation;
}
export type RequiredMetadata = {
    requireSignedUrl: boolean;
};
export interface FileElement<Metadata extends RequiredMetadata = RequiredMetadata> {
    url: string;
    metadata: Metadata;
    imageDimensions: {
        width: number;
        height: number;
    } | null;
}
export type InputFileElement<Metadata extends RequiredMetadata = RequiredMetadata> = Omit<FileElement<Metadata>, "imageDimensions">;
export interface SignerRequest<Metadata extends RequiredMetadata = RequiredMetadata> {
    url: string;
    transformation: string;
    metadata: Metadata;
}
export type Signer<Metadata extends RequiredMetadata = RequiredMetadata> = (item: SignerRequest<Metadata>, controller?: AbortController) => Promise<string>;
interface InternalState {
    sidebarState: "none" | "type" | "config";
    selectedTransformationKey: string | null;
    transformationToEdit: {
        transformationId: string;
        position: "inplace";
    } | {
        position: "above" | "below";
        targetId: string;
    } | null;
}
export type FocusObjects = (typeof DEFAULT_FOCUS_OBJECTS)[number] | (string & {});
export interface EditorState<Metadata extends RequiredMetadata = RequiredMetadata> {
    currentImage: string | undefined;
    originalImageList: FileElement<Metadata>[];
    imageList: string[];
    transformations: Transformation[];
    visibleTransformations: Record<string, boolean>;
    showOriginal: boolean;
    signer?: Signer<Metadata>;
    signingImages: Record<string, boolean>;
    signingAbortControllers: Record<string, AbortController>;
    signedUrlCache: Record<string, string>;
    currentTransformKey: string;
    focusObjects?: ReadonlyArray<FocusObjects>;
    _internalState: InternalState;
}
export type EditorActions<Metadata extends RequiredMetadata = RequiredMetadata> = {
    initialize: (initialData?: {
        imageList?: Array<string | InputFileElement<Metadata>>;
        signer?: Signer<Metadata>;
        focusObjects?: ReadonlyArray<FocusObjects>;
    }) => void;
    destroy: () => void;
    setCurrentImage: (imageSrc: string | undefined) => void;
    setImageDimensions: (imageSrc: string, dimensions: {
        width: number;
        height: number;
    } | null) => void;
    addImage: (imageSrc: string | InputFileElement<Metadata>) => void;
    addImages: (imageSrcs: Array<string | InputFileElement<Metadata>>) => void;
    removeImage: (imageSrc: string) => void;
    setTransformations: (transformations: Omit<Transformation, "id">[]) => void;
    moveTransformation: (activeId: UniqueIdentifier, overId: UniqueIdentifier) => void;
    toggleTransformationVisibility: (id: string) => void;
    addTransformation: (transformation: Omit<Transformation, "id">, position?: number) => string;
    removeTransformation: (id: string) => void;
    updateTransformation: (id: string, updatedTransformation: Omit<Transformation, "id">) => void;
    setShowOriginal: (showOriginal: boolean) => void;
    _setSidebarState: (state: "none" | "type" | "config") => void;
    _setSelectedTransformationKey: (key: string | null) => void;
    _setTransformationToEdit: (transformationId: string | null, position?: "inplace" | "above" | "below") => void;
};
declare const useEditorStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<EditorState<RequiredMetadata> & EditorActions<RequiredMetadata>>, "subscribe"> & {
    subscribe: {
        (listener: (selectedState: EditorState<RequiredMetadata> & EditorActions<RequiredMetadata>, previousSelectedState: EditorState<RequiredMetadata> & EditorActions<RequiredMetadata>) => void): () => void;
        <U>(selector: (state: EditorState<RequiredMetadata> & EditorActions<RequiredMetadata>) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
            equalityFn?: ((a: U, b: U) => boolean) | undefined;
            fireImmediately?: boolean | undefined;
        } | undefined): () => void;
    };
}>;
export { useEditorStore };
