import { BuildProcedure, ProcedureBuilder } from "@trpc/server";
import { PaginatedRequest, PaginatedResponse, TData } from "../types";
import { z } from "zod";
import { UseMutationResult, UseQueryResult } from "@tanstack/react-query";
import { getModelForClass } from "@typegoose/typegoose";
export type QueryOperation = BuildProcedure<"query", any, any>;
export type MutateOperation = BuildProcedure<"mutation", any, any>;
export interface MongoCrudOverrides {
    create: MutateOperation;
    get: QueryOperation;
    update: MutateOperation;
    delete: MutateOperation;
}
export interface MongoCrudSchema {
    create: z.ZodSchema;
    get: z.ZodSchema;
    update: z.ZodSchema;
    delete: z.ZodSchema;
}
export interface MongoCrudReturn {
    create: MutateOperation;
    get: QueryOperation;
    update: MutateOperation;
    delete: MutateOperation;
}
export interface QueryableMongoCrudReturn<T extends TData> {
    get: {
        useQuery: (props: PaginatedRequest) => UseQueryResult<PaginatedResponse<T>>;
    };
    create: {
        useMutation: (props: Partial<T>) => UseMutationResult<T>;
    };
    update: {
        useMutation: (props: Partial<T>) => UseMutationResult<T>;
    };
    delete: {
        useMutation: (props: Partial<T>) => UseMutationResult;
    };
}
export interface MongoCrudProps<T extends TData> {
    model: ReturnType<typeof getModelForClass>;
    procedure: ReturnType<ProcedureBuilder<any>["use"]>;
    inputSchema: MongoCrudSchema;
    overrides?: MongoCrudOverrides;
}
export declare const mongoCrud: <T extends object>({ model, procedure, inputSchema, overrides, }: MongoCrudProps<T>) => MongoCrudReturn;
//# sourceMappingURL=mongo-crud.d.ts.map