import { ontology, rack, task } from '@synnaxlabs/client';
import { Optional } from '@synnaxlabs/x';
import { z } from 'zod';
import { Flux } from '../../flux';
import { Ontology } from '../../ontology';
export declare const FLUX_STORE_KEY = "tasks";
export declare const RESOURCE_NAME = "Task";
export declare const PLURAL_RESOURCE_NAME = "Tasks";
export interface FluxStore extends Flux.UnaryStore<task.Key, task.Task, ChangeVariant> {
}
export interface FluxSubStore extends Flux.Store {
    [FLUX_STORE_KEY]: FluxStore;
    [Ontology.RELATIONSHIPS_FLUX_STORE_KEY]: Ontology.RelationshipFluxStore;
    [Ontology.RESOURCES_FLUX_STORE_KEY]: Ontology.ResourceFluxStore;
}
type ChangeVariant = "payload" | "status";
export declare const useStatusSynchronizer: (onStatus: (status: task.Status) => void) => void;
export declare const FLUX_STORE_CONFIG: Flux.UnaryStoreConfig<FluxSubStore>;
export type RetrieveQuery = task.RetrieveSingleParams;
export declare const retrieveSingle: <Type extends z.ZodLiteral<string> = z.ZodLiteral<string>, Config extends z.ZodType = z.ZodType, StatusData extends z.ZodType = z.ZodType>({ query, schemas, client, store, }: Flux.RetrieveParams<RetrieveQuery, FluxSubStore> & {
    schemas?: task.Schemas<Type, Config, StatusData>;
}) => Promise<task.Task<Type, Config, StatusData>>;
export declare const createRetrieve: <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<{
    key: string | number | bigint;
    includeStatus?: boolean | undefined;
} | {
    name: string;
    includeStatus?: boolean | undefined;
} | {
    type: string;
    rack?: number | undefined;
}, task.Task<Type, Config, StatusData> | null>;
export declare const useRetrieve: Flux.UseRetrieve<{
    key: string | number | bigint;
    includeStatus?: boolean | undefined;
} | {
    name: string;
    includeStatus?: boolean | undefined;
} | {
    type: string;
    rack?: number | undefined;
}, task.Task<z.ZodLiteral<string>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>> | null>;
export interface ListQuery extends task.RetrieveMultipleParams {
}
export declare const useList: Flux.UseList<ListQuery, 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 CreateFormParams<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 FormQuery {
    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, }: CreateFormParams<Type, Config, StatusData>) => Flux.UseForm<FormQuery, FormSchema<Type, Config, StatusData>, FluxSubStore>;
export type DeleteParams = task.Key | task.Key[];
export declare const useDelete: Flux.UseUpdate<DeleteParams, DeleteParams, z.ZodNever>;
export interface SnapshotPair extends Pick<task.Payload, "key" | "name"> {
}
export interface SnapshotParams {
    tasks: SnapshotPair | SnapshotPair[];
    parentID: ontology.ID;
}
export declare const useCreateSnapshot: Flux.UseUpdate<SnapshotParams, SnapshotParams, z.ZodNever>;
export interface UseRenameArgs extends Pick<task.Payload, "key" | "name"> {
}
export declare const useRename: Flux.UseUpdate<UseRenameArgs, UseRenameArgs, z.ZodNever>;
export type CommandParams = task.NewCommand | task.NewCommand[];
export declare const shouldExecuteCommand: <StatusData extends z.ZodType = z.ZodType>(status: task.Status<StatusData>, command: string) => boolean;
export declare const useCommand: Flux.UseUpdate<CommandParams, {
    key: string;
    name: string;
    variant: "error" | "success" | "disabled" | "loading" | "info" | "warning";
    message: string;
    time: import('@synnaxlabs/x').TimeStamp;
    details: {
        task: string;
        running: boolean;
        data: unknown;
    };
    description?: string | undefined;
    labels?: {
        key: string;
        name: string;
        color: string;
    }[] | undefined;
}[], z.ZodNever>;
export {};
//# sourceMappingURL=queries.d.ts.map