import type { VariableDeclaration } from "ts-morph"; import ts from "typescript"; import type { FunctionDescription } from "./common.mjs"; export declare const createApiResponseType: ({ methodName, }: { methodName: string; }) => { /** * DefaultResponseDataType * * export type MyClassMethodDefaultResponse = Awaited> */ apiResponse: ts.TypeAliasDeclaration; /** * This will be the name of the type of the response type of the method * * MyClassMethodDefaultResponse */ responseDataType: ts.TypeParameterDeclaration; }; export declare function getRequestParamFromMethod(method: VariableDeclaration): ts.ParameterDeclaration | null; /** * Return Type * * export const classNameMethodNameQueryResult = UseQueryResult; */ export declare function createReturnTypeExport({ methodName, defaultApiResponse, }: { methodName: string; defaultApiResponse: ts.TypeAliasDeclaration; }): ts.TypeAliasDeclaration; /** * QueryKey */ export declare function createQueryKeyExport({ methodName, queryKey, }: { methodName: string; queryKey: string; }): ts.VariableStatement; export declare function hookNameFromMethod({ method, }: { method: VariableDeclaration; }): string; export declare function createQueryKeyFromMethod({ method, }: { method: VariableDeclaration; }): string; /** * Creates a custom hook for a query * @param queryString The type of query to use from react-query * @param suffix The suffix to append to the hook name */ export declare function createQueryHook({ queryString, suffix, responseDataType, requestParams, method, }: { queryString: "useSuspenseQuery" | "useQuery"; suffix: string; responseDataType: ts.TypeParameterDeclaration; requestParams: ts.ParameterDeclaration[]; method: VariableDeclaration; }): ts.VariableStatement; export declare const createUseQuery: ({ method, jsDoc }: FunctionDescription) => { apiResponse: ts.TypeAliasDeclaration; returnType: ts.TypeAliasDeclaration; key: ts.VariableStatement; queryHook: ts.VariableStatement; suspenseQueryHook: ts.VariableStatement; queryKeyFn: ts.VariableStatement; }; export declare function getQueryKeyFnName(queryKey: string): string;