import type { HttpRequest, HttpResponse } from "../http/index.js"; /** * A service that can be invoked with a request and returns a response. */ export type Service = { /** * Process the request and return the response asynchronously. */ invoke: (req: Request) => Promise | Response; }; /** * Represents an HTTP-specific service. * * The `HttpService` type represents a service capable of processing HTTP * requests and returning HTTP responses. It is designed as a generic type to * allow for customization of the response structure. * * @see {@link Service} */ export type HttpService = Service; export type AnyService = Service; export type UnknownService = Service; export type InferRequest = S extends Service ? Request : never; export type InferResponse = S extends Service ? Response : never; export * from "./service-fn.js";