import { Controller } from "./controller.js"; import type { ControllerRoute, ControllerRouteParams } from "./route-params.js"; export declare abstract class CommandController extends Controller { readonly __route?: TRoute; abstract execute(...params: [...routeParams: Array, body: TReqBody]): Promise; } export type CommandControllerRequestBody = T extends abstract new (...args: Array) => infer TInstance ? TInstance extends CommandController ? TReqBody : never : T extends CommandController ? TReqBody : never; export type CommandControllerResponseBody = T extends abstract new (...args: Array) => infer TInstance ? TInstance extends CommandController ? TResBody : never : T extends CommandController ? TResBody : never; /** * Endpoint contract for a command (write) operation, derived entirely from the concrete * `CommandController` that serves it: the route (from the controller's declared route), its resolved * params, the request body, and the response body. A single generic is all a client passes (e.g. to * `RpcClient.command`), and there is no separate route argument that could drift from the controller. * * @example * type CreateTodo = CommandEndpoint; */ export type CommandEndpoint | (abstract new (...args: Array) => CommandController)> = { readonly route: ControllerRoute; readonly params: ControllerRouteParams>; readonly req: CommandControllerRequestBody; readonly res: CommandControllerResponseBody; }; //# sourceMappingURL=command-controller.d.ts.map