type State<T> = {
    status: 'pending';
    data: undefined;
    error: null;
} | {
    status: 'success';
    data: T;
    error: null;
} | {
    status: 'error';
    data: undefined;
    error: Error;
} | {
    status: 'idle';
    data: undefined;
    error: null;
};
type Operation<T> = {
    key: unknown[];
    fn: () => Promise<T>;
};
type OperationStore = {
    statusById: Record<string, State<any>>;
    onIdle: (id: unknown[]) => void;
    onPending: (id: unknown[]) => void;
    onSuccess: (id: unknown[], data: any) => void;
    onError: (id: unknown[], error: Error) => void;
};
export declare const useOperationStore: import("zustand").UseBoundStore<import("zustand").StoreApi<OperationStore>>;
export declare const runOperation: <T>(operation: Operation<T>) => Promise<T>;
export declare const runOperationsMany: <T extends Operation<any>[]>(operations: [...T]) => Promise<{ [K in keyof T]: T[K] extends Operation<infer R> ? R : never; }>;
export declare const useOperation: <T>(operation: Operation<T>) => State<T>;
export declare const useOperationWithKey: <T>(key: unknown[]) => State<T>;
export declare const useManyOperations: <T extends Operation<any>[]>(operations: [...T]) => { [K in keyof T]: State<T[K] extends Operation<infer R> ? R : never>; };
export {};
