import type { RpcCaller } from "@cratestack/ts-types"; import type { QueryKey } from "@tanstack/query-core"; export type { RpcCaller } from "@cratestack/ts-types"; /** The `[opId, input]` tuple every helper below keys its query/mutation * on — exported so callers can `queryClient.invalidateQueries({ queryKey: rpcQueryKey(opId, input) })` * without re-deriving the same shape by hand. */ export declare function rpcQueryKey(opId: string, input?: unknown): QueryKey; /** Builds a `{ queryKey, queryFn }` pair for `useQuery` (or its * vue-query/solid-query/svelte-query equivalents — all built on * `@tanstack/query-core`) from a single unary RPC call. Framework- * agnostic: pass the result straight through, or spread it alongside * your own `staleTime`/`enabled`/etc. */ export declare function rpcQueryOptions(client: RpcCaller, opId: string, input: I): { queryKey: QueryKey; queryFn: (context: { signal: AbortSignal; }) => Promise; }; /** Builds a `{ mutationKey, mutationFn }` pair for `useMutation`. The * input is supplied at call time (`mutate(input)`), not here — mirrors * the generated `useCreateXMutation`/`useUpdateXMutation` hooks' * shape. */ export declare function rpcMutationOptions(client: RpcCaller, opId: string): { mutationKey: QueryKey; mutationFn: (input: I) => Promise; }; /** True when `error` is a `CratestackRpcError`-shaped value (or a * decoded `RpcErrorBody`) whose `code` matches — structural, not an * `instanceof` check, since `CratestackRpcError` is a per-project * generated class with no shared import path. Useful in * `retry`/`throwOnError` callbacks, e.g. never retrying a * `"not_found"`. */ export declare function isRpcErrorCode(error: unknown, code: string): boolean; //# sourceMappingURL=index.d.ts.map