import { ModelProps, ModelResponse } from '../types';
import { GetModelQueryOptionsArgs, ModelQueryOptions } from './get-model-query-options';
import { useSourceSlices } from './use-source-slices';
type SourceSlices = ReturnType<typeof useSourceSlices>;
/**
 * Per-model query options factory signature. Each model file (categories.tsx,
 * formula.tsx, …) defines a function with this shape (`getCategories`,
 * `getFormula`, …) and feeds the same function back into `createModel` so the
 * hook's `useQuery` and any imperative `queryClient.prefetchQuery(getXxx(...))`
 * go through identical code — single source of truth for query-key + query-fn
 * construction.
 */
export type ModelQueryFactory<TWidgetProps extends object, TResponse> = (args: Omit<GetModelQueryOptionsArgs<TWidgetProps, TResponse>, 'queryKeyPrefix' | 'getWidgetMethod'>) => ModelQueryOptions<TResponse>;
interface CreateModelArgs<TWidgetProps extends object, TResponse> {
    buildQuery: ModelQueryFactory<TWidgetProps, TResponse>;
}
export declare function createModel<TWidgetProps extends object, TResponse>({ buildQuery, }: CreateModelArgs<TWidgetProps, TResponse>): {
    useModelHook: <P extends ModelProps<TWidgetProps, TResponse>>(props: P, slices: SourceSlices) => P extends {
        sourceId: string;
        sourcesId?: string[];
    } ? ModelResponse<TResponse> : ModelResponse<TResponse[]>;
};
export {};
