The exact API contract type (preserving endpoint builder generics).
// Given:
const api = defineApi({
todos: { list: ..., create: ..., delete: ... },
auth: { login: ... },
});
type Client = TypedClient<typeof api>;
// {
// todos: {
// list: (args: { query: ... }) => Promise<TodoResponse[]>,
// create: (args: { body: ... }) => Promise<TodoResponse>,
// delete: (args: { params: ... }) => Promise<void>,
// },
// auth: {
// login: (args: { body: ... }) => Promise<{ token: string }>,
// },
// }
Maps an ApiContract to a fully typed client object.
Each group becomes a namespace and each endpoint within that group becomes a callable async function (HTTP) or subscription factory (WS).