import type { Service } from "./index.js"; export type ServiceFnClosure = (req: Request) => Promise | Response; /** * Returns a new {@link ServiceFn} with a given closure.. * * @example * ```ts * import { serviceFn } from "@taxum/core/service"; * * const service = serviceFn( * (req) => HttpResponse.builder().body("Hello World") * ); * ``` */ export declare const serviceFn: (f: ServiceFnClosure) => Service; /** * A {@link Service} implemented by a closure. * * @see {@link serviceFn} */ export declare class ServiceFn implements Service { private readonly f; constructor(f: ServiceFnClosure); invoke(req: Request): Promise; }