import { rack, task } from '@synnaxlabs/client';
import { Optional } from '@synnaxlabs/x';
import { z } from 'zod';
import { Flux } from '../../flux';
export declare const FLUX_STORE_KEY = "tasks";
export interface FluxStore extends Flux.UnaryStore<task.Key, task.Task, ChangeVariant> {
}
interface SubStore extends Flux.Store {
    [FLUX_STORE_KEY]: FluxStore;
}
type ChangeVariant = "config" | "status";
export declare const useStatusSynchronizer: (onStatus: (status: task.Status) => void) => void;
export declare const FLUX_STORE_CONFIG: Flux.UnaryStoreConfig<SubStore>;
export interface RetrieveQueryParams {
    key?: task.Key;
    includeStatus?: boolean;
}
export declare const createRetrieveQuery: <Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType>(schemas: task.Schemas<Type, Config, StatusData>) => Flux.CreateRetrieveReturn<RetrieveQueryParams, task.Task<Type, Config, StatusData> | null>;
export interface ListParams {
    term?: string;
    offset?: number;
    limit?: number;
}
export declare const useList: Flux.UseList<ListParams, string, task.Task<z.ZodLiteral<string>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
export type FormSchema<Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType> = z.ZodType<{
    key?: task.Key;
    name: string;
    rackKey: rack.Key;
    type: z.infer<Type>;
    snapshot: boolean;
    config: z.infer<Config>;
    status?: z.infer<ReturnType<typeof task.statusZ<StatusData>>>;
}>;
export interface CreateFormArgs<Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType> {
    schemas: task.Schemas<Type, Config, StatusData>;
    initialValues: InitialValues<Type, Config, StatusData>;
}
export interface InitialValues<Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType> extends Optional<task.Payload<Type, Config, StatusData>, "key"> {
    key?: task.Key;
}
export interface UseFormParams {
    key?: task.Key;
}
export declare const createForm: <Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType>({ schemas, initialValues, }: CreateFormArgs<Type, Config, StatusData>) => Flux.UseForm<UseFormParams, FormSchema<Type, Config, StatusData>>;
export {};
//# sourceMappingURL=queries.d.ts.map